Background subsection required when publishing a translated Google Docs Add-on - google-drive-api

I developped a Google Docs add-on with translations, so, instead of using the traditional online deployment process, I need to upload a ZIP file with a json manifest (example below) and files for each locales.
{
"manifest_version": 2,
"name": "__MSG_application_title__",
"short_name": "__MSG_application_title__",
"description": "__MSG_application_description__",
"container": ["GOOGLE_DOCUMENT"],
"default_locale": "en",
"icons": {
"16": "icon.png",
"128": "icon.png"
},
"container_info": {
"container_version": "my_container_version",
"post_install_tip": "my_tip",
"container_id": "my_container_id"
},
"version": "my_version"
}
When uploading such ZIP file, I get the following error message:
An error occurred: Failed to process your item. Please specify
background subsection of app section in the manifest. Legacy packaged
apps cannot be uploaded to the Chrome Web Store any more. More
information can be found at
http://blog.chromium.org/2014/06/migrate-your-legacy-packaged-apps-to.html
I tried to add background subsection from different ways, but none of them was working. Does anyone know how to change the manifest to make it valid please ?
Thanks

Sincerest apologies, I was misunderstanding the issue entirely. Try and see if:
"app":{
"background":{
"scripts":["background.js"]
}
},
Works when added to your code.

similarly, I had to change the app section of my manifest to the following to get it to work when facing this issue:
"app": {
"background": {
"persistent": false
}
}

Related

What is causing error: "Could not load extension icon" and "Could not load manifest" when loading unpacked Chrome extension?

