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.
Related
[!["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 am trying to get the local IP address of the device but when I add the permission system.network I am getting the warning
'system.network' is only allowed for packaged apps, but this is a extension.
What does it mean by packaged app and if it will work after publishing, how can I test the extension locally?
manifest.json
{
"manifest_version": 2,
"name": "Fetcher",
"version": "1.0.1",
"description": "Internet download manager",
"icons": {
"128": "icon_128.png",
"48": "icon_48.png",
"16": "icon_16.png"
},
"background": {
"scripts": [
"detectors/audio_detector.js",
"background.js"
]
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["app.js"]
}
],
"permissions": [
"<all_urls>",
"system.network"
]
}
I have a Chrome Extension project, the structure looks like this:
project/
dist/
index.html
manifest.json
When I go More Tools -> Extensions -> Load Unpacked Extensions
I choose the root of the project, and it works! But I can't figure out how it knows to load dist/index.html? The manifest.json file doesn't say anything about dist/index.html, so how does Chrome know how to load the extension?
I built this extension a few months ago, and now I can't figure out how it works lol.
the manifest.json file looks like this verbatim:
{
"manifest_version": 2,
"name": "Suman Generator",
"description": "This extension allows the user to generate test skeletons.",
"version": "1.223",
"browser_action": {
"default_icon": "icon.png"
},
"options_page": "options.html",
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"devtools_page": "aspects/dev-tools/dist/suman-dev-tools.html",
"optional_permissions": [
"<all_urls>"
],
"permissions": [
"management",
"activeTab",
"webNavigation",
"storage",
"*://*/",
"http://*/",
"https://*/",
"background",
"browser",
"tabs",
"identity",
"identity.email",
"https://www.googleapis.com/",
"pageAction",
"notifications",
"clipboard",
"clipboardWrite",
"clipboardRead",
"unlimitedStorage",
"webRequest",
"userinfo",
"webRequestBlocking",
{
"socket": [
"tcp-connect:*:*"
]
}
],
"web_accessible_resources": [
"modal-iframe.html"
],
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"omnibox": {
"keyword": "suman:chrome"
},
"oauth2": {
"client_id": "5461307462-7geu9374.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/chromewebstore.readonly"
]
},
"key": "MIIBC57LwMgUdRxfY4I40oAiKy57o3tWF/A1BrTNY0nQIDAQAB",
"short_name": "Suman Short Name",
"offline_enabled": true,
"background": {
"page": "background.html",
"persistent": true
},
"content_scripts": [],
"content_security_policy": "script-src 'self' https://plus.google.com 'unsafe-inline' 'http' 'https' 'unsafe-eval' '*'; object-src '*';"
}
I have developed an extension and trying to upload it. but it gives error:manifest.json:34:1: an object must end with '}'.
Any help will be appreciated.
here is the content of manifest.json:
{
"manifest_version" :2,
"name": "Text to Speech",
"version" :"1.0.0",
"description" :"Indian language text to speech extension. Developed under TDIL programme by TTS consortium",
"options_page": "options.html",
"browser_action": {
"default_icon": { // optional
"19": "images/text2voice.png" // optional
},
"default_title": "Indian language TTS", // optional; shown in tooltip
"default_popup": "popup.html" // optional
},
"icons": { "16": "images/t2v-48.png",
"48": "images/t2v-48.png",
"128": "images/t2v-128.png" },
"background": {
"page": "background.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"], //content script will be injected in all urls
"js": ["content_script.js"]
}
],
"permissions": [ //permitted to access following pages
"http://*/*",
"https://*/*",
"contextMenus",
"tabs"
]
}
Your comments such as //options is breaking your json. Please try to put the entire contents of manifest.json validator(http://jsonlint.com) and see the errors.
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"
},
...