You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isMobileAppBrowser can distinguish whether the page is opened in the mobile web browser.
Though even if it's a mobile web browser, it might not be a dapp browser, meaning it doesn't have window.ethereum.
The wallet apps with a dapp browser that I've currently tested include:
Trust Wallet
Coinbase Wallet
MetaMask Wallet.
You can use Telegram to test the mobile app browser without window.ethereum.
Currently, testing has only been conducted on iPhone SE 2.
functionisMobileAppBrowser(){constuserAgent=navigator.userAgent// for iosif(!userAgent.includes('Safari/')&&userAgent.includes('Mobile/')){returntrue}// for androidif(userAgent.includes('wv')||userAgent.includes('WebView')){returntrue}returnfalse}
Specification
isMobileAppBrowser & isWindowEthereumAvailable
isMobileAppBrowser
can distinguish whether the page is opened in the mobile web browser.Though even if it's a mobile web browser, it might not be a dapp browser, meaning it doesn't have
window.ethereum
.window.ethereum
.autoConnect
== trueWhen the page loads and initiates automatic connection,
isMobileAppBrowser == true
isWindowEthereumAvailable == true
It directly connects to
window.ethereum
.isWindowEthereumAvailable == false
It doesn't execute
connectTo
.isMobileAppBrowser == false
it retrieves the RDNS of the last connected browser wallet from local storage and attempts to connect to it.
autoConnect
== falseWhen the modal is opened,
isMobileAppBrowser == true
isWindowEthereumAvailable == true
It directly connect to
window.ethereum
without showing the modal.isWindowEthereumAvailable == false
The modal will show the text "No wallet provider found 😔".
isMobileAppBrowser == false
It displays a list of EIP-6963 providers. If there are no EIP-6963 providers, the modal will show the text "No wallet provider found 😔".
Testing
vue-dapp/app -> app.vue ->
VueDappModal
withauto-connect
vue-dapp/app -> app.vue ->
VueDappModal
withoutauto-connect
The text was updated successfully, but these errors were encountered: