mozilla

Compare Revisions

Code snippets

Change Revisions

Revision 441909:

Revision 441909 by Tobias Schmidbauer on

Revision 484375:

Revision 484375 by Np on

Title:
Mobile
Mobile
Slug:
Code_snippets/Mobile
Code_snippets/Mobile
Content:

Revision 441909
Revision 484375
tt123    <h2>
124      Supporting both desktop and mobile
125    </h2>
126    <p>
127      The same add-on can support both desktop and mobile version
 >s of Firefox. Some of the capabilities between the platforms are 
 >different, and may require some pieces of separate logic.
128    </p>
129    <h3 id="Detecting_XUL_Support">
130      Detecting XUL support
131    </h3>
132    <p>
133      Mobile add-ons do not support using XUL for the UI. Mobile 
 >UI can be implemented in HTML. To detect if the platform supports
 > XUL:
134    </p>
135    <pre>
136function isXULAvailable() {
137  return Components.classes["@mozilla.org/xre/app-info;1"].getSer
 >vice(Components.interfaces.nsIXULRuntime)
138    .widgetToolkit.toLowerCase() != "android"
139}
140</pre>

Back to History