Google Chrome extension's manifest error

457 views
Skip to first unread message

Vaidas BoQsc

unread,
Mar 21, 2018, 2:32:47 PM3/21/18
to Chromium-dev
I was currently using mozilla' web docs and was walking through manifest's attributes one by one.

after I was ready to load a extension manifest on the chrome browser, I was given misleading error: 
"Only one of 'browser_action', 'page_action', and 'app' can be specified."



There is seems to be no such problem as mentioned in the error. There are no duplications of neither one.


Just to confirm the problem, automatic manifest validator: https://manifest-validator.appspot.com/
proves that my manifest has no such duplications and should be working properly.

This is the manifest.json

{
  "applications": {
    "gecko": {
      "id": "ad...@example.com",
      "strict_min_version": "42.0"
    }
  },

  "background": {
    "scripts": ["jquery.js", "my-background.js"],
    "page": "my-background.html"
  },

  "browser_action": {
    "default_icon": "userInterface/browser_action_button/airplay_icon.svg",
    "default_title": "LightDictionary",
    "default_popup": "userInterface/browser_action_button/popup.html"
  },

  "commands": {
    "_execute_browser_action": {
      "suggested_key": {
        "default": "Ctrl+Shift+Y"
      }
    }
  },

  "content_security_policy": "script-src 'self' https://example.com; object-src 'self'",

  "content_scripts": [
    {
      "exclude_matches": ["*://developer.mozilla.org/*"],
      "matches": ["*://*.mozilla.org/*"],
      "js": ["borderify.js"]
    }
  ],

  "default_locale": "en",

  "description": "none",

  "icons": {
    "48": "userInterface/browser_action_button/airplay_icon.svg",
    "96": "userInterface/browser_action_button/airplay_icon.svg"
  },

  "manifest_version": 2,

  "name": "LightDictionary",

  "page_action": {
    "default_icon": {
      "19": "userInterface/browser_action_button/airplay_icon.svg",
      "38": "userInterface/browser_action_button/airplay_icon.svg"
    },
    "default_title": "LightDictionary",
    "default_popup": "userInterface/browser_action_button/popup.html"
  },

  "permissions": ["webNavigation"],

  "version": "0.1",

  "web_accessible_resources": ["images/my-image.png"]
}





Mike Frysinger

unread,
Mar 21, 2018, 2:44:21 PM3/21/18
to vaidas...@gmail.com, chromium-dev
extension questions like this would be better handled in the extensions group:
  https://groups.google.com/a/chromium.org/group/chromium-extensions
or even just stackoverflow.

that said, the error from Chrome looks correct.  you're trying to set both "browser_action" and "page_action" in a single manifest which is incorrect.
-mike


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4ba55617-602c-48a5-86ea-f51d0d91774d%40chromium.org.

Vaidas BoQsc

unread,
Mar 21, 2018, 3:30:36 PM3/21/18
to Chromium-dev, vaidas...@gmail.com
Hello Mike, I used example from https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json
It is not a manifest from scratch. I used mozilla's example as a base for my manifest.

WebExtensions are cross-platform, and this manifest should work, if mozilla made it in their official documentation as a default example.

Mike Frysinger

unread,
Mar 21, 2018, 4:12:44 PM3/21/18
to vaidas...@gmail.com, chromium-dev
the Chromium project isn't responsible for document/projects MDN is maintaining.  you probably want to ask them instead.
-mike


Vaidas BoQsc

unread,
Mar 22, 2018, 4:51:05 AM3/22/18
to Chromium-dev, vaidas...@gmail.com
You are right, but neither MDN maintainers seems to look at what chromium project's support of functions. 
What we now get is: only half of supposed cross browsers functions that were "advertised" by 
https://hacks.mozilla.org/2017/06/cross-browser-extensions-available-now-in-firefox/
are working in other browsers, and are working differently from other browsers.

Cross-browser extensions are still non existant, as only some part of WebExtension technology works across the browsers.

Vaidas BoQsc

unread,
Mar 22, 2018, 5:02:26 AM3/22/18
to Chromium-dev
Also I found a comment about all this webextension cross browser differentiation from the chrome by other reader - Michel.
It seems that i'm not the only one who was deeply confused about what mdn maintainers done.
https://hacks.mozilla.org/2017/06/cross-browser-extensions-available-now-in-firefox/#comment-21268

PhistucK

unread,
Mar 22, 2018, 8:28:59 AM3/22/18
to vaidas...@gmail.com, Chromium-dev
I think the example shows the possible syntax, not that all of those combinations necessarily work (I agree it is confusing). Also, it is pretty much very Firefox oriented (given that it is in the Mozilla Developer Network, that is understandable).
Does this work in Firefox? If so, I guess Firefox chose not have that restriction. Chrome has had it for a long time (maybe even from the beginning, I do not remember), probably before Firefox implemented it.

MDN is editable by anyone with a GitHub account, so feel free to add a note to that page for clarifying the restriction.

Note that https://developer.chrome.com/extensions/manifest is the authoritative source for Chrome extension documentation. It mentions both of them, but notes in a comment that you have to pick one.


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAB%2Bqc9CUR_ac7XX4%2BJz6V6jHpBhxJTifx%3DaOE6W8sGjw65FXWA%40mail.gmail.com.

Vaidas BoQsc

unread,
Mar 22, 2018, 10:50:08 AM3/22/18
to Chromium-dev, vaidas...@gmail.com
I haven't tried it on Firefox yet, as I had no need for Firefox.
Here is even a quote that says more than any of my words:
  Extensions developed with WebExtension APIs are designed for cross-browser compatibility: to a large extent, the technology is directly code-compatible with the extension API supported by Google Chrome and Opera. Extensions written for these browsers will, in most cases, run in Firefox with just a few changes.

So, manifest hosted in MDN was supposed to be working manifest for both Chrome, Firefox and even Opera. 
All these Firefox specific and non universal manifest settings should be covered as additional features, not the main ones.
There is definetly something more to investigate.

Thanks PhistucK for the direcet link to the authoritative Chrome extension manifest .


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Vaidas BoQsc

unread,
Mar 22, 2018, 12:47:37 PM3/22/18
to Chromium-dev
Also this documentation page of https://developer.mozilla.org/en-US/Add-ons proves that examples in the new WebExtensions API documentation should mainly contain only cross-browser examples, especially in the most common documentation parts.

Mike Frysinger

unread,
Mar 22, 2018, 5:05:34 PM3/22/18
to Vaidas BoQsc, chromium-dev
again, you can't really hold the Chromium project responsible for things MDN/Firefox have written/claimed when the Chromium project isn't party to it.  at this point, Chromium is not participating in the WebExtensions API.  the only official documentation for Chromium extensions/apps live on https://developer.chrome.com/ and nowhere else.

so if you have complaints/problems about MDN/WebExtensions, please take it up with them.
-mike


Vaidas BoQsc

unread,
Mar 26, 2018, 7:12:01 PM3/26/18
to Chromium-dev, vaidas...@gmail.com
And i'm not holding it reponsible, i'm just using this thread as a details that I attached to the bugzilla. Since I started the thread about it here, I wanted to continue it, that's why i'm not really talking about chrome in the previous posts.
Anyways, thanks Mike for these responses, really appreciate. 

Mike Frysinger

unread,
Mar 27, 2018, 9:33:41 PM3/27/18
to Vaidas BoQsc, chromium-dev
thanks, that sounds good.  just want to make sure we set expectations appropriately :).
-mike

Reply all
Reply to author
Forward
0 new messages