是否可以将 Firefox 插件从 XPI 解码为 XUL?
是否可以将 Firefox 插件从 XPI 绑定格式解码为本机语言 XUL?
我只是想学习如何制作插件。所以,我想如果我可以解码 Firefox 插件,那么我就可以学习插件架构!
Is it possible to decode a firefox addon from the XPI binding format to the native language XUL?
I am just trying to learn how to make a addon. So, I think if I can decode a Firefox addon then I can learn addon architecture!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
XPI 只是一个 ZIP 文件,因此您可以提取其内容并读取文件...
XPI is simply put a ZIP file, so you can just extract its contents and read the files...
您想要查看的大部分代码都位于扩展程序的 chrome 目录中,通常位于 jar 文件中。您所需要的只是一个可以提取 zip 文件的文件提取器。解压 xpi(它只是一个带有 xpi 扩展名的 zip 文件)后,打开 chrome 子文件夹并查看其中的内容。如果它是 jar 文件,请提取其内容(.jar 文件也只是具有不同扩展名的 zip 文件)。从那里,可能有一个内容文件夹,其中应该包含大部分 xul、css、js 等。
Most of the code that you will want to look at is in the extension's chrome directory, usually in a jar file. All you need is a file extractor that can extract zip files. Once you extract the xpi (it's just a zip file with an xpi extension), open the chrome subfolder and see what's there. If it's a jar file, extract it's contents (.jar files are also just zip files with a different extension). From there, there's probably a content folder, which should have most of the xul, css, js, etc.
刚刚了解到还有 xpi-unpack 和相应的 < Ubuntu 中的 code>xpi-pack(通过 sudo apt-get install mozilla-devscripts);似乎考虑了
.xpi
和包含的.jar
文件的解压。干杯!
编辑:但是请注意,您可能会遇到
xpi-unpack
的权限问题;这是我的一个示例命令行日志:EDIT2:实际上,事实证明其他文件也可能缺乏权限:
...所以最好在尝试之前 chmod 所有内容:
sudo chmod -R 755 colt-dir/
进行更改并打包(如xpi-pack colt-dir colt-2.xpi
)Just learned there is also xpi-unpack and corresponding
xpi-pack
in Ubuntu (viasudo apt-get install mozilla-devscripts
); seems to take unpacking of both.xpi
and included.jar
files into account..Cheers!
Edit: note however, you may have permission problems with
xpi-unpack
; here's an example command line log I had:EDIT2: Actually, turns out other files may be lacking permissions too:
... so best to chmod everything:
sudo chmod -R 755 colt-dir/
before trying to make changes and pack (as inxpi-pack colt-dir colt-2.xpi
)