2012-02-22 52 views
1

我从greasemonkey谷歌浏览器中安装了一个userscript。我想更改Chrome>选项>扩展下显示的图标。我会怎么做?我试图改变“manifest.json”文件,但无济于事。任何人有想法?谷歌铬扩展userscript图标

下面是代码:

{ 
"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" 
} 
+0

使用脚本甚至使用清单吗? ಠ_ఠ – Synetech 2013-07-12 02:17:30

回答

2

没有default_icon项,只有一个icons entry

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

正如文档中所述,建议您提供128x128,48x48和1 6x16图标。

+0

+1 - 但默认图标用于BrowserAction的图标http://code.google.com/chrome/extensions/browserAction.html – 2012-02-22 10:07:04

+0

我试过这个:“图标”:{“16 “:”KeyLock16.png“, ”48“:”KeyLock48.png“, ”128“:”KeyLock128.png“},并将图片放在同一个文件夹中。什么都没发生。也许你只能分配图标的扩展名而不是用户脚本? – user366121 2012-02-22 10:33:55

+0

@rvmook:但不在顶层。 – 2012-02-22 11:33:48