How to get MAC Address in Firefox using Javascript?
The following code is working in IE,
var macAddress = "";
var ipAddress = "";
var computerName = "";
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
for(; !e.atE开发者_开发技巧nd(); e.moveNext()) {
var s = e.item();
macAddress = s.MACAddress;
ipAddress = s.IPAddress(0);
computerName = s.DNSHostName;
}
in Firefox It is not working because of ActiveX.
Firefox does not support ActiveX technology for multiple reasons.
ActiveX is only available on Windows operating systems, and as a result webpages that require it will not work on Linux or Mac. ActiveX integration with the Windows operating system has made it a target for malicious software. Firefox uses plugins to view and use multimedia content embedded in web pages, and extensions to add new functions.
so what you need is a firefox plugin like this one: https://addons.mozilla.org/en-US/firefox/addon/mediawrap/
精彩评论