git-svn-id: svn://euphorik.ch/pompage@45 02bbb61a-6d21-0410-aba0-cb053bdfd66a
[pompage.git] / doc / webdeveloper / common / platform.js
1 // Returns true if the extension is running on a Mac
2 function webdeveloper_isMac()
3 {
4 var appInfo = Components.classes["@mozilla.org/xre/app-info;1"];
5
6 // If app info is set
7 if(appInfo)
8 {
9 // If the OS is set to Darwin
10 if(appInfo.getService(Components.interfaces.nsIXULRuntime).OS == "Darwin")
11 {
12 return true;
13 }
14 }
15 else if(!webdeveloper_isPreferenceSet("general.platform.override") && navigator.platform.indexOf("Mac") == 0)
16 {
17 return true;
18 }
19
20 return false;
21 }