A justification for remote code use is required. - Chrome Extenstion - google-chrome

My Extension is not getting published because of 2 error
A justification for remote code use is required.
The single purpose description is required.
Here's my manifest:
{
"name": "Spotlight",
"icons": {
"128": "icon_128.png",
"96": "icon.png"
},
"description": "Spotlight - Browse open tabs, search history, bookmarks, downloads, and do much more!",
"version": "1.19",
"manifest_version": 2,
"permissions": [],
"update_url": "https://clients2.google.com/service/update2/crx",
"homepage_url": "https://usespotlight.co",
"optional_permissions" : [
"<all_urls>",
"tabs",
"bookmarks",
"history",
"downloads",
"storage"
],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"browser_action": {
"default_icon": "icon.png"
},
"commands": {
"toggle-feature": {
"suggested_key": {
"default": "Ctrl+M",
"mac": "Command+M"
},
"description": "Toggle spotlight"
}
}
}

You have to go to the new developer dashboard and fill out these fields under the Privacy menu.

Go to https://chrome.google.com/webstore/devconsole/ then click on Privacy menu (3th tab on the left) then fill all your purpose description. After that you can release your extension normally

These new requirements are not actually part of the manifest. In the new developer console, click your item and go to the privacy tab. You can find the various requirements there.
ActiveTab - Used to open tabs
Host Permission - Used to load files onto certain websites
"matches": [
"https://www.google.com/"
],
"js": [
"googleHome.js"
]
Single purpose description is an old suggestion and a new requirement. Just now being enforced because extensions are supposed to be small and serve a single purpose.

Related

Chrome extension is corrupted

I have problem with my extension. It is working for me unpacked and when I download it from Chrome store.
However, some users reported that after update extension is corrupted. That's happen after they update it to newer version.
Difference between old and new version is background page and some logic.
I was able to replicate that issue, by packing extension and than drop it into extensions tab. After that I saw the same message as extension users. I also tried that with another extensions and everything worked fine, so maybe there is some issue in manifest file.
{
"manifest_version": 2,
"name": "Cryptocurrency Price Tracker",
"description": "This simple extension allows you to track price changes of Bitcoin and other cryptocurrencies.",
"version": "2.5",
"icons": {
"16":"icon16.png",
"48":"icon48.png",
"128":"icon128.png"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"storage",
"notifications",
"https://api.coinmarketcap.com/v1/*"
]
}
I use background page, not event page. So maybe I should add something in the manifest...
P.S. Packaging doesn't work for older version of extension... One more important thing. Users reported that after clicking on options page they saw that error. It didnt happend in my case, when I drag and drop extension file, I saw error immediately.
You need to put in a link to an update url in the manifest. The problem was mentioned in this forum:
https://productforums.google.com/forum/?hl=en#!topic/chrome/kGgLwnrDKpQ;context-place=forum/chrome
So you add update_url into your manifest. It can be any valid url if you are not making use of the feature. So like this:
"name": "Cryptocurrency Price Tracker",
"description": "This simple extension allows you to track price changes of Bitcoin and other cryptocurrencies.",
"version": "2.5",
"icons": {
"16":"icon16.png",
"48":"icon48.png",
"128":"icon128.png"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"storage",
"notifications",
"https://api.coinmarketcap.com/v1/*"
],
"update_url": "http://www.example.com/update.xml"

content script not being injected into extension html page

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!

Matching content script with last keyword match

I have a page in block.html in extension directory. I want match content script with the page name.
Check my manifest file below, there is content_script match:
{
"manifest_version": 2,
"name": "Cobra Security ATD",
"version": "1.0",
"description": "Cobra Security Advance Threat Defence.",
"icons": {
"48": "img/48-48.png",
"128": "img/128-128.png"
},
"browser_action": {
"default_icon": "img/16-16.png",
"default_title": "Cobra Security Advance Threat Defence",
"default_popup": "popup.html"
},
"background": {
"scripts": ["js/jquery-1.11.1.js","js/event.js"],
"persistent": false
},
"content_scripts": [
{
"matches": ["http://*/*block.html"],
"js": ["js/jquery-1.11.1.js","js/block.js"]
}
],
"permissions": [
"<all_urls>",
"tabs",
"webNavigation"
]
}
One does not inject content scripts into chrome-extension:// pages. You cannot indicate this schema in the manifest, and you can't indicate a host permission that would allow you to inject it.
Since it's an extension that you control, you don't need to inject scripts for anything!
If you want to put code in it, you.. put code in it, in a <script
src="..."> fashion.
If you want to inform the page of some event, you use Messaging.
If you want to pass some information when you open the page, you can
use this trick, sending a request back for data.

How do I get the checkbox "Allow access to file URLs" to show up next to my app? I have file write permissions in manifest

More Info/Update
I packaged and installed google's own sample app showing filesystem access and it also does not show the checkbox!
You can find it here: https://github.com/GoogleChrome/chrome-app-samples/tree/master/filesystem-access
Original Post
I have the permission asking for filesystem.write ability in my manifest but on the chrome://extensions page, the check box doesn't show up. And when I click "permissions" next to my app's icon, it only shows:
"Write to files that you have opened in the application"
What am I doing wrong? (This is a hosted app)
manifest.json
{
"manifest_version": 2,
"name": "Hello World",
"description": "A test application",
"version": "2.0.3.92",
"minimum_chrome_version": "23",
"offline_enabled": true,
"update_url": "http://mywebsite.com/updates/helloworld.xml",
"icons":
{
"16": "icon_16.png",
"128": "icon_128.png"
},
"app":
{
"background":
{
"scripts":
[
"utils.js",
"fs.js",
"main.js"
]
}
},
"permissions":
[
"unlimitedStorage",
"fullscreen",
{
"fileSystem":
[
"write"
]
},
"background",
"http://*/",
"tabs"
]
}
To get this to work you need either:
permissions: [ "<all_urls>" ]
or a scheme starting with file:///.
If you try *://*/* that will not work as it only represents http or https

Getting error: "This webpage is not available" for my chrome app's options page

My CRX had the proper html page options.html in it, the manifest declares it properly (it shows up as a link on the chrome://extensions page) but when I click that link, Chrome gives the error:
This webpage is not available
The webpage at chrome-extension://invalid/ might be temporarily down or it may have moved permanently to a new web address.
It says "invalid" but the app runs perfectly well (all the content scripts run, the background created a database and saved to it). Why would it show as invalid? Why doesn't it have the extensions' id?
Here's the manifest:
{
"manifest_version": 2,
"name": "MyAPP",
"description": "My App",
"version": "0.0.0.32",
"minimum_chrome_version": "27",
"offline_enabled": true,
"options_page": "options.html",
"icons":
{
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"app":
{
"background":
{
"scripts":
[
"scripts/background.js"
]
}
},
"permissions":
[
"unlimitedStorage",
"fullscreen",
{
"fileSystem":
[
"write"
]
},
"background",
"<all_urls>",
"tabs"
]
}
Does it need to be declared in "web_accessible_resources"? Any idea what's wrong?
Update
Adding to "web_accessible_resources" does not fix the issue. I added everything on that page too.
update 2
It looks like it might be a Chrome bug for packaged apps. When I remove the "app" section in the manifest, it works! This is a bug since the Chrome app documentation states that apps can have options pages: https://developer.chrome.com/apps/options.html
Options pages are only supported for extensions, you have indeed discovered a documentation bug (I've filed issue 255079).