2012-02-22 77 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