Chrome extension is corrupted - google-chrome

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"

Related

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

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.

I'm having an issue with my google chrome extension, new to code so be basic please

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.

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.

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).

`Manifest file is invalid` when uploading my chrome extension to the Chrome Web Store

I have been developing a chrome extension locally. I just finished it and wanted to upload it to the Chrome Web Store. When I uploaded it and it told me:
An error occurred: Invalid manifest. If your manifest includes comments, please remove them as our gallery does not support them yet.
I checked the JSON to make sure it it was valid and as far as I can tell it is fully valid. I tried naming it differently and uploading it and it still didn't work. I also tried changing the encoding and that did not work. The Manifest is below
{
"name": "Name",
"version": "0.0.0.0.1",
"manifest_version": 2,
"description": "Description",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"icons": { "128": "icon.png"},
"permissions": [
"tabs",
"http://*/*",
"webNavigation",
"history",
"storage"
],
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["js/jquery.min.js", "js/tab.js"]
}],
"background": {
"page": "background.html"
}
}
Does any one have any clue what the problem is? It is really frustrating to get this after finally finishing the extension.
Used your manifest.json, got this error.
Could not load extension from '/Users/jjperezaguinaga/samples/ext'. Required value 'version' is missing or invalid. It must be between 1-4 dot-separated integers each between 0 and 65536.
I removed some 0's from your version and I was able to load it.
replace
"version": "0.0.0.0.1"
with
"version": "1.0"