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

139
Views
manejo de errores window.open o window.location.replace
const openInstallPage = () => { const md = new MobileDetect(navigator.userAgent); if (md.is("iPhone")) { window.open( "https://apps.apple.com/us/app/metamask-blockchain-wallet/id1438144202" ); } else if (md.os() || md.mobile()) { try { window.open( "https://metamask.app.link/dapp/emirpreview.vercel.app" //deeplink, this url will try to open metamask mobile app. If it cant, i want to redirect user to install page. ); } catch (err) { window.open("https://play.google.com/store/apps/details?id=io.metamask"); } } else { window.open( "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn" ); } };

Cuando alguien hace clic en mi botón en el móvil, quiero redirigir al usuario a la aplicación metamask si está instalada. Si no es así, quiero redirigir al usuario a la página de instalación de metamask.

¿Cómo puedo manejar esto? Pruebe los métodos de captura que no funcionan en absoluto... ¿Estoy haciendo algo mal?

Nota: quiero hacer estas cosas en el móvil, así que estoy usando el paquete mobile-deteck de npm.

about 4 years ago · Juan Pablo Isaza
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!