Chrome Extension Manifest permissions blocked - google-chrome-extension

I got sucked with this issues while trying to upgrade my extension on Chrome Store. I tried all recommended solutions without success. Can someone help please?This is what I got from Chrome Store
This is my Manifest file:
{
"name": "__MSG_appName__",
"version": "{{version}}",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"icons": {
"16": "images/icon-16.png",
"19": "images/icon-19.png",
"32": "images/icon-32.png",
"38": "images/icon-38.png",
"48": "images/icon-48.png",
"64": "images/icon-64.png",
"128": "images/icon-128.png"
},
"default_locale": "en",
"background": {
"scripts": [ ]
},
"browser_action": {
"default_icon": {
"16": "images/icon-16.png",
"19": "images/icon-19.png",
"32": "images/icon-32.png",
"38": "images/icon-38.png",
"48": "images/icon-48.png",
"64": "images/icon-64.png",
"128": "images/icon-128.png"
},
"default_title": "..."
},
"content_scripts": [
{
"name": "main_scripts",
"matches": [
"http://*/*",
"https://*/*"
],
"css": []
"run_at": "document_start",
"all_frames": false
}
],
"permissions": [
"activeTab",
"contextMenus",
"history",
"storage",
"management",
"webRequest",
"webRequestBlocking"
]
}
I don't know if this could help. This is what I get in development environment:
Error from chrome://extension 1,
Error from chrome://extension 2

Related

chrome extension popup.html showing up as text

I followed google's extension tutorial to the letter but I'm getting this weird problem where my popup.html is showing up as text instead of as an HTML page.
This is how my Popup looks.
this is my manifest.json code (same as the tutorial):
{
"name": "Getting Started Example",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": ["storage"],
"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"
}
}
}
this is my popup.html code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="button.css">
</head>
<body>
<button id="changeColor"></button>
</body>
</html>

Is there a limitation of using web_accessible_resources locally in developer mode in a chrome extension?

Invalid value for 'web_accessible_resources[0]'.
Could not load manifest.
Following the docs from chrome: https://developer.chrome.com/docs/extensions/mv3/manifest/web_accessible_resources/
I ended up with a manifest like this:
{
"name": "MyExt",
"version": "0.0.2",
"description": "Add to MyExt",
"manifest_version": 3,
"web_accessible_resources": [
"images/*.png"
],
"permissions": [
"activeTab",
"cookies",
"declarativeContent",
"storage"
],
"host_permissions": [
"https://www.MyExt.com/"
],
"background": {
"service_worker": "background.js"
},
"action": {
"default_popup": "index.html",
"default_icon": {
"16": "images/logo.png",
"32": "images/logo.png",
"48": "images/logo.png",
"128": "images/logo.png"
}
},
"icons": {
"16": "images/logo.png",
"32": "images/logo.png",
"48": "images/logo.png",
"128": "images/logo.png"
}
}
But i cannot test this in developer mode as this below keeps throwing the error quoted at the top:
"web_accessible_resources": [
"images/*.png"
],
I have tried using an exact path and all wildcards, a path just to the manifest file. Also tried using a path which is relative to the root of the linux filesystem.. but no matter what i do i get the error.

how to setup chrome-extension cookie permission

I have a manifest
{
"name": "Question Share",
"version": "1.0",
"description": "Build an awesome world!",
"permissions": [
"cookies",
"*://*.google.com"
],
"options_page": "options.html",
"background": {
"scripts": [
"background.js"
],
"persistent": false
},
"page_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
}
with cookies permission. But, when I load unpacked extension in Chrome
Detail tab always show "This extension requires no special permissions"
I'm flowing document: https://developer.chrome.com/docs/extensions/reference/cookies/
how to call: chrome.cookies.getAllCookieStores
please help!

Why does my manifest.json file is having trouble compiling?

Is there anything that I am doing wrong?
{
"manifest_version": 2,
"name": "somerandomname",
"version": "2.0",
"homepage_url": "https://url.com",
"author": "somedude",
"description": "extension"
},
"icons": {
"48": "img/icon.svg",
"96": "img/icon.svg"
},
The error in jsonlint is,
Error: Parse error on line 8:
...tion": "extension"},"icons": { "48":
----------------------^
Expecting 'EOF', got ','
The "icons" field should be a part of the main object, not a separated entity:
{
"manifest_version": 2,
"name": "somerandomname",
"version": "2.0",
"homepage_url": "https://url.com",
"author": "somedude",
"description": "extension",
"icons": {
"48": "img/icon.svg",
"96": "img/icon.svg"
}
}

content script isn't running in chrom extension

I created a Chrom extension.
Among the things the extension suppose to do is to run a script in the context of the page after the page loaded.
For some reason, the script isn't running and I'm not sure what am I doing wrong.
Here's the manifest.json
{
"name": "extension sample",
"version": "1.2",
"description": "some desc",
"manifest_version": 2,
"author": "",
"permissions": ["declarativeContent", "storage", "tabs", "activeTab", "https://*/*", "http://*/*"],
"background": {
"scripts":
["background.js" ],
"persistent": false
},
"content_scripts": [
{ "run_at" :"document_end",
"matches": ["https://*/*""],
"js": ["snippet.js"],
"all_frames": true
} ],
"web_accessible_resources":["snippet.js"],
"content_security_policy": "script-src 'self' https://www.google.com; object-src 'self'",
"browser_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"
}
}
This is the code that runs the script:
chrome.tabs.query({currentWindow: true, active: true}, function (tab) {
chrome.tabs.executeScript(tab.id, {
file: 'snippet.js'
});
});
I just placed the script execution instead of the reload method just to focus on the script execution.
So my question is, why is the script not running?

Resources