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

188
Views
HTML: How can I have a popup only show on a certain os?

I have a web app (Sleepyheads) and have made it into an android app. I want a popup asking to download the app ONLY on android devices. How can I do this?

I'm using html 5 and VS code

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

0

you have to use javascript to find what is your user device.

this code says to you what is user os and device is.

navigator.userAgent
about 4 years ago · Juan Pablo Isaza Report

0

You can use navigator.userAgent to get the browser string.

You will get reply like this.

'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36'

You can then check for Android word with includes

let browsertype=navigator.userAgent;
if(browsertype.includes("Android")){
    //Navigate to Play store link or other URL
    alert("Please follow the link to download App");
}
about 4 years ago · Juan Pablo Isaza Report

0

You can find this type of info in the window.navigator.userAgent. In order to better work with that info, you can use a parser, something like https://github.com/faisalman/ua-parser-js. Then is just a condition based on the OS.

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!