Commit graph

5340 commits

Author SHA1 Message Date
Rob Wu
3494ccd426 Bug 1745762 - Add registration of DNR session rules r=rpl
This patch offers the Rule type and updateSessionRules and
getSessionRules to register rules. The actual evaluation of rules and
most of the associated validation is not part of this patch.

Differential Revision: https://phabricator.services.mozilla.com/D154801
2022-08-22 20:44:26 +00:00
Nika Layzell
4011409c5d Bug 1783282 - Use a custom attribute instead of derive for implementing xpcom interfaces in rust, r=xpcom-reviewers,necko-reviewers,dragana,barret
Differential Revision: https://phabricator.services.mozilla.com/D153801
2022-08-18 13:57:35 +00:00
Sylvestre Ledru
128c74caac Bug 1785451 - Ride along: Fix some typos r=linter-reviewers,fluent-reviewers,geckoview-reviewers,extension-reviewers,keeler,rpl,calu,ahal,flod DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D154946
2022-08-18 07:29:08 +00:00
Rob Wu
6ef49bb11b Bug 1783828 - Re-enable test_ext_permission_warnings.js in condprof r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D154807
2022-08-16 23:50:30 +00:00
Rob Wu
a4f8ce604c Bug 1782816 - Introduce test.assertDeepEq r=rpl,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D153531
2022-08-16 20:06:37 +00:00
Tomislav Jovanovic
641991c1f2 Bug 1774642 - Automatic activeTab for ungranted host permissions with origin controls, r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D154107
2022-08-16 13:09:04 +00:00
William Durand
efd406d7c1 Bug 1784254 - Make page_action and hidden mutually exclusive. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D154387
2022-08-16 06:59:46 +00:00
Mark Banner
cd24cf259e Bug 1784699 - Turn off the ESLint browser environment for xpcshell-tests for better represetation of the globals actually available. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D154606
2022-08-15 16:50:33 +00:00
Dão Gottwald
fa2c674da8 Bug 1783868 - Stop reducing the opacity of findbar labels. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D154373
2022-08-11 11:29:25 +00:00
Andrew McCreight
dbc0dcf10f Bug 1763197 - Disable test_ext_userScripts_register.js without Fission. r=rpl
This test seems to fail frequently on Linux without Fission, and on Android,
when the parent controlled navigation pref is enabled, so disable the test
there. We don't really support non-Fission builds anyways, and apparently
containers aren't supported on Android.

Differential Revision: https://phabricator.services.mozilla.com/D154288
2022-08-10 19:38:16 +00:00
Rob Wu
f9cec0891a Bug 1780747 - Restrict DNR permissions to MV3 for now r=rpl
Restrict the DNR permissions to MV3 to allow the add-ons linter to
easily flag the use of the not-yet-supported DNR permission, until
we do actually enable the feature.

Since the full DNR namespace is gated on this permission, this
effectively means that in order to use the API, not only the
extensions.dnr.enabled pref needs to be set, but also the
extensions.manifestV3.enabled pref + using manifest_version: 3..

Differential Revision: https://phabricator.services.mozilla.com/D153458
2022-08-09 12:16:34 +00:00
Rob Wu
7e7534ced4 Bug 1780747 - Register DNR schema and permissions r=rpl,geckoview-reviewers,owlish,flod
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.

Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).

Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).

Differential Revision: https://phabricator.services.mozilla.com/D152503
2022-08-09 12:16:34 +00:00
Cristian Tuns
a96814126e Backed out 2 changesets (bug 1780747) for causing xpcshell failures on test_ext_permission_warnings.js CLOSED TREE
Backed out changeset be950e847c33 (bug 1780747)
Backed out changeset b07c7315a02a (bug 1780747)
2022-08-08 19:04:56 -04:00
Rob Wu
7832030f4f Bug 1780747 - Restrict DNR permissions to MV3 for now r=rpl
Restrict the DNR permissions to MV3 to allow the add-ons linter to
easily flag the use of the not-yet-supported DNR permission, until
we do actually enable the feature.

Since the full DNR namespace is gated on this permission, this
effectively means that in order to use the API, not only the
extensions.dnr.enabled pref needs to be set, but also the
extensions.manifestV3.enabled pref + using manifest_version: 3..

Differential Revision: https://phabricator.services.mozilla.com/D153458
2022-08-08 22:11:08 +00:00
Rob Wu
f8ed240ae5 Bug 1780747 - Register DNR schema and permissions r=rpl,geckoview-reviewers,owlish,flod
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.

Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).

Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).

Differential Revision: https://phabricator.services.mozilla.com/D152503
2022-08-08 22:11:08 +00:00
William Durand
194e762e3c Bug 1781998 - Make hidden and browser_action or action mutually exclusive. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D153924
2022-08-08 17:09:39 +00:00
Shane Caraveo
6757ad1a76 Bug 1783442 Fix cases where case sensitivy matters in WebExtensionPolicy r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D153867
2022-08-08 15:39:37 +00:00
Shane Caraveo
0d48ba1fc6 Bug 1773115 fix extension global matching for web accessible resources r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D153865
2022-08-08 15:39:36 +00:00
Tomislav Jovanovic
bc80bc678e Bug 1781801 - Make activeTab target sameOriginWithTop iframes in MV3 r=willdurand
Differential Revision: https://phabricator.services.mozilla.com/D153766
2022-08-08 13:34:10 +00:00
Gerald Squelart
6cd5fee5d2 Bug 1571089 - Remove the "leaf" profiler feature - r=canaltinova
We currently support stack walking everywhere, and when it fails, we fall back
to leaf stacks. The leaf option is a bit confusing in how it works, and doesn't
provide much value.

Differential Revision: https://phabricator.services.mozilla.com/D153695
2022-08-08 12:29:43 +00:00
Shane Caraveo
3978bd8144 Bug 1783078 require web_accessible_resources for any extension loads from a content script r=robwu,ckerschb
Enforce requiring web accessible resources in MV3 and use a pref to turn on later for MV2.

Differential Revision: https://phabricator.services.mozilla.com/D153677
2022-08-05 04:36:30 +00:00
Andrew McCreight
d7eb5873a8 Bug 1780488 - Fix the race in test_ext_userScripts_register.js. r=rpl
This adds a content script that sends a test message that runs
after the user scripts to ensure that the user scripts have
finished running. Otherwise, we can end up checking the value
of textContent before the script runs. This happens frequently
with both Fission enabled and with parent-controlled navigation.
This has to be done in a content script because sendMessage is
not available in a user script.

Based on the test name and the comments that added this test,
it should have been testing userScripts.register instead of
contentScripts.register, so I fixed that.

I also fixed a few references in text to contentScript.register
that should be contentScripts.register.

Differential Revision: https://phabricator.services.mozilla.com/D153293
2022-08-04 22:12:28 +00:00
William Durand
f1509d8749 Bug 1751436 - Add support for persistAcrossSessions in scripting.RegisteredContentScript. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D147671
2022-08-04 09:09:07 +00:00
William Durand
cc81b4c5ef Bug 1769241 - Skip test when fission is enabled, and run it sequentially. r=rpl
See also: Bug 1762638

Differential Revision: https://phabricator.services.mozilla.com/D153646
2022-08-03 20:11:46 +00:00
Shane Caraveo
bc481f252f Bug 1773115 ensure extension access to its own web accessible resources r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D150498
2022-08-02 17:08:59 +00:00
Shane Caraveo
d08731448a Bug 1711168 allow extension pages to be loaded as top level tabs by other extensions r=rpl,geckoview-reviewers,calu
Ensure extensions can manage tabs and sessions that include tabs from other extensions.  The parent
patch to this introduces cross-extension access validation.  However that breaks this specific use case
that we need to continue supporting.  This patch modifies three extension apis, tab.create/update and
windows.create to allow the creation of extension tabs which cannot be otherwise accessed.

Differential Revision: https://phabricator.services.mozilla.com/D151766
2022-08-02 17:08:58 +00:00
Shane Caraveo
f1212fb1db Bug 1711168 support extension matching in webAccessibleResources r=zombie,smaug,rpl
Differential Revision: https://phabricator.services.mozilla.com/D115114
2022-08-02 17:08:58 +00:00
William Durand
63254ba67d Bug 1782702 - Update header files (and template) to have the private members at the end of the class definition. r=rpl
I also moved a few protected members and re-ordered the sections to have public, protected, private.

Differential Revision: https://phabricator.services.mozilla.com/D153467
2022-08-02 16:07:43 +00:00
William Durand
d1b8a8c1d5 Bug 1748315 - Part 3 - Generate WebIDL bindings for the scripting namespace. r=rpl,webidl,smaug
This patch adds WebIDL bindings for the `scripting` namespace.
Note that `scripting.executeScript()` is excluded for now.

Differential Revision: https://phabricator.services.mozilla.com/D141463
2022-08-02 14:22:39 +00:00
William Durand
1b18a3e794 Bug 1748315 - Part 2 - Pass context.childManager to Schemas.checkParameters(). r=rpl
This is required to load and validate JSON schemas that use formatters like `relativeUrl`.

Depends on D141750

Differential Revision: https://phabricator.services.mozilla.com/D141751
2022-08-01 15:02:21 +00:00
William Durand
169da550db Bug 1748315 - Part 1 - Propagate json schema validation errors to the extension. r=rpl
Depends on #D141749

Differential Revision: https://phabricator.services.mozilla.com/D141750
2022-08-01 06:31:55 +00:00
William Durand
c36a760e3b Bug 1748315 - Part 0 - Slightly improve GenerateWebIDLBindings.py UI. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D141749
2022-08-01 06:31:55 +00:00
Joel Maher
bf4b875752 Bug 1781782 - Run frequent xpcshell parallel failing tests sequential by default. r=ahal,necko-reviewers,extension-reviewers,application-update-reviewers,bytesized,rpl,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D153081
2022-07-30 01:33:28 +00:00
Nika Layzell
c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
Butkovits Atila
ae6f4c94fc Backed out 3 changesets (bug 1711168, bug 1773115) for causing failures at test_ext_web_accessible_resources.html. CLOSED TREE
Backed out changeset 703c909eb009 (bug 1773115)
Backed out changeset 902385a7ce60 (bug 1711168)
Backed out changeset 3d061ce03de7 (bug 1711168)
2022-07-27 00:13:26 +03:00
Shane Caraveo
8d60992fa4 Bug 1773115 ensure extension access to its own web accessible resources r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D150498
2022-07-26 19:39:15 +00:00
Shane Caraveo
eff848ce19 Bug 1711168 allow extension pages to be loaded as top level tabs by other extensions r=rpl
Ensure extensions can manage tabs and sessions that include tabs from other extensions.  The parent
patch to this introduces cross-extension access validation.  However that breaks this specific use case
that we need to continue supporting.  This patch modifies three extension apis, tab.create/update and
windows.create to allow the creation of extension tabs which cannot be otherwise accessed.

Differential Revision: https://phabricator.services.mozilla.com/D151766
2022-07-26 19:39:14 +00:00
Shane Caraveo
a73cd6df49 Bug 1711168 support extension matching in webAccessibleResources r=zombie,smaug,rpl
Differential Revision: https://phabricator.services.mozilla.com/D115114
2022-07-26 19:39:14 +00:00
Mark Banner
8a275d4d92 Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-26 15:11:30 +00:00
Tom Schuster
b2b0bdeec1 Bug 830716 - Show class-name of object that failed to be cloned. r=smaug
This has one small wrinkle that I might fix in the future: DOM classes that are proxies
like window show up as "Proxy".

Differential Revision: https://phabricator.services.mozilla.com/D152566
2022-07-26 08:19:40 +00:00
Tooru Fujisawa
a032f53a63 Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152430
2022-07-26 02:46:30 +00:00
Tooru Fujisawa
4e35a2bf9c Bug 1780543 - Part 3: Add mozilla/process-script environment as alias to frame-script. r=Standard8,perftest-reviewers,webcompat-reviewers,necko-reviewers,twisniewski,sparky,dragana
Differential Revision: https://phabricator.services.mozilla.com/D152428
2022-07-26 02:46:29 +00:00
Tooru Fujisawa
a6aabba5a4 Bug 1780543 - Part 1: Use eslint-env mozilla/frame-script consistently in frame script. r=Standard8,webdriver-reviewers,geckoview-reviewers,jdescottes,calu
Differential Revision: https://phabricator.services.mozilla.com/D152426
2022-07-26 02:46:28 +00:00
smolnar
dc4f2d6a41 Backed out 5 changesets (bug 1780017, bug 1780347) for causing bc failures in browser/base/content/test/performance/browser_preferences_usage.js CLOSED TREE
Backed out changeset 86c3a9142535 (bug 1780347)
Backed out changeset 35abe35417a0 (bug 1780017)
Backed out changeset f448f044f028 (bug 1780017)
Backed out changeset a400cbe83084 (bug 1780017)
Backed out changeset 0a23c9e27f01 (bug 1780017)
2022-07-25 21:00:07 +03:00
Mark Banner
539b5dac0d Bug 1780017 - Migrate urlbar consumers to use ESM imports directly. r=adw,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152057
2022-07-25 12:46:48 +00:00
Luca Greco
74e01e908e Bug 1780229 - Prevent test_ext_native_messaging.js intermittent failures. r=mixedpuppy
This patch includes the following tweaks to the new test cases as introduced from Bug 1770696:

- Added an explicit `await waitForSubprocessExit();` to the two new test cases which are starting
  a NativeApplication as part of the test case, to make sure to wait for the subprocess to have
  been fully exited, otherwise that triggers a failure on windows 10 because the files that should
  be removed when the test task is exiting would still be in use (and trying to remove them fails
  only on the windows platform)

- Reworked the NativeApp used by the testSendNativeMessage test task to don't wrongly assume the
  NativeApp handling all the messages sent to be the same one even if one is still running to
  handle a delayed message pending a reply:
  - Each sendNativeMessage call will be spawning its own NativeApp instance and so the test native
    app is now resorting to a `time.sleep(...)` call to delay replying to any message received,
    to give some time for the test case to cover the behavior expected while a native message is
    still pending a reply.
  - Added Some stderr logs to the NativeApp, to make it easier to see at which point of
    the test case the NativeApp is being started, replying to a message and terminated, along
    with including the process pid to more easily determine if the NativeApp instance is still
    the one we expect to be running and replying to the native messages received.

Differential Revision: https://phabricator.services.mozilla.com/D152292
2022-07-22 08:10:25 +00:00
Andrew McCreight
62e7eb6225 Bug 1780576 - Clean up test_ext_userScripts_register.js on failure. r=extension-reviewers,mixedpuppy
equal throws immediately, so if it fails you get some follow-on
failures because the test didn't clean up that make it confusing
to figure out what actually failed. This patch fixes that by using
registerCleanupFunction to remove the extension, and waits to
do the check until after contentPage has been closed.

Differential Revision: https://phabricator.services.mozilla.com/D152419
2022-07-21 17:55:45 +00:00
William Durand
dc4e14088f Bug 1756758 - Add support for restrictSchemes in registerContentScripts() (MV2). r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D147654
2022-07-21 08:08:55 +00:00
Mark Banner
4bfafd41fa Bug 1779982 - Migrate places consumers to use ESM imports directly. r=mak,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152005
2022-07-20 22:34:21 +00:00
smolnar
102b779608 Backed out 8 changesets (bug 1779982, bug 1780017, bug 1780347) for causing doc generate failures. CLOSED TREE
Backed out changeset 3f22c0f99cf1 (bug 1780347)
Backed out changeset 6f20b7e4b21b (bug 1780017)
Backed out changeset ae6062c69aeb (bug 1780017)
Backed out changeset e668d7778d97 (bug 1780017)
Backed out changeset e158fc41594b (bug 1780017)
Backed out changeset d4c69c956271 (bug 1779982)
Backed out changeset 145212fd826d (bug 1779982)
Backed out changeset 54079aaa1857 (bug 1779982)
2022-07-20 22:43:53 +03:00