sda*_*aau 5 linux firefox xul xulrunner
我以前曾尝试过乱搞xulrunner,现在我再次尝试:)
事实上, “真正的”教程(XULRunner 入门 - MDN)确实表明应该拥有application.ini和其他文件(可能压缩为 .xpi,然后需要--install-app ...),然后调用应该类似于:
xulrunner `pwd`/application.ini
Run Code Online (Sandbox Code Playgroud)
...但是,我想要一种更简单的启动方法 - 因此,我希望使用单文件 XUL 应用程序方法:)(这里需要注意的是,也不能使用压缩的 .xpi 作为参数xulrunner,请参阅XULRunner 问题 - DonationCoder.com)
问题是,我几乎 100% 确定在过去的某个时刻,我使用过一个简单的单文件 XUL 应用程序,如(伪代码)所示:
xulrunner my-xul-app.extension
Run Code Online (Sandbox Code Playgroud)
...但我不记得它是怎么进行的:) 那么,这可能是用xulrunner,还是只能用firefox?
据我记得,我使用了类似“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>
Run Code Online (Sandbox Code Playgroud)
我正在尝试按照链接中的建议“运行”它:
firefox -no-remote -chrome file:$PWD/example.xul
Run Code Online (Sandbox Code Playgroud)
...然后,Firefox 打开,窗口大小约为 1x1 像素;如果你能找到手柄,你可以拉伸窗口,并阅读:
远程 XUL
此页面使用不受支持的技术,默认情况下,Firefox 中不再提供该技术。
哎呀:(对此的答案(例如How do I fix the Remote XUL error I get when using Firefox 4.x and the Webmail Advanced Interface? )似乎与实际的远程xul相关(并推荐一个插件来处理该问题);但是我想要的只是在本地运行一个文件?!“远程”部分来自哪里?
另外,看到 firefox 开关 ' -app'(使用 Firefox 3 作为 XUL 运行时环境);虽然它指的是 an application.ini,但我尝试了这个:
firefox -no-remote -app $PWD/example.xul
Run Code Online (Sandbox Code Playgroud)
...然后 Firefox 就如往常一样启动了。
顺便说一句,我既看不到-app也看不到-chrome命令行选项firefox --help;)
但实际上,我真的不想用作firefox引擎 - 只是xulrunner; xulrunner我尝试了 Firefox 方法,因为我认为它与;更不一样。事实证明并非如此(即使您使用application.ini:Why does 'firefox -App application.ini' and 'xulrunner application.ini' indicates differentely? | Firefox Support Forum):
无论如何,如果我只是xulrunner(如我所愿)跑步,我会得到:
$ xulrunner example.xul
Error: App:Name not specified in application.ini
Run Code Online (Sandbox Code Playgroud)
所以,我可以看到一切都指向“单一源文件”应用程序是不可能的xulrunner- 但我只是想确定一下(以防我错过了一些晦涩的教程:))。如果不是——有人记得在之前的某个时间点这是否可能吗?
附:
$ 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
Run Code Online (Sandbox Code Playgroud)
我不相信您可以创建单文件 XULRunner 应用程序。该-chrome <...>参数可能曾经有效,我猜“Remote XUL”错误来自于 URL 是 file://,而不是 chrome://。
您可以使用Developer Assistant(以前称为 Extension Developer 的扩展)中的 Live XUL Editor 之类的工具来快速测试 XUL。
我这些天听到的总体想法是,只要有可能,您就应该编写 HTML5,因为它是一种更积极开发、更知名的技术,具有更少的不兼容更改和更好的工具......
| 归档时间: |
|
| 查看次数: |
1809 次 |
| 最近记录: |