Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
I can't connect to Metamask mobile browser using web3.js

I am trying to connect a Dapp to Metamask. My code works, but not on mobile (using Metamasks built-in browser). This is the code:

<script type="text/javascript">
    if (window.ethereum) {
    handleEthereum();
  } else {
    window.addEventListener('ethereum#initialized', handleEthereum, {
      once: true,
    });

    // If the event is not dispatched by the end of the timeout,
    // the user probably doesn't have MetaMask installed.
    setTimeout(handleEthereum, 3000); // 3 seconds
  }

  function handleEthereum() {
    const { ethereum } = window;
    if (ethereum && ethereum.isMetaMask) {
      console.log('Ethereum successfully detected!');
    } else {
      console.log('Please install MetaMask!');
    }
  }

</script>

I tried waiting 15 seconds instead of 3, but it didn't work anyways. I am using Webflow, and adding JavaScript custom code to it. I don't know if that could be the problem.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I did it in the following way

const base64image = 'imagen';
    ethereum.request({
      method: 'wallet_watchAsset',
      params: {
        type: 'ERC20',
        options: {
          address: wallet,
          symbol: simbolo,
          decimals: 18,
          image: base64image,
        },
      },
    }); 

This part was for the browser, for the mobile I have not been able to solve it.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!