home *** CD-ROM | disk | FTP | other *** search
- // Returns true if the extension is running on a Mac
- function webdeveloper_isMac()
- {
- var appInfo = Components.classes["@mozilla.org/xre/app-info;1"];
-
- // If app info is set
- if(appInfo)
- {
- // If the OS is set to Darwin
- if(appInfo.getService(Components.interfaces.nsIXULRuntime).OS == "Darwin")
- {
- return true;
- }
- }
- else if(!webdeveloper_isPreferenceSet("general.platform.override") && navigator.platform.indexOf("Mac") == 0)
- {
- return true;
- }
-
- return false;
- }