I was getting errors while trying to upload a chrome extension because I had to update the manifest to version 3. I was using a JSON error checker but it was confusing. I'm pulling my hair out over this and would be cool if someone could help me thanks!
(By the way I've never really done much JSON before so don't blame me)
{
"manifest_version": 3,
"name": "FreeRice AutoFarm",
"description": "AutoFarm rice at freerice.com.",
"version": "1",
"author": "Dex",
"icons": {
"48": "favicon48.png",
"128": "favicon128.png",
"256": "favicon256.png"
},
"permissions": [
"tabs",
"activeTab",
],
"host_permissions" : [
"http://freerice.com/*",
"https://freerice.com/*",
"http://*.freerice.com/*",
"https://*.freerice.com/*"
]
"action": {
"default_popup": "popup.html",
"default_icon": "favicon48.png",
"default_title": "FreeRice AutoFarm"
}
}
Related
On load of some page I getting alert (SyntaxError: "[object Object]" is not valid JSON)
But in anonymous mode all clear, so it given by Chrome extensions.
Is there a fast way to check what it is, other then going by exclusion method?
First you have to check your extension in chrome://extension and see if it shows any error on pointed location
enter image description here
if any error button shown here! than click on it to resolve error!
and [object object] is not valid json!
you can write only one value in these brackets []:
//its a right json format
"objects":["objects"]
and all of this json writes in this two brackets! {}
Here is Example of My Extension Manifest file!
{
"name": "Notify!",
"description": "A Google Chrome extension!",
"version": "1.7",
"manifest_version": 3,
"icons": {
"128": "/assets/icons/128.png",
"48": "/assets/icons/128.png",
"16": "/assets/icons/128.png"
},
"action": {
"default_icon": "/assets/icons/128.png",
"default_popup": "popup.html",
"default_title": "It's my title"
},
"background":{
"script": ["eventPage.js"]
//"service_worker": false
},
"content_scripts":[
{
"matches": ["http://*.google.com/*"],
"js": ["content.js","jquery-3.6.1.min.js"]
}
],
"permissions": [
"tabs",
"http://*.google.com/*"
]
}
I have developed a extension primarily focused on chrome which works but now i need that extension to work in firefox either so I checked by loading the extension by going to about:debugging page and loading temporary addons. Currently, I go an error. I got error something like this
Reading manifest: Error processing options_page: An unexpected
property was found in the WebExtension manifest.
Reading manifest: Error processing oauth2: An unexpected property
was found in the WebExtension manifest.
Reading manifest: Error processing key: An unexpected property was
found in the WebExtension manifest.
Here is what my manifest file looks like(I removed options_page)
manifest.json
{
"version": "1.0",
"name": "Browser Extension",
"manifest_version": 2,
"description":
"This extension allow the user to select the text and redirect to the application",
"page_action": {
"default_title": "Select Text",
"default_popup": "index.html"
},
"icons": {
"16": "img/browser16.png",
"48": "img/browser48.png",
"128": "img/browser128.png"
},
"background": {
"scripts": ["extension/js/background.js"],
"persistent": true
},
"content_scripts": [
{
"matches": [
"https://mail.google.com/mail/*/*",
"http://mail.google.com/mail/*/*"
],
"js": ["extension/js/jquery.min.js", "extension/js/content.js"],
"css": ["extension/css/main.css"],
"run_at": "document_end"
}
],
"permissions": [
"contextMenus",
"tabs",
"storage",
"webNavigation",
"notifications",
"cookies",
"identity",
"*://mail.google.com/mail/*/*",
"https://www.googleapis.com/*",
"https://*.googleusercontent.com/*"
],
"web_accessible_resources": ["img/browser128.png", "img/ios-link.svg"],
"oauth2": {
"client_id":
"114446495690-8ejpdgvmn8vc9pblteupetas.apps.googleusercontent.com",
"scopes": ["profile", "https://www.googleapis.com/auth/gmail.readonly"]
},
"key":
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnqFjzbt+LtejD1JhOyMUbejOHdLoemzryr+ZQHK2CEKuI0yVVYToFs7eNusH/hfxhnyF27G4BU8apsTc695EpVQGD0ANKdt6BjubRnA/4VcdkmfdD3D9nsdCc+fHkINRU5e05grfs/BETWW/JAUULduaNWGfhT7"
}
How do i resolve above issues to make it firefox compatible as well?
I've been making this chrome extension for a while now. It's finally done and i went to upload it. Then it went "manifest.json:5:23: unexpected char. Can someone please help me figure out the mistake? i've tried almost everything but i cant seem to figure it out..
Heres the manifest.json file:
{
"name": "ROBLOX Catalog Helper v2",
"version": "1.9.0", // version
"manifest_version": 2,
"description": "Notifies you whenever an item is selling for under its RAP",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"alarms",
"background",
"debugger",
"notifications",
"cookies",
"https://www.roblox.com/"
],
"background": {
"scripts": ["bgWork.js", "jQuery-very3.js"]
},
"icons": { "16": "icon_png",
"48": "icon_png",
"128": "icon_png" }
}
I'm trying to make a google chrome extension, but I'm having a problem. Please answer as basic as possible as I'm really bad at code. Whenever I upload something as a zip file, it says
"An error occurred: Failed to process your item. manifest.json:5:26:
unexpected char."
This is my code :
{
"name": "ROBLOX Character Asset ID",
"version": "1.9.0", // version
"manifest_version": 2,
"description": "This extension is for GFX artists who need their customer's character asset ID",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"alarms",
"background",
"debugger",
"notifications",
"cookies",
"https://www.roblox.com/"
],
"background": {
"scripts": ["bgWork.js", "jQuery-ver3.js"]
},
"icons": { "16": "icon.png",
"48": "icon.png",
"128": "icon.png" }
}
This has to do with the content in your scripts and when you load the extension it not being able to be processed as I loaded your manifest.json just fine (though with blank js files). So don't look towards your manifest.json, you must have an illegal character in your js file.
My extension works well under the dev mode,but when i want to pack it this time ,there comes an error which said:"Manifest file missing or unreadable", i don't know why!
{
"name": "DoTask",
"version": "1.0",
"description": "DoTaskv2个人任务管理系统--谷歌浏览器插件",
"options_page": "option.html",
"icons": { "16": "favicon.ico", "32": "favicon.ico", "128": "favicon.ico"},
"browser_action": {
"default_icon": "favicon.ico",
"popup": "popup.html"
},
"permissions": [
"http://*/*"
]
}
The manifest file must be named manifest.json (notice: json not js), must be in the root of the zip file or directory and it also must be saved as UTF-8.