Single-file app with xulrunner - possible?

女生的网名这么多〃 提交于 2019-12-05 19:39:41

I don't believe you could ever create single-file XULRunner applications. The -chrome <...> parameter probably used to work, I guess the "Remote XUL" error comes from the fact that the URL is file://, not chrome://.

You could use something like the Live XUL Editor in the Developer Assistant (formerly Extension Developer's extension) to test XUL quickly.

The general idea I hear these days is that you should write HTML5 instead, whenever you can, since it is more actively developed, more well-known technology with less incompatible changes and better tooling...

tst

Here is the answer I wrote for another related question, reproduced here because it may help someone who want to know how to package their XUL application.

It is too bad that xulrunner can not run a zipped .xpi or .xulapp directly, but it is possible to package most of your .js, .xul, .css and .png files into a jar and wrap everything up with a private copy of xulrunner, without having to run --install-app

These are the steps I went through to package our XUL application.

The first step is to put all your files (except application.ini, chrome.manifest, and prefs.js) into a .jar file like this (all of this was carried out under Windows, make appropriate adjustments for Linux and OSX)

zip -r d:\download\space\akenispace.jar * -i *.js *.css *.png *.xul *.dtd 

Then in d:\download\space, layout your files as follows:

D:\download\space\akenispace.jar
D:\download\space\application.ini
D:\download\space\chrome.manifest
D:\download\space\defaults
D:\download\space\defaults\preferences
D:\download\space\defaults\preferences\prefs.js

The content of the files are as follows

application.ini

[App]
Vendor=Akeni.Technologies
Name=Akeni.Space
Version=1.2.3
BuildID=20150125
Copyright=Copyright (c) 2015
ID=space@akeni.com

[Gecko]
MinVersion=1.8
MaxVersion=35

chrome.manifest

content     akenispace             jar:akenispace.jar!/chrome/content/
skin        akenispace    default  jar:akenispace.jar!/chrome/skin/
locale      akenispace    en-US    jar:akenispace.jar!/chrome/locale/en-US/
resource    akenispace             jar:akenispace.jar!/chrome/resource/

prefs.js

pref("toolkit.defaultChromeURI", "chrome://akenispace/content/space.xul");

Now you can put these files into your .wxs for WiX and produce an MSI file for Wndows.

Of course you need to include all the files for XULRunner as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!