gpt4 book ai didi

google-chrome - 无法安装我的自定义 Chrome 扩展程序 crx_magic_number_invalid

转载 作者:行者123 更新时间:2023-12-04 23:22:05 25 4
gpt4 key购买 nike

我做了一个简单的 chrome 扩展:

list .json:

{
"name": "Layout VS Design",
"version": "1",
"description": "Enter the url of a image with your design at 100%",
"background_page": "index.html",
"browser_action": {
"name": "Manipulate DOM",
"icons": ["icon.png"],
"default_icon": "icon.png"
},
"content_scripts": [ {
"js": [ "jquery.min.js", "js.js" ],
"matches": [ "http://*/*", "https://*/*"]
}]
}

问题是 chrome 不会让我安装它:
enter image description here

问题是我不知道在哪里设置这个数字,知道我可以尝试什么吗?

最佳答案

我首先看到的是你的 background_page格式不正确。它应该是

{ ...

"background": {
"page": "index.html"
},
...
}

如果您 manifest.json文件格式不正确,Chrome 将拒绝该扩展程序。

您可以在 Manifest File Format 中阅读有关 list 格式的更多信息。来自谷歌的文档。

更新

Another SO post详细介绍了 Chrome 如何在 .crx 文件顶部查找“魔数(Magic Number)”。但是,如果您在本地托管,则可以以更简单的方式安装扩展。
  • 保存您的 manifest.jsonbackground.html到一个目录(名称无关紧要)
  • 转至 chrome:extensions
  • 确保在顶部选中“开发人员模式”
  • 单击“加载解压缩的扩展程序...”
  • 选择您的 background 所在的目录和 manifest要在 Chrome 上安装的文件。
  • 关于google-chrome - 无法安装我的自定义 Chrome 扩展程序 crx_magic_number_invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21475701/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com