Could browser inside a machine obtain the machine's MAC address? I'm building an API which need obtain unique identification of the machine (ideally, it could be MAC address), however, after discussion and research, I realize browsers don't support this. If not, any way the browser could obtain device related data which could be used to replace MAC address?
Could browser inside a machine obtain the machine's MAC address? I'm building an API which need obtain unique identification of the machine (ideally, it could be MAC address), however, after discussion and research, I realize browsers don't support this. If not, any way the browser could obtain device related data which could be used to replace MAC address?
The Answer is no, a browser can't access the MAC address of a Device, with regular Js. However, have you explored Node JS? It has a Mac Plugin that perhaps could be used in conjunction with another plugin called Browserify, Which could get you what you wanted. The benefit of using node is the massive amount of plugins that allow you to do things with js in your browser that you can't otherwise.
But you could create a unique UID on the page load, and save it somehow through localstorage, and pull that when you need a Device Specific ID. This won't work cross browser though. Hope this points you in the right direction. Good Luck.
For IE and ActiveX allowed:
function networkInfo(){
var wmi = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = wmi.ConnectServer(".");
e = new Enumerator(service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
for(; !e.atEnd(); e.moveNext()) {
var s = e.item();
var macAddress = unescape(s.MACAddress);
}
return macAddress;
}
alert(networkInfo());