Study for XULRunner as Prism, using Firefox
Mission: run a web application without the normal browser UI, as a XULRunner application but using Firefox (version 3 and above).
I am a Firefox funboy. So I want to use Gecko rather than WebKit (Electron).
Idea
XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird.
Firefox (from version 3) ships with a private XULRunner package, which can run any compatible XULRunner application using the
-app
switch:firefox -app application.ini
is equivalent toxulrunner -app application.ini
Prism is a simple XULRunner-based browser that hosts web applications without the normal web browser user interface.
Solution
Example: view https://www.google.com/
without the normal browser UI.
Souce code is available on github cat-in-136/study-for-xulrunner-as-prism-using-firefox.
Normal approach
Open app.xul
when the XULRunner_as_prism application is lanched.
And then app.xul
load the web page – https://www.google.com/
-
application.ini
-
defaults/preferences/prefs.js
-
chrome.manifest
content xrap content/
-
content/app.xul
How to run: firefox -app application.ini
Minimum code solution
XULRunner FAQ says:
- If I use XULRunner do I have to write my application in XUL?
- No! You can write your application in any language supported by the Mozilla web platform, including HTML, XHTML, SVG, or XUL.
Wow!
-
application.ini (No Change)
-
defaults/preferences/prefs.js
How to run: firefox -app application.ini
Note: profile folder location
The profile folder is placed in %APPDATA%\cat_in_136
(for windows) or ~/.cat_in_136
(for unix).
You may remove this folder after you close this XULRunner_as_prism application.
References
- Prism - Archive of obsolete content, MDN
- Chromeless Browser, Mozilla Labs
- XULRunner - Mozilla, MDN
- XULRunner FAQ - Mozilla, MDN