Commit Graph

76 Commits

Author SHA1 Message Date
Luca Greco
e775d9654d Bug 1787940 - Add new telemetry for event page running time and idle timeout results. r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D156490
2022-09-13 17:21:29 +00:00
Luca Greco
b599a27210 Bug 1785294 - Allow pending async API event listeners calls to reset event page idle timeout only once. r=mixedpuppy
Depends on D153525

Differential Revision: https://phabricator.services.mozilla.com/D155071
2022-08-30 19:25:01 +00:00
Luca Greco
143dcd66ef Bug 1785294 - Reset idle on API event listeners with a pending queryRunListener promise. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D153525
2022-08-30 19:25:01 +00:00
Cosmin Sabou
d22f5627d5 Backed out 2 changesets (bug 1785294) for causing xpcshell failures on est_ext_eventpage_settings.js. CLOSED TREE
Backed out changeset fea7efce878b (bug 1785294)
Backed out changeset 4b7c6808489d (bug 1785294)
2022-08-29 23:57:11 +03:00
Luca Greco
1d162d0136 Bug 1785294 - Allow pending async API event listeners calls to reset event page idle timeout only once. r=mixedpuppy
Depends on D153525

Differential Revision: https://phabricator.services.mozilla.com/D155071
2022-08-29 20:12:17 +00:00
Luca Greco
23ede65579 Bug 1785294 - Reset idle on API event listeners with a pending queryRunListener promise. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D153525
2022-08-29 20:12:17 +00:00
Luca Greco
46fdafb3de Bug 1770696 - Reset the background script idle timer if the extension have native app ports still open. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D151647
2022-07-19 13:39:09 +00:00
Luca Greco
4d64c55209 Bug 1777487 - Only query active StreamFilters if webRequestBlocking permission is granted and prevent race with extension shutdown. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D150753
2022-07-07 18:55:38 +00:00
Luca Greco
2fab75125b Bug 1759300 - Cancel suspend on idle if the extension EventPage has StreamFilter instances still active. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D145257
2022-05-09 20:33:28 +00:00
Luca Greco
bfd1a611a7 Bug 1763043 - return a rejected promise if extension.wakeupBackground is called while extension.hasShutdown is true. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D144011
2022-04-19 19:50:06 +00:00
Luca Greco
59f0486bb4 Bug 1763043 - extension.terminateBackground should early exit if extension.hasShutdown is true. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D143997
2022-04-19 19:50:06 +00:00
Luca Greco
2e2129ea88 Bug 1748530 - Prevent event page from being terminated on idle while a devtools toolbox is attached to the extension. r=mixedpuppy,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D142991
2022-04-14 19:54:32 +00:00
Shane Caraveo
8def3b7c43 Bug 1748563 support persistent events in runtime api r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D137953
2022-03-30 23:48:00 +00:00
Shane Caraveo
8d25fbd662 Bug 1762048 refactor extension background page build r=rpl,robwu
Differential Revision: https://phabricator.services.mozilla.com/D141993
2022-03-30 23:47:59 +00:00
Shane Caraveo
e617aad86f Bug 1753850 implement runtime.onSuspend for non-persistent background r=rpl,robwu
Differential Revision: https://phabricator.services.mozilla.com/D137950
2022-03-28 21:44:48 +00:00
Butkovits Atila
ca0650e33b Backed out changeset 8ca972dfa3d8 (bug 1753850) for causing Android Xpcshell failures. CLOSED TREE 2022-03-28 21:57:06 +03:00
Shane Caraveo
862d1d1f59 Bug 1753850 implement runtime.onSuspend for non-persistent background r=rpl,robwu
Differential Revision: https://phabricator.services.mozilla.com/D137950
2022-03-28 16:46:43 +00:00
Rob Wu
cdfe2f00da Bug 1761072 - Replace use of ExtensionParent in devtools' ExtensionsBackgroundScriptStatusWatcher r=rpl,jdescottes
ExtensionParent.jsm cannot be loaded without a profile, as explained at
https://bugzilla.mozilla.org/show_bug.cgi?id=1761072#c5.

But ExtensionsBackgroundScriptStatusWatcher would try to (lazily) load
the module before a profile was ready, in order to subscribe to future
changes. To avoid loading this whole ExtensionParent.jsm module, I have
replaced the event propagation mechanism with observers.

Differential Revision: https://phabricator.services.mozilla.com/D142065
2022-03-25 22:24:11 +00:00
Shane Caraveo
cca0fcf211 Bug 1748525 implement idle timeout for extension event pages r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D137942
2022-03-23 22:48:40 +00:00
Butkovits Atila
4337e45873 Backed out changeset e9dcf342fa98 (bug 1748525) for causing xpcshell failures. CLOSED TREE 2022-03-23 23:01:12 +02:00
Shane Caraveo
b958675790 Bug 1748525 implement idle timeout for extension event pages r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D137942
2022-03-23 19:05:24 +00:00
Luca Greco
91b4d6d3b5 Bug 1748529 - Show extensions non-persistent background script status changes in about:debugging. r=jdescottes,mixedpuppy,fluent-reviewers,devtools-backward-compat-reviewers,flod,ochameau
Depends on D140379

Differential Revision: https://phabricator.services.mozilla.com/D139701
2022-03-16 15:17:42 +00:00
Shane Caraveo
a5b36ca82f Bug 1757855 fix background startup and persistent listeners during addon upgrades r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D140154
2022-03-10 01:08:56 +00:00
Butkovits Atila
be3b21fbf2 Backed out changeset c295e6801d39 (bug 1757855) for causing failures at RemoteProcessMonitor. CLOSED TREE 2022-03-09 04:02:34 +02:00
Shane Caraveo
86bde10827 Bug 1757855 fix background startup and persistent listeners during addon upgrades r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D140154
2022-03-09 01:02:50 +00:00
Andreea Pavel
3b5dd4b5b1 Backed out changeset d705f8e9b4ee (bug 1757855) for multiple failures on a CLOSED TREE 2022-03-08 22:36:39 +02:00
Shane Caraveo
7ebf794a14 Bug 1757855 fix background startup and persistent listeners during addon upgrades r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D140154
2022-03-08 18:57:29 +00:00
Shane Caraveo
e38cc78870 Bug 1753308 fix extension startup in tests, remove delayed startup pref r=rpl,robwu
Differential Revision: https://phabricator.services.mozilla.com/D137699
2022-02-19 15:52:26 +00:00
Shane Caraveo
0c10936d04 Bug 1748541 make all events persistable for event pages r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D135813
2022-01-28 03:55:41 +00:00
Shane Caraveo
afbca3636b Bug 1748524 sleep/waken functionality for background, restartable via persistent events r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D135812
2022-01-25 20:49:15 +00:00
Marian-Vasile Laza
9447e468f8 Backed out changeset 2f4c63b2e472 (bug 1748524) for causing xpcshell failures on test_ext_alarms.js. CLOSED TREE 2022-01-25 01:26:30 +02:00
Shane Caraveo
64d3fc1694 Bug 1748524 sleep/waken functionality for background, restartable via persistent events r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D135812
2022-01-24 21:18:28 +00:00
Luca Greco
7d33f42e21 Bug 1728326 - Rename internal WebExtensions events related to the background script (from background-page into background-script). r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D124783
2021-11-05 21:27:05 +00:00
Luca Greco
026a4e9a98 Bug 1728326 - Introduce BackgroundWorkerContextParent and verify worker descriptor id is part of the extension worker registration. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D124782
2021-11-05 21:27:05 +00:00
Luca Greco
b980a9fae1 Bug 1728326 - Notify main process when the extension background service worker has been fully loaded. r=zombie
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
2021-11-05 21:27:04 +00:00
Marian-Vasile Laza
f89640f067 Backed out 10 changesets (bug 1728326) for causing build bustages. CLOSED TREE
Backed out changeset 39267f23ee63 (bug 1728326)
Backed out changeset 070f187c2005 (bug 1728326)
Backed out changeset f06e0af1bf81 (bug 1728326)
Backed out changeset d21475767077 (bug 1728326)
Backed out changeset 4ca5e36e3c71 (bug 1728326)
Backed out changeset fd700124d69b (bug 1728326)
Backed out changeset 5c8d87c04ac6 (bug 1728326)
Backed out changeset 247504b7ea84 (bug 1728326)
Backed out changeset de8879fc8126 (bug 1728326)
Backed out changeset ebf25d0924d6 (bug 1728326)
2021-11-05 22:48:14 +02:00
Luca Greco
4e5059499c Bug 1728326 - Rename internal WebExtensions events related to the background script (from background-page into background-script). r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D124783
2021-11-05 20:27:03 +00:00
Luca Greco
fc4fc890ef Bug 1728326 - Introduce BackgroundWorkerContextParent and verify worker descriptor id is part of the extension worker registration. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D124782
2021-11-05 20:27:02 +00:00
Luca Greco
d60890ba2d Bug 1728326 - Notify main process when the extension background service worker has been fully loaded. r=zombie
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
2021-11-05 20:27:02 +00:00
Luca Greco
98b98a24e9 Bug 1688040 - part7.2: Listen for background service worker changes and emit internal event to ensure extension.wakeupBackground promise is resolved. r=zombie
Depends on D106700

Differential Revision: https://phabricator.services.mozilla.com/D106701
2021-10-06 12:28:21 +00:00
Iulian Moraru
7e43871db1 Backed out 27 changesets (bug 1688040) for causing multiple failures. CLOSED TREE
Backed out changeset 85ba163b6423 (bug 1688040)
Backed out changeset 36cdc1600e66 (bug 1688040)
Backed out changeset 88395ab5a5b5 (bug 1688040)
Backed out changeset 8d33bdd8d0b8 (bug 1688040)
Backed out changeset fdbced7a94f3 (bug 1688040)
Backed out changeset 922ca2f20fa1 (bug 1688040)
Backed out changeset 7fc233bf144c (bug 1688040)
Backed out changeset 64221db54d98 (bug 1688040)
Backed out changeset 4d9b2a9dd247 (bug 1688040)
Backed out changeset c8d890f1a8e2 (bug 1688040)
Backed out changeset 81e957717eb1 (bug 1688040)
Backed out changeset b7dcade29dab (bug 1688040)
Backed out changeset 20e38838aa89 (bug 1688040)
Backed out changeset 08737e7ea047 (bug 1688040)
Backed out changeset b82645d5b7c7 (bug 1688040)
Backed out changeset db374d34839a (bug 1688040)
Backed out changeset 6a2ebb56325d (bug 1688040)
Backed out changeset 7d0ce555263f (bug 1688040)
Backed out changeset 15e0689a57f0 (bug 1688040)
Backed out changeset d7d6b1bec92a (bug 1688040)
Backed out changeset 615b683acb00 (bug 1688040)
Backed out changeset 49d3e1baf577 (bug 1688040)
Backed out changeset 30cc613912ce (bug 1688040)
Backed out changeset d413ec19bded (bug 1688040)
Backed out changeset cfdf6e87d820 (bug 1688040)
Backed out changeset f719b9d0bc25 (bug 1688040)
Backed out changeset 925f23a58da6 (bug 1688040)
2021-10-05 22:49:40 +03:00
Luca Greco
759cbd593e Bug 1688040 - part7.2: Listen for background service worker changes and emit internal event to ensure extension.wakeupBackground promise is resolved. r=zombie
Depends on D106700

Differential Revision: https://phabricator.services.mozilla.com/D106701
2021-10-05 17:05:41 +00:00
Luca Greco
ee2d121d6e Bug 1638099 - Unregister all extension service workers on extension shutdown if the app is not also shutting down. r=mixedpuppy
This patch introduces changes to parent/ext-backgroundPage.js and Extension's shutdown methods to make sure
that all service workers registered by an extension are unregistered when the extension is shutting down,
unless the application is also shutting down (in which case the registration is not unregistered because
for the already installed extenson the previously activeWorker is expected to be still active across browser
restarts).

These changes prevent also to hit the issue that D119532 was triggering when an extension was reloaded
and it does not need any of the changes to ContentPrincipal::AddonPolicy from D119531.

