javascript - Getting user's internet connection basic information on a chrome extensions? -


so i'm looking try , foot chrome extensions , had idea, don't know if possible. need basic information of user's internet connection, network's name example, differentiated 1 connection another.

what i'm looking open different tabs when starting google chrome depending on network user connected to. example, if user connected home network open things facebook or youtube, opposed work related websites when connected work network.

all i've been able find far check whether or not connection exists js, i'm tempted it's not possible, there way accomplish ? again, i'm new chrome extensions don't know of possible things can do.

there lots of ways this, can use network information api

networkinformation.connection  

which supported in chrome.

do

var connection = navigator.connection || navigator.webkitconnection; 

this give access boolean (which have) or value.

but think you're looking ip detect, because range same "home network" network itself, network name, , data wouldn't available clientside code js. use deferred language python , hooked pyjamas.

http://pyjs.org/

edit: alternatively try using node. yes serverside, there resources implementing chrome extensions. using network module can sniff out lots of different information such

network.get_private_ip(function(err, ip) {   console.log(err || ip); // should give users public ip, find out }) 

or use

network.get_interfaces_list(function(err, list) { } 

to like

name: 'eth0', ip_address: '10.0.1.3', mac_address: '56:e5:f9:e4:38:1d', type: 'wired', netmask: '255.255.255.0', gateway_ip: '10.0.1.1'