Commit Graph

334 Commits

Author SHA1 Message Date
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
Tooru Fujisawa
328d63ce7f Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Andreea Pavel
f009ba2983 Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa
bf0a8b781b Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa
b10d0289af Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Tooru Fujisawa
18c50f5792 Bug 1772101 - Part 17: Use plain object for lazy getter in toolkit/components/extensions/. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D147958
2022-06-07 04:30:57 +00:00
Tooru Fujisawa
f947410342 Bug 1772351 - Part 3: Stop calling XPCOMUtils.defineLazyModuleGetters for AppConstants. r=florian,webdriver-reviewers,whimboo,robwu
Differential Revision: https://phabricator.services.mozilla.com/D148166
2022-06-06 04:42:09 +00:00
Molnar Sandor
4c2b06df41 Backed out 15 changesets (bug 1772313, bug 1772351, bug 1772360) for causing xpc failures in telemetry/tests/unit/test_SocketScalars.js CLOSED TREE
Backed out changeset c8b0a2ed239e (bug 1772360)
Backed out changeset 1922adad6abe (bug 1772351)
Backed out changeset 6d3634cce489 (bug 1772351)
Backed out changeset f03968a9d053 (bug 1772351)
Backed out changeset e7a38ef90fe4 (bug 1772351)
Backed out changeset b389e7654771 (bug 1772313)
Backed out changeset 59a33598ff51 (bug 1772313)
Backed out changeset ab60885a8a93 (bug 1772313)
Backed out changeset aad8efac9d05 (bug 1772313)
Backed out changeset 4378e519a8e7 (bug 1772313)
Backed out changeset 302ac54741f8 (bug 1772313)
Backed out changeset 74c59f9fd51c (bug 1772313)
Backed out changeset 575fb877c56c (bug 1772313)
Backed out changeset 2eaa68f10b19 (bug 1772313)
Backed out changeset 4a8b3ba193dc (bug 1772313)
2022-06-06 07:04:25 +03:00
Tooru Fujisawa
b580e51d8f Bug 1772351 - Part 3: Stop calling XPCOMUtils.defineLazyModuleGetters for AppConstants. r=florian,webdriver-reviewers,whimboo,robwu
Differential Revision: https://phabricator.services.mozilla.com/D148166
2022-06-06 02:49:13 +00:00
Tooru Fujisawa
f1b0a10daf Bug 1765319 - Part 3: Use globalThis in deserialize. r=mixedpuppy
The deserialize parameter is used only for getting global object, and in the JSM
context, it's the shared global.  So directly passing globalThis works.

Differential Revision: https://phabricator.services.mozilla.com/D144133
2022-05-13 20:12:26 +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
364b091e2d Bug 1767336 - Record extension startupCache time to load as a Glean metric mirrored into a telemetry scalar. r=chutten,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D145419
2022-05-09 14:46:42 +00:00
Luca Greco
60ca8725ff Bug 1767336 - Record telemetry related to extension startupCache data size and read errors names. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D145331
2022-05-09 14:46:41 +00:00
Luca Greco
bbcb88d5b0 Bug 1761828 - Propagate isHandlingUserInput from ProxyAPIImplementation.callAsyncFunction. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D143188
2022-04-21 19:32:53 +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
8a81b8a988 Bug 1762394 menu startupCache persistence r=robwu
Add a StartupCache for menus so they are recreated when extensions use event pages.

Differential Revision: https://phabricator.services.mozilla.com/D139789
2022-04-07 22:26:19 +00:00
Kagami Sascha Rosylight
d6ec873f16 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-04-06 11:57:57 +00:00
criss
0038e58f1f Backed out 3 changesets (bug 1703953) for causing multiple failures. CLOSED TREE
Backed out changeset 871a1fac289e (bug 1703953)
Backed out changeset 8151244bda18 (bug 1703953)
Backed out changeset eaf6d4c353be (bug 1703953)
2022-03-29 17:01:58 +03:00
Kagami Sascha Rosylight
f3126104f8 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-03-29 13:11:00 +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
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
Luca Greco
e86c11c611 Bug 1748529 - Allow developer to forcefully terminate non-persistent background script from about:debugging. r=jdescottes,mixedpuppy,fluent-reviewers,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D140379
2022-03-16 15:17:42 +00:00
Rob Wu
ce857ef1bd Bug 1734987 - Part 3.1: Correct isPrivileged during updates r=rpl
During updates, isPrivileged was not set correctly, which resulted in
incorrect error messages (warnings about unsupported permissions) when a
privileged/builtin extension was updated (a variant of bug 1675858).

In the previous patch (part 3), isPrivileged was added to the
ExtensionData constructor, and also passed to BootstrapScope calls,
so we can use that here to.

The unit test here serves two purposes:
1. Primarily: test coverage for the correctness of isPrivileged in the
   update scenario.
2. Test coverage for the existence and order of ExtensionAPI's onUpdate
   calls. There is no unit test for this mechanism right now, only
   indirect tests.