Differential Revision: https://phabricator.services.mozilla.com/D119903
2021-07-26 17:52:24 +00:00
Luca Greco
5976717cdb Bug 1609920 - part 3: Terminate extension background workers on shutdown and unregister on uninstall. r=dom-workers-and-storage-reviewers,asuth,mixedpuppy
Depends on D60245

Differential Revision: https://phabricator.services.mozilla.com/D60301
2020-07-03 10:14:59 +00:00
Luca Greco
c148adab44 Bug 1609920 - part 1: Allow the WebExtension Framework to register a moz-extension service worker. r=dom-workers-and-storage-reviewers,asuth,mixedpuppy
- Adds the new about:config pref "extensions.backgroundServiceWorker.enabled" (currently defaults to false).
- Adds the background.service_worker property to the manifest JSON schema definition
- Locks background.service_worker manifest property behind the new preference
- Adds a new BackgroundWorker class to ext-backgroundPage.js (responsible for managing the background
  service worker for the extension, e.g. make sure that the expected worker script is registered
  as expected when the extension is starting up)
- Adds to the ServiceWorkerManager a new method to allow the WebExtension Framework to register the
  background service worker without an existing extension page
- Allows the "moz-extension" schema in the dom/serviceworkers and dom/cache internals

Depends on D63697

Differential Revision: https://phabricator.services.mozilla.com/D60244
2020-07-03 10:14:24 +00:00
Sebastian Hengst
48e0b31e50 Backed out 4 changesets (bug 1609920) for leaks in browser-chrome. CLOSED TREE
Backed out changeset 1c8faab05606 (bug 1609920)
Backed out changeset eaa0bb2cf36b (bug 1609920)
Backed out changeset fd1e4db7cf78 (bug 1609920)
Backed out changeset 0e68db4ad6af (bug 1609920)
2020-07-01 17:10:13 +02:00
Luca Greco
b3c28ec4a5 Bug 1609920 - part 3: Terminate extension background workers on shutdown and unregister on uninstall. r=dom-workers-and-storage-reviewers,asuth,mixedpuppy
Depends on D60245

Differential Revision: https://phabricator.services.mozilla.com/D60301
2020-06-10 20:48:23 +00:00
Luca Greco
83c4af032c Bug 1609920 - part 1: Allow the WebExtension Framework to register a moz-extension service worker. r=dom-workers-and-storage-reviewers,asuth,mixedpuppy
- Adds the new about:config pref "extensions.backgroundServiceWorker.enabled" (currently defaults to false).
- Adds the background.service_worker property to the manifest JSON schema definition
- Locks background.service_worker manifest property behind the new preference
- Adds a new BackgroundWorker class to ext-backgroundPage.js (responsible for managing the background
  service worker for the extension, e.g. make sure that the expected worker script is registered
  as expected when the extension is starting up)
- Adds to the ServiceWorkerManager a new method to allow the WebExtension Framework to register the
  background service worker without an existing extension page
- Allows the "moz-extension" schema in the dom/serviceworkers and dom/cache internals

Depends on D63697

Differential Revision: https://phabricator.services.mozilla.com/D60244
2020-06-10 12:13:29 +00:00
Rob Wu
e301cec0dc Bug 1631771 - Add guard to clearPrimedListeners in ext-backgroundPage.js r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71990
2020-04-23 10:13:13 +00:00
Tomislav Jovanovic
1780ac4d6b Bug 1624235 - Simplify handling of persistent listeners for runtime messaging r=robwu
Persistent listeners for onMessage and onConnect are special because they
don't have parent EventManagers, so we have a lot of custom code just to keep
track of which extensions have registered them during previous runs.

In this patch, I simplify all that logic to always assume that any extension
which sends messages from content scripts has those listeners setup properly.

The only observable difference is that some poorly written extensions which
were previously broken by delayed startup will now "work" by being started
earlier if a message from a content script arrives during browser startup.

Additionally, unconfuse two different meanings of the "startup" event.
Bonus, avoid some logspam during tests.

Differential Revision: https://phabricator.services.mozilla.com/D70955
2020-04-22 20:03:28 +00:00