title: Detect if running inside PhoneGap/ Cordova
body: <p>There has been a few questions how to detect an HTML page is running inside a device as a phonegap application.</p>
  
  <p>Most of the solutions (<a href="https://stackoverflow.com/questions/10347539/detect-between-a-mobile-browser-or-a-phonegap-application">here</a> and <a href="https://stackoverflow.com/questions/8068052/phonegap-detect-if-running-on-desktop-browser">here</a>) have been</p>
  
  <ol>
  <li>Detect if browser agent is iPhone/iPad/Android/Blackberry</li>
  <li>Use 'deviceready' event to detect if running inside a device.</li>
  <li>Use URL to detect whether protocol is HTTP or FILE</li>
  </ol>
  
  <p>Are there any other solutions? All 3 won't work for me since I run the development HTML files locally before compiling the app, as a result it will detect 1). and 2). will fire and 3). is indeed FILE protocol.</p>