I'm following a tutorial for creating a basic Chrome extension with Create-React-App
(tutorial found here:
https://medium.com/#gilfink/building-a-chrome-extension-using-react-c5bfe45aaf36)
After running create-react-app my-app command, I substituted the auto-generated code in the public folder's manifest.json file with the tutorial code (below), then placed a 128x128 image in the public folder, named logo-small.png, which is referenced correctly in the manifest file.
I ran the npm run build command and then opened Chrome extensions page to load unpacked extension, selecting the build folder (build command placed the contents of the public folder into the build folder, so the manifest and png are all in the same location). However, I got the following error:
Could not load extension icon 'logo-small.png'.
Could not load manifest.
I'm unsure what's causing this, since I followed directions exactly. Does anyone know what the issue might be? Do you need other info from me to be able to tell?
Manifest.json code:
{
"manifest_version": 2,
"name": "testapp",
"description": "This extension is a starting point to create a real Chrome extension",
"version": "0.0.1",
"browser_action": {
"default_popup": "index.html",
"default_title": "Open the popup"
},
"icons": {
"16": "logo-small.png",
"48": "logo-small.png",
"128": "logo-small.png"
},
"permissions": [
]
}
Yes, the issue is that you are saying "logo-small.png" as a result chrome will not know that it is an icon. As a result, re-name the "logo-small" to "icon16.png". Change the "logo-small" on the second line to "icon48.png" and the last one to "icon128.png". This solution worked for me.
{
"manifest_version": 3,
"name": "Answers",
"version": "1.0",
"description": "Basic Practice! ",
"icons":{
"128": "icon128.png",
"48": "icon48.png",
"16": "icon16.png"
},
"browser_action":{
"default_icon": "icon16.png",
"default_popup": "popup.html"
}
}
This code worked for me. Also, make sure to re-size each icon so it is great! Let me know if it works.

Chrome Extension installation "Invalid manifest"

I have a Chrome extension that uploads to the Chrome store just fine. My current manifest file is posted below. It is saved in ANSI format as suggested in previous posts with this issue. This is the third variant and they all produce the same error message when I try to install: "Invalid manifest". No real information. I have tried waiting 24 hours for it to propagate properly as suggested in previous posts, but to no effect.
Has anyone encountered this issue before?
The extension is here: https://chrome.google.com/webstore/detail/bamboo-dialog-fixer/oelecpkhobhmbbdmehaoonkbkdodhdio?hl=en-US
{
"manifest_version": 2,
"name": "Bamboo dialog fixer",
"version": "1.3",
"description": "This extension makes bamboo popup dialogs such a the performance dialogs fit the width of the screen.",
"icons": {"128": "BambooHR_FullSize.png"},
"content_scripts":
{
"css": "styles.css",
"matches": "https://*.bamboohr.co.uk/*"
}
}
Thanks wOxxOm. I must have screwed up, even though I thought I had it right on a previous occasion. I rewrote the file as below and uploaded and it works now.
{
"manifest_version": 2,
"name": "Bamboo dialog fixer",
"version": "1.4",
"description": "This extension makes bamboo popup dialogs such a the performance dialogs fit the width of the screen.",
"icons": {"128": "BambooHR_FullSize.png"},
"content_scripts": [
{
"css": ["styles.css"],
"matches": ["https://*.bamboohr.co.uk/*"]
}
]
}

Chrome Extensions i18n: Redirecting to locale-specific content

Question: How can I redirect users to most-relevant content, sitting in 3 different sub-directories, depending on their preferred language?
What I have
I have created 3 different _locales sub-directories, each containing language-specific messages.json files:
_locales/en/messages.json
_locales/en_GB/messages.json
_locales/de/messages.json
In manifest.json in the root directory, this already works well and as expected to correctly adapt the extension's name and description in the respective language, using:
manifest.json
{
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.0",
"default_locale": "en",
"browser_action": {
"default_title": "__MSG_extensionName__",
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
Where I am stuck
As the user clicks on my extension's icon, I also want to load language-specific content from the most-relevant sub-directory -- instead of the "default_popup": "popup.html" line -- because some URLs that I link to from the popup.html files also differ by language:
_locales/en/popup.html
_locales/en_GB/popup.html
_locales/de/popup.html
So I thought the best way to do it is to exchange that one line from my root manifest.json that currently reads
"default_popup": "popup.html"
with a line that reads
"default_popup": "__MSG_initialContent__"
and then within each of the _locales sub-directories' messages.json files have
"initialContent": {
"message": "popup.html"
}
so that it reads the content locally from within that subdirectory.
BUT: That is where it all falls apart. Then I get a "This webpage is not found error".
I have tried, to no avail, these differing variations (examples below for _locales/de/messages.json) -- all leading to the same error message:
"initialContent": {
"message": "popup.html"
}
then
"initialContent": {
"message": "_locales/de/popup.html"
}
then
"initialContent": {
"message": "/de/popup.html"
}
and lastly
"initialContent": {
"message": "de/popup.html"
}
What am I doing wrong?
Thanks!
I know this question is very old but I just found it and I guess it would be nice for future visitors to get a solution.
What you need to achieve this are "Predefined messages"
Quote:
Predefined messages
The internationalization system provides a few predefined messages to help you localize. These include ##ui_locale, so you can detect the current UI locale, ...
[...]
The special message ##extension_id can be used in the CSS and JavaScript files, whether or not the extension or app is localized. This message doesn't work in manifest files.
The following table describes each predefined message.
##extension_id
The extension or app ID; you might use this string to construct URLs for resources inside the extension. Even unlocalized extensions can use this message.
Note: You can't use this message in a manifest file.
##ui_locale The current locale; you might use this string to construct locale-specific URLs.
[...]

could not load javascript for contentscript

i am developing extension for google chrome. i am trying to load css file.if the css file is in root directory of extension then it loaded fine. but if i put css in /css folder then try to load css then it gives error could not load javascript for contentscript
{
"name": "test",
"version": "1.0",
"manifest_version": 2,
"description": "This is test",
"background":{"scripts":["background.js"]},
"permissions":
[
"http://*/*",
"https://*/*",
"file://*"
],
"content_scripts":
[
{
"matches":["*://mail.google.com/*"],
"css":["mystyle.css", "default.css","style.css"],
"js":["jquery.js","myscript.js","DOMAlert.js","css/core.js"]
}
]
}
i am new at developing extension so please help what's wrong.
I seem to be having the same issue. I managed to achieve this when I added a script that is external to my plugin. Check all of your js scripts to have exact spelling and case. It only complains about javascript if there is a permissions issue or the file does not exist.

how does the manifest for chrome extensions work?

I made an extension for google chrome but I don't like what the market put as a warning :(
This extension may have access to:
Your data on every website
Your history data
the manifest:
{
"name": "extension name",
"description": "description cool super description.",
"version": "1.0",
"permissions": [ "tabs", "http://*/*", "https://*/*" ],
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
}
}
Is there any way to explain to google that I don't access any of this? is just an app to reveal asterisk :(
If you mean "browser history" part then it's a bug on the webstore website which someone should report. This contradicts their own docs where it says that tab permission should raise "Your tabs and browsing activity" warning. (As a reference this bug report could be used)
"Your data on all websites" is correct one. Their warnings show not what you do, but what you can potentially do.