Background page load fail bug fix release note#30097
Conversation
|
Preview URLs
External URLs (4)URL:
URL:
(comment last updated: 2023-11-10 01:14:04) |
Rob--W
left a comment
There was a problem hiding this comment.
Could you also document the service_worker key at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background ? And the behavior when scripts and service_worker are specified together. That's documented at w3c/webextensions#282 (comment)
Co-authored-by: Rob Wu <rob@robwu.nl>
Rob--W
left a comment
There was a problem hiding this comment.
@rebloor have you seen my previous comment?
Could you also document the
service_workerkey at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background ? And the behavior when scripts and service_worker are specified together. That's documented at w3c/webextensions#282 (comment)
|
|
||
| - Fixed a bug that caused background pages to fail to start when a manifest.json `background` key contained `service_worker` and `scripts` declarations ([Firefox bug 1860304](https://bugzil.la/1860304)). | ||
|
|
||
| > NOTE: Incidentally, Chrome 121 ignores the `scripts` key when specified with the `service_worker` key, instead of refusing to load the extension ([Chromium bug 1418934](https://crbug.com/1418934)). |
There was a problem hiding this comment.
In my suggested text here, it's not obvious that it's about a change in Chrome 121. Are you able to improve the phrasing?
I used "incidentally" because the independent fixes landed in version 121 of both browsers.
| </p> | ||
| </div> | ||
| <p> | ||
| See the note following the table regarding browser support. |
There was a problem hiding this comment.
The note applies to page and scripts and service_worker - basically every key. Would it make sense to turn the NOTE in a dedicated section and link it somewhere?
P.S. In another comment I suggested to add a code example to make the behavior easier to understand. That could then be a final part of the Example section.
There was a problem hiding this comment.
Thanks @Rob--W I've moved the content below the property descriptions to a new "browser support" section and included the example
| > - Safari: | ||
| > - supports `background.service_worker`. | ||
| > - supports `background.scripts`, if `service_worker` is not specified. |
There was a problem hiding this comment.
Maybe move the Safari section after Firefox, so that the special cases with Chrome and Firefox are next to each other.
| > - Firefox: | ||
| > - supports `background.service_worker` if the service worker feature is enabled. However, this feature is affected by [a bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1775618#c1). | ||
| > - supports `background.scripts`, if `service_worker` is not specified or the service worker feature is disabled. | ||
|
|
There was a problem hiding this comment.
This whole section is kind of complex. I think that it would be easier to understand if we preface it by an example and then explain the result. Like this:
{
"name": "Demo of service worker + event page",
"version": "1",
"manifest_version": 3,
"background": {
"scripts": ["background.js"],
"service_worker": "background.js"
}
}background.js:
if (typeof browser == "undefined") {
// Chrome does not support the browser namespace yet.
globalThis.browser = chrome;
}
browser.runtime.onInstalled.addListener(() => {
browser.tabs.create({ url: "http://example.com/firstrun.html" });
});Co-authored-by: Rob Wu <rob@robwu.nl>
Co-authored-by: Rob Wu <rob@robwu.nl>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Adds a release note describing the fix of a bug that resulted in background pages failing to load. Addresses the dev–doc–needed request for Bug 1860304 Background page fails to load if background.service_worker and background.scripts are both present.