Differential Revision: https://phabricator.services.mozilla.com/D131682
2022-02-27 13:23:57 +00:00
Rob Wu
cb2c04da02 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-06 14:15:47 +00:00
Alexandru Michis
8282e82b21 Backed out changeset 4ae7738694e1 (bug 1748158) for causing xpcshell failures in test_ext_native_messaging_permissions.js
CLOSED TREE
2022-01-06 02:55:58 +02:00
Rob Wu
5be369dc94 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl,geckoview-reviewers,jonalmeida
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-05 20:41:07 +00:00
Marian-Vasile Laza
d4d55e1595 Backed out changeset 0bf0fa6d8a5a (bug 1748158) for causing xpcshell failures on test_ext_native_messaging_permissions.js. CLOSED TREE 2022-01-05 04:05:14 +02:00
Rob Wu
c686f79b28 Bug 1748158 - Omit sender.frameId if sender.tab is unset r=rpl
`sender.frameId` should be set iff `sender.tab` is set, as documented at
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender
The removal of the `viewType == "tab"` condition broke this in
https://hg.mozilla.org/mozilla-central/rev/2dc4f1baccc8

This patch makes the presence of `frameId` conditional on `tab`, and
fixes several tests that relied on the incorrect behavior:

- Move the runtime.onConnect test from test_ext_contentscript_in_background.js
  to a new mochitest at test_ext_runtime_connect_iframe.html.

- Simplify test_ext_contentscript_in_background.js to continue to
  provide test coverage for contentScripts.register + allFrames.

- Replace runtime.onConnect with runtime.getFrameId in
  test_ext_contentscript_xorigin_frame.js, since sender.frameId is no
  longer available in xpcshell tests (because internals to support the
  tabs extension API are not available in xpcshell tests). The test
  cannot be moved to a mochitest because its purpose is to provide test
  coverage for process switching in a xpcshell test (bug 1580811).

Differential Revision: https://phabricator.services.mozilla.com/D135057
2022-01-04 23:07:16 +00:00
Rob Wu
83ec2df351 Bug 1739746 - Restrict nativeMessaging to privileged extensions on Android r=agi,zombie,extension-reviewers
Make nativeMessaging a privileged permission on Android, to hide the
connectNative/sendNativeMessage APIs from non-builtin add-ons,
and to avoid the permission warning on regular extensions (where the API
is unavailable).

Add unit tests to get coverage on the availability and behavior of the
native messaging APIs on Android, since we did not have any yet.

And fix a small serialization issue in ExtensionParent.jsm

Differential Revision: https://phabricator.services.mozilla.com/D130529
2021-11-09 16:49:28 +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
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
Tomislav Jovanovic
dc5b62d25a Bug 1708243 - Part 4: Remove tab-content.js and onExtensionBrowser.js, stop touching .content eagerly r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D127750
2021-10-09 22:45:28 +00:00
Luca Greco
0dc7ceab9a Bug 1688040 - part7.3: Adapt child/ext-runtime.js to handle webidl API request. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D106702
2021-10-06 12:28:21 +00:00
Luca Greco
69ad62c426 Bug 1688040 - part1.6: adapting parent context to workers r=zombie
This is currently a temporary quick approach to more quickly verify the
worker child context with a sample of API calls proxied to the main process
(currently using the alarms API, as it is pretty small and simple).

It is likely better for this patch to create a new parent context that is specifically
meant to be used for the worker proxied contexts.

Differential Revision: https://phabricator.services.mozilla.com/D86203
2021-10-06 12:28:17 +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
1bc66ba74e Bug 1688040 - part7.3: Adapt child/ext-runtime.js to handle webidl API request. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D106702
2021-10-05 17:05:42 +00:00
Luca Greco
a9cab971e5 Bug 1688040 - part1.6: adapting parent context to workers r=zombie
This is currently a temporary quick approach to more quickly verify the
worker child context with a sample of API calls proxied to the main process
(currently using the alarms API, as it is pretty small and simple).

It is likely better for this patch to create a new parent context that is specifically
meant to be used for the worker proxied contexts.

Differential Revision: https://phabricator.services.mozilla.com/D86203
2021-10-05 17:05:37 +00:00
Tomislav Jovanovic
4c6ca46e88 Bug 1729395 - Handle message sender going away during message processing r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D125128
2021-09-10 20:40:40 +00:00
Tomislav Jovanovic
007d45809d Bug 1708243 - Part 2: stop using sender data from the child process r=robwu,agi
Differential Revision: https://phabricator.services.mozilla.com/D123351
2021-08-31 23:15:17 +00:00
criss
952851eac2 Backed out changeset a269440d7e21 (bug 1708243) for causing failures on mochitest/test_ext_tabs_create.html. CLOSED TREE 2021-08-31 23:22:19 +03:00
Tomislav Jovanovic
f3de0ca755 Bug 1708243 - Part 2: stop using sender data from the child process r=robwu,agi
Differential Revision: https://phabricator.services.mozilla.com/D123351
2021-08-31 18:48:17 +00:00
Csoregi Natalia
042ea59c67 Backed out changeset f966b7898d9f (bug 1708243) for geckoview failures. CLOSED TREE 2021-08-31 18:40:20 +03:00