-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lost wakeup with ethereum.enable() using many browser tabs #5941
Comments
There are more cases of such behavior:
|
+1! |
the same issue is on my side guys |
I have same issue! |
Thanks for filing this @kkostalkowicz. We're investigating this issue now and hope to include a fix as part of the next release. |
Merged
ghost
added
the
in progress
label
Jan 9, 2019
There is a workaround using an event listener. Before you need any web3: document.addEventListener('visibilitychange', this.enable, false) Enable call: enable = () => {
if(document.hidden) return;
window.ethereum.enable()
.then((address) => { /* Your setup with enabled web3 */ })
.finally(() => {
document.removeEventListener('visibilitychange', this.enable, false)
});
} |
ghost
removed
the
in progress
label
Jan 30, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a dapp using ethereum.enable() is opened in two browser tabs, reloading two tabs at the same time locks one of them (the other loads successfully).
Steps to reproduce the behavior:
Both tabs should log 'init' and 'enabled' to the console.
Note that I had granted the permission for MetaMask to inject ethereum account for the location, so no popup appeared during the bug reproduction.
To reproduce, the HTML file location must be http://, file:// does not work.
Software versions:
The text was updated successfully, but these errors were encountered: