First of all, I apologize if the question has been already answered. But all solutions I checked are being taken care of on my part.
This is my manifest.json
{
"name": "extension name",
"short_name": "extension",
"description": "desc",
"browser_action": {
"default_icon": {
"19": "images/icon19.png",
"38": "images/icon38.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"default_title": "title",
"default_popup": "popup.html"
},
"manifest_version": 2,
"update_url": "http://clients2.google.com/service/update2/crx",
"content_security_policy": "script-src 'self' https://www.google.com; object-src 'self'",
"version": "0.3.4"
}
The icons are all created using Photoshop CC and each size corresponds.
Any ideas what am I doing wrong?
TIA
The default_icon field specifies the icon for the browser action button only, not the icon for the entire extension.
To specify an icon for the extension as a whole, use the top-level icons manifest field:
{
"name": "extension name",
"short_name": "extension",
"description": "desc",
"icons": {
"48": "images/icon48.png"
},
...
Related
Setting up a Preact Chrome extension and getting a warning of Manifest: property 'icons' ignored, type array expected. Although manifest.json seems to be set correctly. Chrome extention warning.
manifest.json
{
"manifest_version": 3,
"name": "name",
"version": "1",
"action": {
"default_icon": {
"16": "assets/icons/icon16.png",
"48": "assets/icons/icon48.png",
"128": "assets/icons/icon128.png"
}
},
"description": "descr",
"icons": {
"16": "assets/icons/icon16.png",
"48": "assets/icons/icon48.png",
"128": "assets/icons/icon128.png"
},
"chrome_url_overrides": {
"newtab": "index.html"
},
"permissions": [
"activeTab",
"storage"
]
}
Full access and request access image
This picture shows that every time I open a new tab the extension requests access, I want to give it access to all tabs opened, like the top extension has.
Is this because I installed this extension from unpacked directory?
IF so, how can I bypass this? this is a custom extension that will not be going on the google extentionstore.
Add: "host_permissions": ["http:///","https:///"]
To your manifest.json file, under the section of permissions. Here's a full example:
{
"name": "Getting Started Example",
"options_page": "options.html",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": ["storage", "activeTab", "scripting","tabs","storage","fontSettings","contentSettings","debugger"],
"host_permissions": ["http://*/*","https://*/*"],
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "/images/get_started16.png",
"32": "/images/get_started32.png",
"48": "/images/get_started48.png",
"128": "/images/get_started128.png"
}
},
"icons": {
"16": "/images/get_started16.png",
"32": "/images/get_started32.png",
"48": "/images/get_started48.png",
"128": "/images/get_started128.png"
}
}
[!["manifest_version": 2,
"icons": {
"16": "/images/icon16.png",
"48": "/images/icon48.png",
"128": "/images/icon128.png"
},
"browser_action": {
"default_icon": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"default_popup": "/screens/popup.html"
},
"permissions": \["tabs", "storage", "webNavigation"\],
"content_scripts": \[
{
"js": \["popup.js", "websites.js"\],
"matches": \[
"<all_urls>"
\]
}
\],
"background": {
"scripts": \["background.js"\],
"persistent": false
},
"content_security_policy": "script-src 'self' https://ajax.googleapis.com https://stackpath.bootstrapcdn.com; object-src 'self';"
}
I don't know why my chrome extension icon isn't showing. I saved all the icons into the images folder hence the /images. it is giving me the blue puzzle piece in the middle Is there something wrong with my code?
This example is working on my browser. I don't know why your manifest json starts with [![. Maybe this is the problem. I'm not sure. Can you edit this example according to your json file?
{
"manifest_version": 2,
"name": "Test",
"description": "Test",
"version": "1.0",
"browser_action": {
"default_icon": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
]
}
Try copy-pasting this into your manifest.json file. You have loads of artefacts that might cause issues, I also removed the default_icons key which isn't necessary in my opinion. Also removed the backslash / before the image folder-paths.
{
"name": "Some extension",
"manifest_version": 2,
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"browser_action": {
"default_popup": "/screens/popup.html"
},
"permissions": ["tabs", "storage", "webNavigation"],
"content_scripts": [{
"js": ["popup.js", "websites.js"],
"matches": [
"<all_urls>"
]
}],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_security_policy": "script-src 'self' https://ajax.googleapis.com https://stackpath.bootstrapcdn.com; object-src 'self';"
}
I had the same issues. I opened the png file(s) with paint and resaved them and it worked. So please verify your png files.
I have created a new chrome extension and installed it in developers mode.It is working fine in my laptop. But in some other laptops, the options button is disabled. Please help.
I am unable to share the full code but this is how the manifest.json file looks like:
{
"name": "Asana Actual vs Estimation",
"version": "0.0.1",
"manifest_version": 2,
"description": "Add tags to task if the actual hours exceeds the estimated value",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"default_locale": "en",
"content_scripts": [{
"matches": ["<all_urls>"],
"all_frames": true,
"js": ["js/jquery/jquery.js","js/content.js"],
"css": ["css/styles.css"]
}],
"options_page":"options.html",
"permissions": [
"activeTab",
"<all_urls>",
"storage"
],
"content_security_policy": "script-src 'self' https://www.gstatic.com/; object-src 'self'",
"browser_action": {
"default_icon": "icons/icon16.png"
}
}
Thank you!
Its working. This line was not there
"options_page":"options.html"
in manifest.json. Adding that line solved the problem.
How to change Chrome Extension icon in this page?
Here's my manifest code :
{
"manifest_version": 2,
"name": "Demo",
"description": "This is demo.",
"version": "1.0",
"browser_action": {
"default_icon": "icon128.png",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"default_popup": "popup.html"
},
"permissions": [
"activeTab",
"storage"
]
}
The icon on toolbar is changed, but not on the chrome://extension page.
Set "icons" key in manifest.json.
The browser_action.icons key is what gets displayed in the toolbar (and will probably only use 16, 24, and 32 sized images, see browserAction).
The one displayed in chrome://extensions is a top level icons key. In the manifest documentation, look for the 6th entry, so that your manifest has an top-level entry, like:
{
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
}
}
It should be:
{
"manifest_version": 2,
"name": "Demo",
"description": "This is demo.",
"version": "1.0",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"browser_action": {
"default_popup": "popup.html"
},
"permissions": ["activeTab", "storage"]
}
See: Chrome Extension Manifest Docs