linux – 使用xulrunner的单文件应用程序 – 可能吗?

我以前曾试图弄乱xulrunner,现在我再次尝试:)

实际上,“真实”教程(Getting started with XULRunner – MDN)确实显示一个应该有application.ini和其他文件(可能压缩为.xpi,然后需要–install-app …),然后调用应该是这样的:

xulrunner `pwd`/application.ini

…但是,我想要一个更简单的启动方式 – 因此,我希望单文件XUL应用程序方法:)(这里的一个好注意是,也不能使用zipped .xpi作为xulrunner的参数,见XULRunner question – DonationCoder.com)

问题是,我几乎100%肯定在过去的某个时刻,我使用了一个简单的单文件XUL应用程序,如(伪代码):

xulrunner my-xul-app.extension

…但我不记得它是怎么回事:)所以,这可能与xulrunner,或只有火狐?

据我所知,我使用了像’my-xul-app.xul’这样的文件(作为单文件应用程序),它只会指定一个带有单个按钮的窗口(实际上并不是这样)由于缺乏javascript而做任何事情) – 我现在想重复同样的事情,以刷新我的记忆(除非我后来混淆了一些东西:))

首先,我找到了HOWTO: Getting Started with Linux Standalone Apps using XUL – Ubuntu Forums(2007),我修改了那里使用的example.xul文件:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id = "myapp"
title = "SQLite Example"
height = "420"
minHeight = "420"
width = "640"
minWidth = "640"
screenX = "10"
screenY = "10"
sizemode = "normal"
xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<spacer style = "height: 4px; cursor: default;" />
</window>

而我正试图按照链接中的建议“运行”这个:

firefox -no-remote -chrome file:$PWD/example.xul

…会发生什么是Firefox打开,窗口大小像1×1像素;如果你能找到手柄,你可以拉伸窗口,并阅读:

Remote XUL
This page uses an unsupported technology that is no longer available by default in Firefox.

哎哟:(对此的答案(如How do I fix the Remote XUL error I get when using Firefox 4.x and the Webmail Advanced Interface?)似乎与实际的远程xul有关(并推荐一个插件来处理);但我想要的只是在本地运行一个文件?!“远程”部分来自哪里? ?

另外,看到firefox开关’-app'(Using Firefox 3 as a XUL runtime environment);虽然它引用了application.ini,但我试过这个:

firefox -no-remote -app $PWD/example.xul

……而Firefox就像往常一样开始.

顺便说一句,我在firefox中找不到-app和-chrome命令行选项–help;)

但实际上,我真的不想使用firefox作为引擎 – 只是xulrunner;我尝试了Firefox方法,因为我认为它与xulrunner相同;事实证明它不是(即使你使用application.ini:Why does ‘firefox -App application.ini’ and ‘xulrunner application.ini’ behave differentely? | Firefox Support Forum):

无论如何,如果我只运行xulrunner(就像我想的那样),我得到:

$xulrunner example.xul 
Error: App:Name not specified in application.ini

所以,我可以看到一切都指向“单源文件”应用程序不可能与xulrunner – 但我只是想确保(以防我错过了一些模糊的教程:)).如果不是 – 有人记得在以前的某个时间点是否可能?

PS:

$firefox --version
Mozilla Firefox 7.0.1
$xulrunner --version
Mozilla XULRunner 2.0 - 20110402003021
$uname -r
2.6.38-11-generic
$cat /etc/issue
Ubuntu 11.04 \n \l

解决方法

我不相信你可以创建单文件XULRunner应用程序. -chrome< ...>参数可能用于工作,我猜“远程XUL”错误来自URL是file://,而不是chrome://.

您可以使用类似Live XUL Editor in the Developer Assistant(以前的Extension Developer的扩展名)来快速测试XUL.

我现在听到的一般想法是,你应该尽可能地编写HTML5,因为它更积极地开发,更知名的技术,更改不兼容和更好的工具……

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...