-3

Is there a way to enforce browser or web page to use 3G network ( not Wi-Fi ). I don't want to use any native code, I have to do this in JavaScript code.

Dropout
  • 13,653
  • 10
  • 56
  • 109
Vid
  • 97
  • 1
  • 1
  • 5
  • You can get, you cannot set – A. Wolff Feb 25 '14 at 12:37
  • 3
    why do you want this ?? – Francois Borgies Feb 25 '14 at 12:37
  • https://dvcs.w3.org/hg/dap/raw-file/tip/network-api/Overview.html – Deepak Ingole Feb 25 '14 at 12:37
  • 1
    Exactly, the question is why would you want to do that anyway? Using my or any available Wi-Fi usually comes at no or little extra cost – whereas being forced to use a mobile connection would could into the usually limited traffic, and is therefor highly likely to cause significant extra cost. – CBroe Feb 25 '14 at 12:42
  • JavaScript running in a browser for a page runs in the client browser once a response to particular request has been served (either a static set of files or a response built up with an application). The connection is not in the same OSI layer as the connection to the internet http://en.wikipedia.org/wiki/OSI_model. – StuperUser Feb 25 '14 at 12:45
  • this is project requirement, i know its weird, but m still not getting any relevant info – Vid Feb 25 '14 at 12:56

1 Answers1

0

It's not so simple at the moment. The browser would have to give out that information. Firefox started recently an experimental feature which allows this via the navigator DOM object, but it's the only browser that supports it so far.

Check out navigator.connection.

Dropout
  • 13,653
  • 10
  • 56
  • 109