This ensures that WebExtensionPolicy is properly initialized even when
ExtensionProcessScript has not instantiated BrowserExtensionContent yet.
Differential Revision: https://phabricator.services.mozilla.com/D147331
Introduce common updateAllowedOrigins helper to avoid repetition of
policy.allowedOrigins-updating logic in four places.
While there are no user-visible behavioral changes, the patch does fix a
small issue: previously policy.allowedOrigins could have multiple
MatchPattern instances with exactly the same pattern due to the
implementation in ExtensionChild, now the helper ensures that all
patterns are unique.
Differential Revision: https://phabricator.services.mozilla.com/D147330
This patch is making sure that `context.active` is going to be `false` when an extension page
has been moved into the bfcache because the `browser` element where it was loading into has been navigated
to a page that needs to run in a different process.
This also match the expected behavior for a same process navigation (e.g. an extension page being navigated
to another extension page) and the changes in this patch do also fix Bug 1499129 which was already happening
for same process navigations (and it does the same also for an extension page moved to the bfcache because
of a cross-process navigation case tracked by this bug).
The test case included in this patch cover both same-process and cross-process navigations under fission
and non fissions jobs.
Differential Revision: https://phabricator.services.mozilla.com/D145919
Additional changes needed to observe the "extension-worker-loaded" topics and notify the main process when the background
service worker script has been fully loaded (similarly to how we notify the main process when
the background page has been fully loaded).
Differential Revision: https://phabricator.services.mozilla.com/D124704
Additional changes needed to observe the "extension-worker-loaded" topics and notify the main process when the background
service worker script has been fully loaded (similarly to how we notify the main process when
the background page has been fully loaded).
Differential Revision: https://phabricator.services.mozilla.com/D124704
Currently all the WebExtensions internals related to background service worker are going to be unused
in non-nightly channels (where the background service worker is disabled at build time), and so we should
defer loading any of the internal classes related to the background service worker, up until an extension
context for an extension background service worker is actually being created.
This patch includes the changes needed to:
- move WorkerMessenger, WebIDLChildAPIManager and WorkerContextChild classes (and other classes used internally only by
this classes) into a new ExtensionWorkerChild.jsm file
- ensure ExtensionProcessScript.jsm will load ExtensionWorkerChild lazily, once an instance
of the WorkerContextChild class for a newly spawned extension background service worker
has to be created
Differential Revision: https://phabricator.services.mozilla.com/D128086
This is the initial level of support for MV3 web_accessible_resources, which simply moves the
resource list into an object notation. It lays out the framework to support the additional functionality
that will be implemented in followup bugs.
Differential Revision: https://phabricator.services.mozilla.com/D107310
Bug 1655624 happened because the format of an internal error changed,
which caused an internal error to be propagated unexpectedly.
This patch fixes the issue by only propagating errors that are known to
originate from extensions, plus a regression test.
This patch also fixes a few other issues:
- Internal errors are redacted to "An unexpected error occurred",
which partially fixes bug 1643176.
- Fix minor regression in void rejections: Prior to bug 1583484, an
onMessage handler that rejected with a void value would cause
sendMessage to reject. Since bug 1583484 the promise is not rejected,
as the error is inadvertently ignored due to a runtime error:
"TypeError: can't access property "result", err is undefined".
- Avoid type confusion of objects with the mozWebExtLocation member.
Differential Revision: https://phabricator.services.mozilla.com/D85643
Bug 1655624 happened because the format of an internal error changed,
which caused an internal error to be propagated unexpectedly.
This patch fixes the issue by only propagating errors that are known to
originate from extensions, plus a regression test.
This patch also fixes a few other issues:
- Internal errors are redacted to "An unexpected error occurred",
which partially fixes bug 1643176.
- Fix minor regression in void rejections: Prior to bug 1583484, an
onMessage handler that rejected with a void value would cause
sendMessage to reject. Since bug 1583484 the promise is not rejected,
as the error is inadvertently ignored due to a runtime error:
"TypeError: can't access property "result", err is undefined".
- Avoid type confusion of objects with the mozWebExtLocation member.
Differential Revision: https://phabricator.services.mozilla.com/D85643
It isn't useful now that there is a `Window.windowUtils` WebIDL getter, and it
causes problems in the face of certain WeakMap issues.
Differential Revision: https://phabricator.services.mozilla.com/D82795