Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8471929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:55:47+00:00 2026-06-10T16:55:47+00:00

Is it possible to detect if the user is accessing through the browser or

  • 0

Is it possible to detect if the user is accessing through the browser or application using JavaScript?

I’m developing a hybrid application to several mobile OS through a web page and a PhoneGap application and the goal would be to:

  1. Use the same code independently of the deployment target
  2. Add PhoneGap.js file only when the user agent is an application
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:55:49+00:00Added an answer on June 10, 2026 at 4:55 pm

    You could check if the current URL contains http protocol.

    var app = document.URL.indexOf( 'http://' ) === -1 && document.URL.indexOf( 'https://' ) === -1;
    if ( app ) {
        // PhoneGap application
    } else {
        // Web page
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Best way to detect when user leaves a web page Check if
Is it possible to detect, using JavaScript, when the user changes the zoom in
Possible Duplicate: Best way to detect when user leaves a web page I'm looking
Is it possible to detect user identity from browser using asp.net/vb.net/c# except IP address.
Is it possible to detect iPhone browser agent in .htaccess and redirect the user
Is it possible to detect when the user unfocuses an input box using jquery?
I am going to write some web application which should detect user's country and
Possible Duplicate: How can I detect the browser with PHP or JavaScript? I need
Is it possible to detect a page refresh within a Jquery mobile HTML5 page?
Using Java, is it possible to detect user actions, such as key-presses, mouse-button-presses, and/or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.