Chrome Extension 'Package is Invalid' error on Linux installs - google-chrome-extension

I recently published my extension publicly on the Chrome Web Store and new users have started installing it. Unfortunately about half of new installs error out with this error:
Package is Invalid. Details: 'Could not load icon
'images/BrainTool128.png' specified in 'icons'.'.
The relevant manifest section looks like this:
"icons": {
"16": "images/BrainTool16.png",
"32": "images/BrainTool32.png",
"48": "images/BrainTool48.png",
"128": "images/BrainTool128.png"
},
The 128x128 image is there under /images, its working for many users and I can't reproduce. I've previously had developer dashboard throw me errors when an image was incorrect in some way (wrong size etc) and so assumed it was validating the package. Also I'm only packaging the extension contents not any containing folders (as was the issue w previous questions).
This is very frustrating given that I'm just starting to get some actual real users for my app. Any help appreciated.
PS The extension is here: https://chrome.google.com/webstore/detail/braintool/fialfmcgpibjgdoeodaondepigiiddio
Update: It appears that this is only an issue for Chromebook and Linux users.

This was my error :-(
The actual file was there but was named Braintool128.png (lower case t), so the error message was correct. Its confusing that this was not caught on package verification and in fact the extension worked fine for everyone but Linux/Chromium users.

Related

`web_accessible_resources` images in content scripts not working in chrome 89.0.4389.82

I'm working on a chrome extension and it involves a small overlay on sites with an icon of the product/brand. Last week, I rendered this fine. My content script is a simple React.js app that mounts into a newly created div on any arbitrary page and creates a <img> element:
<img className="image" src={chrome.runtime.getURL(logo)} />
This worked great and it required an entry in the manifest:
"web_accessible_resources": [
{
"resources": [
"/*.png",
],
"matches": []
}
],
However, I came back to the project this week and the icon no longer displays. No changes to code or manifest over the weekend. All I can think of is a chrome update introduced a bug.
The console displays this:
Denying load of chrome-extension://gnncmcgealbfkmmiahajhhlhpgfldijh/ccffc3aeb870eaff711b.png. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
I wondered if * support was removed so I added the filename explicitly:
"resources": [
"ccffc3aeb870eaff711b.png",
"/ccffc3aeb870eaff711b.png"
],
Both with and without a / because there are no docs for this manifest yet for some reason.
This didn't work either.
The only documentation for this is here: https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#web-accessible-resources but it claims most of the fields are unused.
This definitely worked last week though, I even have a screenshot (though I cannot share publicly due to NDA reasons) so you'll all just have to trust me on that one!
Does anyone know of any additional manifest configuration required to get this working again? Chrome documentation seems to be lagging behind. Is this a bug or just a lack of documentation or feedback from the extension engine or browser?
Thanks!

How do you change the Store Icon for a Chrome Extension?

How do you change the Store Icon for a Chrome Extension in the Chrome Web Store?
The field I'm looking to change is found under 'Chrome Web Store Developer Dashboard' -> 'Store Listing' -> 'Graphic Assets'. When I first created the extension, I could upload an image there. In fact, I had to in order to submit the extension. But after that initial upload I have not found any way to change it, either in the manifest or through the dashboard.
Is it really set forever? Is there no way to change it?
BTW, the icons section of manifest.json lists the following icons, but with a different graphical asset than the initial upload. And the default action icon is correct. It is just the web store listing I can't seem to change.
"icons": {
"128": "icon-128.png",
"64": "icon-64.png",
"48": "icon-48.png",
"32": "icon-32.png",
"16": "icon-16.png"
},
I just stumbled upon this, as well.
Hover on the icon in the dev dashboard, there will be a trashcan that appears on the top right that you can click to delete the image.
This is in reply to #Niharika who asked for a screenshot.

Chrome extension not recognizing identity

I am trying to get use chrome.identity.getProfileUserInfo https://developer.chrome.com/apps/identity#method-getProfileUserInfo
I found my key using Chrome Extension Source Viewer and added it to my manifest.json file and under permissions added identity
"permissions": ["activeTab", "storage", "identity", "identity.email"],
But I am getting a Cannot read property 'getProfileUserInfo' of undefined when I try to run the method.
I printed out chrome and go this
It seems that chrome picked up "storage"but not "identity"
Any ideas why?
The identity permission adds chrome.identity to your background script, but not your content script. You don't say where you printed chrome from, but if it was from your content script, I would expect to see storage, but not identity.
Once you get that working, the identity.email permission may populate the user's email address, but I found that it only works if the user is logged in and has Chrome Sync switched on.

Where's the official manifest.json documentation for Chrome Hosted Apps? (bookmark/shortcut apps)

The simplest Google Chrome apps seem to be those that just act as a bookmark or shortcut to a Web site. They have a manifest.json that is something like this:
{
"manifest_version": 2,
"version": "0.1",
"short_name": "stackoverflow",
"name": "stackoverflow shortcut",
"description": "stackoverflow bookmark chrome app",
"icons": { "128": "img/128.png" },
"minimum_chrome_version":"37.0.0.0",
"app": {
"urls": [ "http://stackoverflow.com/" ],
"launch": { "web_url": "http://stackoverflow.com/" }
},
}
The basics of this are documented in the Getting Started Tutorial Sample and in the Create a private Chrome app page this type of app appears to be referred to there as a bookmark app.
My questions are:
Is bookmark app is an official term for this kind of Chrome app? As I am having difficulty finding any other official place it is referred to in such a way
Where is manifest.json fully documented? The extension manifest.json documentation does not even contain info for the app name tag, and the main manifest.json doc doesn't mention the urls, launch, and web_url elements?
The tags are fairly self explanatory and used in many tutorials all over the Web but it seems odd there is no official documentation for them, especially when app is used for more complex Chrome apps - I just want to make sure I am not somehow missing some official and more complete documentation as I am referring to this type of app wrongly.
Maybe it is simply that the code is the documentation and I simply need to find where the manifest.json is parsed in the Chromium code. I thought it was worth asking here first though, and even if I end up being told to check the code then someone might give me a pointer there to get me started.
The "bookmark" apps you describe are officially called hosted apps. Here you have a description of both:
Apps
Contains installable web apps. An installable web app can be a normal website with a bit of extra metadata; this type of app is called a hosted app. Alternatively, an installable web app can bundle all its content into an archive that users download when they install the app; this is a packaged app. Both hosted and packaged apps have icons in Chrome's New Tab page, and most users shouldn't be able to tell the difference between them without looking at the address bar.
The documentation for app manifest only describes the options for packaged apps. As #wOxxOm notes in the comments, the only place currently describing a manifest for a hosted app seems to be the Getting Started tutorial.

Chrome extension doesn't work in Linux (works in windows)

Okay, this is weird.
This is my extension, and it works flawlessly in Windows (atleast on two win7 machines), but when I tested it on linux (CentOS6 and Fedora18) it failed to do anything when its icon was clicked (it should, at the very least, display an alert).
The options page still works, and saves data properly.
After enabling developer mode in chrome://extensions/ you can click _generated_background_page.html for the extension to see the JS console for the addon.
That's where I saw the following error:
Error during tabs.executeScript: Cannot access contents of url "https://www.google.com.au/". Extension manifest must request permission to access this host.
actual url in error is not relevant, does it to all sites
Thing is, the windows machines showed no such error, shouldn't this be platform independent?
The manifests are obviously the same, so how come the addon hasn't the required permissions only on linux machines?
Mac is untested, if someone could try that for me, it might be useful
FURTHER INFORMATION
The error message above was given with the following information;
Located in the function chromeHidden.handleResponse on line 22 of the script sendRequest
The "activeTab" permission was added in Chrome 26. Make sure that you've installed Chrome/Chromium 26+.
If you want to make your extension compatible with older browsers in the Chrome Web Store, add host permissions to the manifest file, plus the minimum_chrome_version key:
First upload an extension with the following manifest file:
{
"name": "Name of extension",
"version": "1.0",
"manifest_version": 2,
"permissions": [
"<all_urls>"
]
}
Then bump the version, change "<all_urls>" to "activeTab", add the "minimum_chrome_version" field and upload it again to the Chrome Web Store:
{
"name": "Name of extension",
"version": "1.0.1",
"manifest_version": 2,
"permissions": [
"activeTab"
],
"minimum_chrome_version": "26.0.0.0"
}

Resources