Onboarding library
As an Ethereum enabled site developer, sending users offsite to install MetaMask presents challenges. Most notably, you must inform the user to return to your site and refresh their browser after the installation. Your site detects the user's newly installed MetaMask extension only after that refresh.
MetaMask now provides an onboarding library designed to improve and simplify the onboarding experience. The new library exposes an API to initiate the onboarding process. In the process, it registers your site as the origin of the onboarding request. MetaMask checks for this origin after the user completes the onboarding flow. If it finds an origin, the final confirmation button of the MetaMask onboarding flow indicates that the user will be redirected back to your site.
Learn how to use the onboarding library.
The following is a diagram of the interactions between the onboarding library, the forwarder, and the extension: