Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

237
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda