Commit graph

1261 commits

Author SHA1 Message Date
Mark Hammond
6e4d1af4af Bug 1623245 - A new browser.storage.sync local storage implementation, pref'd off. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D67273
2020-05-15 01:29:56 +00:00
Geoff Lankow
82253c37f5 Bug 1633931 - Fix and re-enable WebExtensions tests on Thunderbird. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72972
2020-05-13 23:18:44 +00:00
Andrea Marchesini
a41938cab8 Bug 1635490 - Implement ExpandedPrincipal::IsThirdPartyURI() to consider any sub principal's URI - tests, r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D74175
2020-05-13 16:50:19 +00:00
Mark Hammond
f378e12e04 Bug 1637165 - Expose quota constants and getBytesInUse to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D74815
2020-05-13 07:40:05 +00:00
Tomislav Jovanovic
18a6ab6770 Bug 1635925 - Add test for connect/onConnect to and from extension iframes r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D74573
2020-05-12 11:47:29 +00:00
Robert Helmer
fa52bedc4b Bug 1634557 - add new browser.telemetry.submitEncryptedPing for Pioneer v2 r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D73525
2020-05-10 03:37:48 +00:00
Narcis Beleuzu
d4b69fe1cb Backed out 2 changesets (bug 1634557) for xpcshell failures on test_TelemetryController.js . CLOSED TREE
Backed out changeset 267872a67dca (bug 1634557)
Backed out changeset dd18c3fa87f4 (bug 1634557)
2020-05-08 23:12:08 +03:00
Robert Helmer
aa9713dbf5 Bug 1634557 - add new browser.telemetry.submitEncryptedPing for Pioneer v2 r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D73525
2020-05-07 22:52:47 +00:00
Mark Hammond
42513f056f Bug 1635688 - don't expose wipe_all to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D74012
2020-05-07 04:37:51 +00:00
Tomislav Jovanovic
b979b871fc Bug 1635637 - Add contextId to MessageSender, prevent onConnect in same Context r=robwu
We already had logic to avoid sending to the same context, but weren't setting the `contextId` as necessary.
https://searchfox.org/mozilla-central/rev/dc4560dc/toolkit/components/extensions/ConduitsParent.jsm#251

Also add a test specifically for connect() triggering onConnect in the same Context, since the existing test only covered sendMessage.

Differential Revision: https://phabricator.services.mozilla.com/D74099
2020-05-06 17:53:00 +00:00
Ian Moody
011b59d595 Bug 1536556 - Replace raw thrown Cr.ERRORs with Components.Exception. r=mossop,remote-protocol-reviewers,marionette-reviewers,whimboo,necko-reviewers,geckoview-reviewers,valentin,agi
Raw Cr.ERROR don't get stack information, same as throwing JS literals instead
of `new Error()`s.

This was done automatically with a new eslint rule that will be introduced in
the next commit.  One instance of a raw Cr.ERROR was not replaced since it is
used in a test that specifically checks the preservation of raw Cr values in
XPCJS.  The rule will be disabled for that instance.

Differential Revision: https://phabricator.services.mozilla.com/D28073
2020-05-05 17:41:36 +00:00
Liang-Heng Chen
1431c1b046 Bug 1634306 - add new cookieBehavior case BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN; r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D73609
2020-05-05 14:40:21 +00:00
Lina Cambridge
8caa2f7986 Bug 1634191 - Wire up Golden Gate to the new Rust extension storage interface. r=markh
This commit adds syncing support to the `StorageSyncArea` class, via
the Golden Gate library.

It also changes the `BridgedEngine` trait: `initialize` and `finalize`
haven't been useful in practice, since that's managed by the storage
service, and the `LazyStore` takes care of setting up the storage
connection on first use. But, what we do need is a way to signal a
sync is starting, so that the engine can set up temp tables. That's
handled by the new `sync_started`.

Finally, this commit changes `BridgedEngine::set_uploaded` to take a
`sync15_traits::Guid` instead of a `String`.

Differential Revision: https://phabricator.services.mozilla.com/D73415
2020-05-05 06:59:32 +00:00
Andrea Marchesini
66722b7b39 Bug 1629436 - requests with webExtension loading principal are not 3rd party - tests, r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D73028
2020-05-01 22:59:37 +00:00
Ciure Andrei
c7af299990 Backed out 2 changesets (bug 1629436) for causing test_chrome_ext_trackingprotection.html failures CLOSED TREE
Backed out changeset 18d21d5f63dd (bug 1629436)
Backed out changeset d14b4bb75db7 (bug 1629436)
2020-05-01 23:43:02 +03:00
Andrea Marchesini
a22e6c201b Bug 1629436 - requests with webExtension loading principal are not 3rd party - tests, r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D73028
2020-05-01 17:29:41 +00:00
Shane Caraveo
c6bf5854a2 Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-30 18:39:23 +00:00
Mark Hammond
c777f6f9ed Bug 1634257 - expose wipe_all to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D73191
2020-04-30 08:16:26 +00:00
Stefan Hindli
49c6346195 Backed out changeset 13bb4d7dde88 (bug 1634257) for spidermoney bustages CLOSED TREE 2020-04-30 10:56:43 +03:00
Mark Hammond
baecd41165 Bug 1634257 - expose wipe_all to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D73191
2020-04-30 07:08:38 +00:00
Daniel Varga
63b9840733 Backed out changeset 8a0b81f6263e (bug 1606862) for causing devtools failures at devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js
CLOSED TREE
2020-04-30 06:05:20 +03:00
Shane Caraveo
257084d3fa Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-30 01:50:34 +00:00
Dorel Luca
964d69b146 Backed out changeset 74dce6390e5e (bug 1606862) for Xpcshell failures in extensions/test/xpcshell/test_ext_startup_perf.js. CLOSED TREE 2020-04-30 04:17:57 +03:00
Shane Caraveo
327dcc3d53 Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-29 23:28:27 +00:00
Perry Jiang
5846eeaf94 Bug 1595197 - fix StreamFilter redirect handling r=zombie,robwu
We need to disconnect the stream filter on redirect and allow the extension
to create a new filter.  However, we also must always retain the channel
provided to us in onStartRequest, otherwise onStop fails.  The request passed
to onStartRequest is always the right channel.

Differential Revision: https://phabricator.services.mozilla.com/D53187
2020-04-29 19:42:25 +00:00
Shane Caraveo
a1af8a6df8 Bug 1628239 fix extension permission migration for permissionless extensions r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D72221
2020-04-29 19:45:42 +00:00
Shane Caraveo
ad9affc0fe Bug 1628307 fix running webextension in-process tests r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D70265
2020-04-29 19:13:30 +00:00
Shane Caraveo
35a1cb2c57 Bug 1630413 don't prompt for unlimitedStorage extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71812
2020-04-22 20:51:52 +00:00
Lina Cambridge
add5457732 Bug 1633943 - Support tearing down a Rust StorageSyncArea. r=markh
This commit wires up `StorageSyncArea::teardown()` to call the new
`webext_storage::Store::close()` method.

It also changes `teardown` to drop the `LazyStore`, and thus close its
database connection, on the main thread if dispatching to the task
queue fails. Dispatch should only fail at shutdown, and putting the
owned reference back only adds indirection, since the `StorageSyncArea`
will still drop its `LazyStore` later in shutdown.

Finally, it includes an xpcshell test fix for
https://github.com/mozilla/application-services/pull/3050.

Differential Revision: https://phabricator.services.mozilla.com/D72992
2020-04-29 04:35:45 +00:00
Lina Cambridge
91aacc3dd5 Bug 1633750 - Only build the extension storage Rust-C++ glue if MOZ_NEW_WEBEXT_STORAGE is enabled. r=markh
Differential Revision: https://phabricator.services.mozilla.com/D72965
2020-04-29 04:41:31 +00:00
Mark Hammond
310923383d Bug 1633670 - Move a sync-specific test from test_ext_storage.js to test_ext_storage_sync.js. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D67973
2020-04-28 10:37:14 +00:00
Andrea Marchesini
45e518e2ee Bug 1628755 - Fix test_ext_privacy.js xpcshell-test failure in beta, r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72810
2020-04-28 17:38:51 +00:00
Luca Greco
42507b3a15 Bug 1593240 - Prevent re-entrancy issues in ExtensionPolicyService::CheckContentScripts related to EPS.loadContentScript calls r=robwu,mixedpuppy
ExtensionPolicyService::CheckContentScripts does retrieve mContentScripts a WebExtensionPolicy instance
and it may call the ExtensionProcessScript methods PreloadContentScript or LoadContentScript while iterating
over it mContentScript.

Both PreloadContentScript and LoadContentScript are going to run some privileged JS code, and LoadContentScript
will load an extension content script. There is a chance that some of the JS code executed could call
WebExtensionPolicy::UnregisterContentScript (or RegisterContentScript) and mutate the mContentScripts array
that EPS::CheckContentScripts is already iterating over, and when that happens it is possible that once the
execution goes back to the ongoing CheckContentScripts iteration, the iterator is invalidated and
the InvalidArrayIndex_CRASH triggered.

Differential Revision: https://phabricator.services.mozilla.com/D69336
2020-04-06 18:59:16 +00:00
Luca Greco
d2fe19febd Bug 1631434 - Add test case to ensure storage.local data not cleared as a side-effect of removing unlimitedStorage permission. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72339
2020-04-27 18:35:05 +00:00
Shane Caraveo
211ea5dc73 Bug 1548011 support proxy as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71118
2020-04-26 22:03:16 +00:00
Shane Caraveo
cb8a65428f Bug 1444294 implement browser.permissions onAdded/Removed r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D71231
2020-04-27 16:20:12 +00:00
Lina Cambridge
1aa777d5e1 Bug 1626506 - Add a binding for the new extension storage Rust component. r=markh
The `webext_storage_bridge` crate introduced in this commit bridges the
`mozIExtensionStorageArea` XPCOM interface to the `webext_storage` Rust
component from Application Services.

This commit factors out the following parts from bug 1623245, so that
we can land them piecemeal:

* The `mozIExtensionStorageArea` interfaces, which implement all the
  methods needed to support the `storage.sync` API.
* A Rust implementation of the above, in `StorageSyncArea`.
* A `StorageTask` type, for dispatching storage operations to a
  background task queue.
* A `LazyStore`, which wraps the Rust component's `Store` and lazily
  initializes it on the background queue the first time it's used.
* A `StorageSyncService`, which is our singleton. It holds on to a
  configured `StorageSyncArea`, and hands out references to it via
  `getInterface`. Eventually, we'll extend this to support syncing,
  too.

Differential Revision: https://phabricator.services.mozilla.com/D71897
2020-04-27 05:40:54 +00:00
Mihai Alexandru Michis
807ec47bae Backed out 2 changesets (bug 1626506) for causing bustages.
CLOSED TREE

Backed out changeset f3deedfe235d (bug 1626506)
Backed out changeset 00b40d247500 (bug 1626506)
2020-04-27 08:11:19 +03:00
Lina Cambridge
e1b6df9fd4 Bug 1626506 - Add a binding for the new extension storage Rust component. r=markh
The `webext_storage_bridge` crate introduced in this commit bridges the
`mozIExtensionStorageArea` XPCOM interface to the `webext_storage` Rust
component from Application Services.

This commit factors out the following parts from bug 1623245, so that
we can land them piecemeal:

* The `mozIExtensionStorageArea` interfaces, which implement all the
  methods needed to support the `storage.sync` API.
* A Rust implementation of the above, in `StorageSyncArea`.
* A `StorageTask` type, for dispatching storage operations to a
  background task queue.
* A `LazyStore`, which wraps the Rust component's `Store` and lazily
  initializes it on the background queue the first time it's used.
* A `StorageSyncService`, which is our singleton. It holds on to a
  configured `StorageSyncArea`, and hands out references to it via
  `getInterface`. Eventually, we'll extend this to support syncing,
  too.

Differential Revision: https://phabricator.services.mozilla.com/D71897
2020-04-27 03:23:46 +00:00
Cosmin Sabou
58b8c2e82b Backed out 5 changesets (bug 1630414, bug 1444294, bug 1630417, bug 1630418, bug 1548011) for failures on test_ext_all_apis.html. CLOSED TREE
Backed out changeset 1dde649fe4e0 (bug 1548011)
Backed out changeset 87d571004699 (bug 1630418)
Backed out changeset 0a2dafa70692 (bug 1630414)
Backed out changeset a127af3c4cd1 (bug 1630417)
Backed out changeset b35022051d3d (bug 1444294)
2020-04-27 00:52:27 +03:00
Shane Caraveo
15d2acc180 Bug 1548011 support proxy as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71118
2020-04-26 18:37:32 +00:00
Shane Caraveo
c46b9b5698 Bug 1444294 implement browser.permissions onAdded/Removed r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D71231
2020-04-26 20:11:10 +00:00
Jean-Yves Avenard
9301368189 Bug 1607984 - P11. Don't assume the page will be loaded synchronously. r=zombie
We must wait for the iframe created by extension1 to be fully loaded before we can attempt to send a message to it.
So we send a message when it is ready, and suspend the execution until this message is received.

Differential Revision: https://phabricator.services.mozilla.com/D70008
2020-04-24 01:58:23 +00:00
Arthur Iakab
5b06305b9f Backed out 4 changesets (bug 1602832) for causing multiple xpcshell failures.
CLOSED TREE

Backed out changeset a5cc1585581f (bug 1602832)
Backed out changeset 3de4624b41dc (bug 1602832)
Backed out changeset da106d35137e (bug 1602832)
Backed out changeset f9388129262a (bug 1602832)
2020-04-23 16:25:26 +03:00
Kershaw Chang
d0dabdf4c3 Bug 1602832 - P3: Skip failed tests r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D67448
2020-04-23 12:15:16 +00:00
Csoregi Natalia
448f2f3c76 Backed out 16 changesets (bug 1607984) for leaks on browser_ext_webRequest.js. CLOSED TREE
Backed out changeset 6c6ffa908c06 (bug 1607984)
Backed out changeset e973911e67e6 (bug 1607984)
Backed out changeset 28af6418ac16 (bug 1607984)
Backed out changeset 9a15a605f91a (bug 1607984)
Backed out changeset 52566b3564ba (bug 1607984)
Backed out changeset 142148a95181 (bug 1607984)
Backed out changeset 108e2cb6b2a9 (bug 1607984)
Backed out changeset 77fda525ee12 (bug 1607984)
Backed out changeset 980067f3ac1d (bug 1607984)
Backed out changeset 12b82a39c910 (bug 1607984)
Backed out changeset 7657023a763b (bug 1607984)
Backed out changeset 1ab8758802a6 (bug 1607984)
Backed out changeset 35f22d0817e1 (bug 1607984)
Backed out changeset b8c6277207d8 (bug 1607984)
Backed out changeset 244d3cb006be (bug 1607984)
Backed out changeset 9fc1a237829c (bug 1607984)
2020-04-23 11:49:51 +03:00
Jean-Yves Avenard
27ee50e0c8 Bug 1607984 - P11. Don't assume the page will be loaded synchronously. r=zombie
We must wait for the iframe created by extension1 to be fully loaded before we can attempt to send a message to it.
So we send a message when it is ready, and suspend the execution until this message is received.

Differential Revision: https://phabricator.services.mozilla.com/D70008
2020-04-23 00:58:09 +00:00
Andreea Pavel
cac786a35c Backed out 16 changesets (bug 1607984) for multiple test failures e.g test timeouts on a CLOSED TREE
Backed out changeset 4509808243f5 (bug 1607984)
Backed out changeset 0cb21bedf65f (bug 1607984)
Backed out changeset 4e5d89f68293 (bug 1607984)
Backed out changeset 0c0169ed4f04 (bug 1607984)
Backed out changeset ce527a6ffba4 (bug 1607984)
Backed out changeset 63175f596762 (bug 1607984)
Backed out changeset 107be8f3737d (bug 1607984)
Backed out changeset d7600d4d3528 (bug 1607984)
Backed out changeset e11b1b0ecfbf (bug 1607984)
Backed out changeset bed3f6bee79e (bug 1607984)
Backed out changeset abe692da4556 (bug 1607984)
Backed out changeset e02b12515d60 (bug 1607984)
Backed out changeset 7a2ef225a41e (bug 1607984)
Backed out changeset c173bde5106b (bug 1607984)
Backed out changeset dc8b37e10dc7 (bug 1607984)
Backed out changeset 09a651daf344 (bug 1607984)
2020-04-23 03:47:24 +03:00
Jean-Yves Avenard
46e166596d Bug 1607984 - P11. Don't assume the page will be loaded synchronously. r=zombie
We must wait for the iframe created by extension1 to be fully loaded before we can attempt to send a message to it.
So we send a message when it is ready, and suspend the execution until this message is received.

Differential Revision: https://phabricator.services.mozilla.com/D70008
2020-04-15 15:37:11 +00:00
Tomislav Jovanovic
50139dfc2e 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