polkadot-js / extension

Simple browser extension for managing Polkadot and Substrate network accounts in a browser. Allows the signing of extrinsics using these accounts. Also provides a simple interface for compliant extensions for dapps.
Apache License 2.0
968 stars 405 forks source link

web3Enable promise stalled on first page load in extension-dapp #1236

Open attemka opened 1 year ago

attemka commented 1 year ago
  1. Create any react project (e.g CRA 5.x.x).
  2. Add the extension connection code:
    const connectWallet = async () => {
    console.log('Web3 Injected: ' + isWeb3Injected)
    const allInjected = await web3Enable('my cool dapp');
    const allAccounts = await web3Accounts();
    console.log(allAccounts)
    }        

    And the button which will execute it on click.

  3. Open new incognito window in chrome and go to the app page.
  4. Click the connection button. You'll see no action, even though it will be "Web3 Injected: true" in the console.
  5. Refresh the page and try again. You'll see normal behavior from now on.

Couldn't be reproduced in firefox browser.

User should be able to connect the extension even on new incognito window.

Please tell us about your environment:

niklasp commented 1 year ago

Same issue here