自动化 Google Chrome 扩展程序打包

发布于 2024-10-02 18:06:46 字数 371 浏览 3 评论 0原文

我正在尝试在 Windows 上自动打包 Chrome 扩展程序,根据文档,它是这个命令:

[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box

但是,此命令会导致一个新的浏览器窗口,并且不会执行任何操作。我尝试了其他开关,例如 --version 或 --help,但 Chrome 似乎忽略了所有这些。其他人也有同样的问题吗?我做错了什么?我还尝试了各种引用,并且没有打开其他浏览器窗口,但我无法完成这项工作。

更新:我很高兴得知新版 Chrome 8 已修复此问题。

I'm trying to automate packaging of the Chrome extension on Windows and according to the documentation, it is this command:

[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box

However this command results in a new browser window and no action is performed. I tried other switches like --version or --help but it seems that Chrome is ignoring all of this. Do others have the same issue? What am I doing wrong? I also tried various quoting and with no other browser window open but I haven't been able to make this work.

Update: I'm happy to learn that the new Chrome 8 has fixed this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风情万种。 2024-10-09 18:06:46

答案出现在其中一条评论中。我在这里逐字重新发布答案:

您可以尝试其中一个脚本来打包
一个扩展在
https://developer.chrome.com/extensions/crx#scripts
– 通过 Na7coldwater

The answer is present in one of the comments. I am reposting the answer verbatim here:

You can try one of the scripts to pack
an extension at
https://developer.chrome.com/extensions/crx#scripts
– by Na7coldwater

樱花细雨 2024-10-09 18:06:46

您需要先关闭所有 Chrome 窗口,然后命令行 pack extension 命令才会起作用。

我前段时间向 chrome 团队提出了这个错误 (http://code .google.com/p/chromium/issues/detail?id=22901),但尚未完全修复。这可能有点令人沮丧,因为(正如 michaelhermannweber 指出的那样)“既然我们是 Chrome 的粉丝,显然 Chrome 已经开放了!”

我什至尝试使用 chrome 可执行文件的单独实例来构建扩展,但可惜在这方面也没有运气:(
目前,AFAICT 您必须通过 chrome://extensions 页面上的包扩展按钮手动执行此操作。

您可能会设法构建一个脚本来关闭所有打开的 chrome 窗口,构建扩展,然后重新打开 chrome。但我怀疑考虑到用户喜欢保持打开的选项卡数量,这是否值得。

You'll need to close all chrome windows before the command line pack extension command will work.

I raised this bug with the chrome team some time ago (http://code.google.com/p/chromium/issues/detail?id=22901) but it's not quite fixed yet. This can be somewhat frustrating because (as michaelhermannweber pointed out) "Since we're fans of Chrome, obviously Chrome is already open!"

I even tried to use a separate instance of the chrome executable to build the extension, but alas no luck on that front either :(
For now, AFAICT you have to do it manually via the pack extension button on the chrome://extensions page.

You might manage to build a script that closes all open chrome windows, builds the extension, and then re-opens chrome. But I doubt that it would be worth it given the number of tab users like to keep open.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文