简体   繁体   English

Chrome扩展程序图标未显示

[英]Chrome Extension icon doesn't show up

I'm trying to make my first Chrome Extension. 我正在尝试制作我的第一个Chrome扩展程序。 It's supposed to read and modify text on specific webpages. 它应该阅读和修改特定网页上的文本。 It works fine, except the icon never shows up. 它工作正常,除非该图标从未显示。

It just shows the default puzzle peice icon on both the chrome developers page and in the Chrome toolbar. 它只会在chrome开发人员页面和Chrome工具栏中显示默认的拼图图标。

I'm using the following in my manifest.json file. 我在manifest.json文件中使用以下内容。

"page_action": { "default_icon": "favicon2.jpg", "default_title": "Portal.io Deposit Calculator" }

favicon2.jpg exists in the same directory as manifest.json. favicon2.jpg与manifest.json存在于同一目录中。 I've tried resizing the image, using .ico and .jpg. 我尝试使用.ico和.jpg调整图像大小。 The image isn't perfectly square (32x33) but I thought it would resize itself anyway, right? 图像不是完美的正方形(32x33),但我认为它会自行调整大小,对吗?

Try adding this in your manifest file: 尝试将其添加到清单文件中:

"icons": {
    "16": "image16.png", //for 16x16 pixels
    "48": "image48.png", //for 48x48 pixels
    "128": "image128.png" // for 128x128 pixels
},

Make sure all the icons are in .png format. 确保所有图标均为.png格式。

Try adding "icons" key at the top level: 尝试在顶层添加“图标”键:

"icons": {
    "16": "image16.png", //for 16x16 pixels
    "48": "image48.png", //for 48x48 pixels
    "128": "image128.png" // for 128x128 pixels
},
"browser_action": {
    "default_icon": "image16.png",
    "default_popup": "popup.html"
},

Icons documentation here: https://developer.chrome.com/extensions/manifest/icons 此处的图标文档: https : //developer.chrome.com/extensions/manifest/icons

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM