谷歌浏览器扩展用户脚本图标

发布于 2025-01-08 12:41:02 字数 1124 浏览 0 评论 0原文

我在 google chrome 中安装了来自 Greasemonkey 的用户脚本。我想更改 Chrome>选项>扩展下显示的图标。我该怎么做呢?我尝试更改“manifest.json”文件但无济于事。有人有主意吗?

这是代码:

{
"content_scripts": [ {
  "exclude_globs": [  ],
  "include_globs": [ "http://someurl/" ],
  "js": [ "script.js" ],
  "matches": [ "http://*/*", "https://*/*" ],
  "run_at": "document_idle"
} ],
"converted_from_user_script": true,
"description": "",
"default-icon": "LogIn.png", <-- added this line here and placed png in same folder
"key": ".......=",
"name": "lmi",
"version": "1.0"
}

这是我更新的代码,但仍然无法正常工作:-(

{
"browser_action": {
  "default_icon": "images/KeyLock48.png"
},
"content_scripts": [ {
  "exclude_globs": [  ],
  "include_globs": [ "http://someurl/" ],
  "js": [ "script.js" ],
  "matches": [ "http://*/*", "https://*/*" ],
  "run_at": "document_idle"
} ],
"converted_from_user_script": true,
"description": "",
"icons": {
  "128": "images/KeyLock128.png",
  "16": "images/KeyLock16.png",
  "32": "images/KeyLock32.png",
  "48": "images/KeyLock48.png"
},
"key": "....",
"name": "logmi",
"version": "1.0"   
}   

I installed a userscript in google chrome from greasemonkey. I would like to change the icon which is shown under Chrome>Options>Extensions. How would I do that? I tried to change the "manifest.json" file but to no avail. Anybody has an idea?

Here is the code:

{
"content_scripts": [ {
  "exclude_globs": [  ],
  "include_globs": [ "http://someurl/" ],
  "js": [ "script.js" ],
  "matches": [ "http://*/*", "https://*/*" ],
  "run_at": "document_idle"
} ],
"converted_from_user_script": true,
"description": "",
"default-icon": "LogIn.png", <-- added this line here and placed png in same folder
"key": ".......=",
"name": "lmi",
"version": "1.0"
}

Here is my updated code but still not working :-(

{
"browser_action": {
  "default_icon": "images/KeyLock48.png"
},
"content_scripts": [ {
  "exclude_globs": [  ],
  "include_globs": [ "http://someurl/" ],
  "js": [ "script.js" ],
  "matches": [ "http://*/*", "https://*/*" ],
  "run_at": "document_idle"
} ],
"converted_from_user_script": true,
"description": "",
"icons": {
  "128": "images/KeyLock128.png",
  "16": "images/KeyLock16.png",
  "32": "images/KeyLock32.png",
  "48": "images/KeyLock48.png"
},
"key": "....",
"name": "logmi",
"version": "1.0"   
}   

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

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

发布评论

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

评论(1

羞稚 2025-01-15 12:41:02

没有 default_icon 条目,只有 图标entry

"icons": [
  "128": "LogIn.png"
],

正如文档中提到的,建议提供128x128、48x48和16x16的图标。

There is no default_icon entry, only an icons entry:

"icons": [
  "128": "LogIn.png"
],

As mentioned in the documentation, it is recommendable to provide 128x128, 48x48 and 16x16 icons.

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