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/*"
]
}
Related
I'am working on an addon for firefox webbrowser. If I try to run the addon with web-ext run an error with the message Error parsing manifest.json file at C:...\manifest.json: JSONError: Unexpected token "�" (0xFFFD) in JSON at position 0 while parsing near "��{\u0000\r\u0000\n\u0000 \u0000 \u0000 \u0000 \u0000\"\u0000m\u0000... occured.
web-ext-lint also shows me that the first character in my json file is illegal. This first character is a curly brace. The linter displayed me a second error in line one of a javascript file, where also a curly brace is notated. My manifest file looks like this:
{
"manifest_version": 2,
"name": "Extension name",
"version": "1.0",
"description": "description line",
"permissions": [
"activeTab"
],
"icons": {
"48": "icons/key-solid-48.png",
"96": "icons/key-solid-96.png"
},
"background": {
"scripts": ["js/filename.js"]
},
"browser_action": {
"default_icon": "icons/key-solid-32.png",
"default_title": "AntToken",
"default_popup": "html/index.html"
}
}
Why this error happens? I'am not sure if this is a compatibility problem. I'am using WebExtension version 6.8.0.
I am trying to access the getUserSettings method on the chrome API and always get an error that "property getUserSettings is not defined on typeof action" when trying to call it. Is this method deprecated?
I have listed my manifest.json below, all I am doing is trying to print out the user settings in the background.js file:
chrome.action.getUserSettings((userSettings) => console.log(userSettings));
"name": "test",
"description": "test",
"background": {
"service_worker": "background.js"
},
"manifest_version": 3,
"version": "0.0.1",
"permissions": ["tabs"],
"action": {
"default_icon": {
"16": "icon.png",
},
"default_popup": "popup.html"
}
}
In the documentation the return type of this function is listed as pending, but I have seen many other examples of people using this function in V3 of the manifest without issue, even looking through some of the deprecated features in the chrome blog did not seem to mention this function.
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.
I have an extension that gets JSON data from a site for a list of characters and their resources when chosen from a menu. I'm using a single html page and trying to update it with javscript to modify the code for the menu. The only thing is that I can't get the content script injected/loaded into the html page.
When my extension is run, the path for the rem.htm file is shown as 'moz-extension://a02e52b1-e41d-4d28-844b-a8466a1dd67b/rem.htm' which gives an invalid error for the 'matches' key in the console.
What else can I use?
manifest.json:
{
"description": "Resource Manager for Path of Exile",
"manifest_version": 2,
"name": "Path of Exile Resource Manager",
"version": "1.0",
"content_scripts":
[
{
"matches": ["file:///rem.htm"],
"js": ["modify-page.js"]
}
],
"background":
{
"scripts": ["background.js"]
},
"browser_action":
{
"default_icon":
{
"16": "icons/rem_16.png",
"32": "icons/rem_32.png",
"64": "icons/rem_64.png"
}
},
"permissions":
[
"*://www.pathofexile.com/",
"webRequest",
"tabs",
"activeTab"
]
}
I figured it out. I didn't realize I had modify-page in a separate directory. I was then able to add '' to matches and it finally worked!
I am trying to update my extension but I get following error message. Message clear but there is no line 30. What is the problem?
manifest.json
{
"name": "IdeaShop Information",
"description": "IdeaShop siteleri ile ilgili bilgileri gosterir",
"manifest_version": 2,
"version": "1.0",
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"browser_action": {
"default_title": "IdeaShop Information",
"default_icon": "icon.png",
"popup": "popup.html"
}
]
}
Directory Structure
There seems to be an extra ] at the end.
You can validate your json file at jsonlint.com
An extra square bracket at the last but one line caused the error. The line number displayed in such message is not correct.