Manifest Version 2 & Background Page

7,432 views
Skip to first unread message

Adi

unread,
Mar 4, 2012, 1:19:35 AM3/4/12
to Chromium-extensions
Hi

We just upgraded our extension to manifest version 2, and are testing
it on Chromium v17.

While rest of the features are working as advertised, the browser
button has broken. Further, the 'Inspect active views' option that
provided a link to developer tools for background page is not
available either. Thus, we can't even debug and figure if the browser
button functionality is broken or if it's an issue with the code.

We've tried using both just-the-script option and the empty html page
with link to script option under "background" in the manifest but the
behaviour remains same.

Is this the new normal behaviour for extensions using manifest version
2, or is there something wrong here?

Regards.

Mike West

unread,
Mar 4, 2012, 1:49:28 AM3/4/12
to Adi, Chromium-extensions
Hi Adi!

Can you post your manifest.json file here? It sounds like the background page isn't being recognized.

If you've moved to the `background` manifest key, note that it requires either a `script` or `page` subkey, like:

    {
      ...
      'background': { 'page': 'background.html' },
      ...
    }

or

    {
      ...
      'background': { 'scripts': ['script1.js', 'script2.js', ...] },
      ...
    }

We had a bug in the documentation up until Friday that mistakenly wrapped the `page` value in an array. Perhaps you took our (bad) advice?

-Mike



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Adam Barth

unread,
Mar 4, 2012, 1:49:45 AM3/4/12
to Adi, Chromium-extensions, Mike West
Have you tested your extension in Chrome 18? Chrome 17 and Chrome 18
behave differently for extensions that use manifest_version 2. If you
don't want to worry about testing in multiple versions, you can wait
for Chrome 18 to reach the stable channel.

Adam

Aditya B

unread,
Mar 4, 2012, 1:59:14 AM3/4/12
to Adam Barth, Chromium-extensions, Mike West
Hi Adam

We haven't tested the extension in Chrome 18. From our understanding, the issue is either due to :

a) Chrome 17 handling the manifest_version_2 in a different manner, or
b) an xhr command we are using to read the extension version number from the extension's local manifest, which may be falling foul of security policies.

Regards

Adi
--
Making life simpler.

Mike West

unread,
Mar 4, 2012, 2:29:05 AM3/4/12
to Chromium-extensions, Aditya B, Adam Barth, Mike West
Two followup questions:

1. If you remove the `manifest_version` key, does the extension work
correctly?

2. Does the extension work correctly as-is on Canary?

Relatedly, the XHR to a file inside the extension package should be
allowed. You can, however, avoid it entirely by calling
`chrome.app.getDetails()`, which will return the contents of your
manifest
as an object.

-mike

Aditya B

unread,
Mar 4, 2012, 2:52:21 PM3/4/12
to Mike West, Adam Barth, Chromium-extensions
Hi Mike

Thanks for the help. Regarding your questions:

1. The extension works in Chrome 17 on removing the manifest_version key and changing background key to background_page key.

2. Extension works in Canary with both versions of manifest.

3. The background page and bnrowser button still don't work in Chrome 17 with manifest_version 2.

Thanks for the tip on chrome.app.getDetails().

- Adi

On Sun, Mar 4, 2012 at 7:27 AM, Mike West <mk...@google.com> wrote:
Two followup questions:

1. If you remove the `manifest_version` key, does the extension work correctly?

2. Does the extension work correctly as-is on Canary?

Relatedly, the XHR to a file inside the extension package should be allowed. You can, however, avoid it entirely by calling `chrome.app.getDetails()`, which will return the contents of your manifest as an object.

-mike



--
Making life simpler.

Adam Barth

unread,
Mar 5, 2012, 1:04:22 AM3/5/12
to Aditya B, Mike West, Chromium-extensions
Aditya,

Have you tried including both the background and the background_page
key? That might be needed for your extension to work on both Chrome
17 and Chrome 18.

Adam

Aditya B

unread,
Mar 5, 2012, 9:33:41 PM3/5/12
to Adam Barth, Mike West, Chromium-extensions
Adam

On including both background and background_page keys, the extension works in Chrome 17 with manifest_version 2 but fails to load in Canary with error: Feature 'background_page' is not allowed in this type of manifest.

Adi
--
Making life simpler.

Adam Barth

unread,
Mar 5, 2012, 9:48:49 PM3/5/12
to Aditya B, Mike West, Chromium-extensions
It looks like there's some discussion of this issue in
<http://code.google.com/p/chromium/issues/detail?id=116463>. Based on
what Aaron wrote in that thread, it sounds like you might want to hold
off on using manifest_version 2 until Chrome 18 is in the stable
channel.

Adam

Reply all
Reply to author
Forward
0 new messages