Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

190
Visualizações
Using navigator.share() to detect mobile users?

I'm trying to detect if a user visiting my webapp is a mobile user or not. I've seen various implementations (example1, example2, example3) but none of them seem to be foolproof or recommended.

I have never seen anyone mention checking if (navigator.share) as a method to determine if a user is on mobile or desktop. The if statement correctly distinguishes between desktop and mobile users in my app (source).

Can I rely on this if statement check? If not, what are the drawbacks to using this approach?

(Note: caniuse states that navigator.share only has 87% coverage, but what if I just assume that's "good enough"?)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Microsoft Edge on Windows supports the Web Share API, so this is definitely not a good method to distinguish mobile from desktop users. On modern Chromium browsers, you can simply call the following API:

const isMobile = navigator.userAgentData.mobile;
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda