Граф коммитов

3912 Коммитов

Автор SHA1 Сообщение Дата
Gijs Kruitbosch 387cf24ca0 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 23:50:41 +00:00
Gijs Kruitbosch 9d7452a247 Bug 1810141 - update consumers of CanonicalBrowsingContext.loadURI to use fixup or pass a URI object if they have it, r=mak,webdriver-reviewers,whimboo
Depends on D168389

Differential Revision: https://phabricator.services.mozilla.com/D168390
2023-02-13 23:50:38 +00:00
Cristina Horotan 5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch ff1cc20bd7 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 12:55:26 +00:00
Gijs Kruitbosch e460aa10f3 Bug 1810141 - update consumers of CanonicalBrowsingContext.loadURI to use fixup or pass a URI object if they have it, r=mak,webdriver-reviewers,whimboo
Depends on D168389

Differential Revision: https://phabricator.services.mozilla.com/D168390
2023-02-13 12:55:22 +00:00
John Bieling afa00fe57b Bug 1757142 - Make WebExtension protocol_handler work for Thunderbird. r=kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D167238
2023-02-08 19:54:17 +00:00
Mark Banner 8b2a7a80c7 Bug 1812977 - Remove now unnecessary import-globals-from statements in other directories. r=Gijs,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D168074
2023-01-30 19:33:39 +00:00
Neil Deakin bea47874ab Bug 1809923, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D167953
2023-01-26 16:10:16 +00:00
Neil Deakin 1d2e8169a6 Bug 1808918, use Untitled as the default filename when saving a file rather than index, r=mak
Differential Revision: https://phabricator.services.mozilla.com/D167028
2023-01-23 14:53:21 +00:00
Gijs Kruitbosch 8be066753c Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - other directories - r=Standard8,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D167154
2023-01-19 20:16:43 +00:00
Richard Broker f5765da017 Bug 1777204 - Removed unused PreloaderBase::NotifyValidating() & PreloaderBase::NotifyValidated() methods. r=manuel
Differential Revision: https://phabricator.services.mozilla.com/D166808
2023-01-17 16:13:18 +00:00
Mark Banner f35ab1379d Bug 1808173 - Convert SharedPromptUtils.jsm to an ES module and rename it PromptUtils.sys.mjs. r=Gijs,credential-management-reviewers,dimi
Using shared no longer makes sense, as the non-shared parts in Prompter have been renamed as 'Utils'.

Differential Revision: https://phabricator.services.mozilla.com/D165792
2023-01-16 13:32:19 +00:00
Ben Hearsum 6c520ec6c8 Bug 1805919: disable tests that are currently failing against MSIX packages. r=jmaher,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D165754
2023-01-11 14:45:03 +00:00
Neil Deakin 5192eb2a76 Bug 1802885, improve filename sanitization when filename begins with a period, r=mak
Differential Revision: https://phabricator.services.mozilla.com/D165466
2023-01-10 14:58:04 +00:00
Dave Townsend b752598495 Bug 1792138: Show the extension's name in permission prompts for opening external links. r=ckerschb,robwu,fluent-reviewers,pbz,flod
In order to handle the content script case correctly we must expose the
contentScriptAddonPolicy to JavaScript. With that we can always see what
extension is trying to perform an action and use its name rather than internal
ID in the dialog.

Differential Revision: https://phabricator.services.mozilla.com/D161282
2023-01-07 17:53:19 +00:00
Mark Banner c3e3ee14cc Bug 1806500 - Automatically replace Cu.reportError with console.error (uriloader dom). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D165067
2023-01-05 15:03:55 +00:00
Sylvestre Ledru 1f8d23143a Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D165559
2022-12-28 09:52:44 +00:00
Marian-Vasile Laza 3310c3d69c Backed out changeset 4be804d1c686 (bug 1806500) for causing mochitest failures on test_has_permissions.html. CLOSED TREE 2022-12-20 22:52:57 +02:00
Mark Banner 099830ac94 Bug 1806500 - Automatically replace Cu.reportError with console.error (uriloader dom). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D165067
2022-12-20 18:34:36 +00:00
Sandor Molnar 119b025cf4 Backed out changeset 146a11389a42 (bug 1806500) for causing mochitest failures in dom/console/tests/test_bug659625.html CLOSED TREE 2022-12-20 10:32:26 +02:00
Mark Banner dfc3bdb42a Bug 1806500 - Automatically replace Cu.reportError with console.error (uriloader dom). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D165067
2022-12-20 07:43:44 +00:00
Stanca Serban bd29139bde Backed out changeset 514642d76faa (bug 1792138) for causing mochitests failures in test_ext_protocolHandlers.html. CLOSED TREE 2022-12-13 14:53:38 +02:00
Dave Townsend e021cf6a60 Bug 1792138: Show the extension's name in permission prompts for opening external links. r=ckerschb,robwu,fluent-reviewers,pbz,flod
In order to handle the content script case correctly we must expose the
contentScriptAddonPolicy to JavaScript. With that we can always see what
extension is trying to perform an action and use its name rather than internal
ID in the dialog.

Differential Revision: https://phabricator.services.mozilla.com/D161282
2022-12-13 10:43:32 +00:00
Manuel Bucher 17df5816aa Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 16:15:55 +00:00
Manuel Bucher 01bc307305 Bug 1771867 - Early Hints Phase 2 - Part 6: Pass early hint preload to style preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161176
2022-12-02 16:15:55 +00:00
Manuel Bucher 7681efff11 Bug 1771867 - Early Hints Phase 2 - Part 5: Pass early hint preload to script preloader r=necko-reviewers,valentin
Note that modules can't be specified in Link preloads with `rel=preload`,
only in `rel=modulepreload`.  We currently only support `rel=preload` in
early hints. See Bug 1798319 for updates on module preloads.

Differential Revision: https://phabricator.services.mozilla.com/D161175
2022-12-02 16:15:54 +00:00
Manuel Bucher 817a908c7b Bug 1771867 - Early Hints Phase 2 - Part 4: Pass early hint preload to fetch and font preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161174
2022-12-02 16:15:54 +00:00
Manuel Bucher 2a9cb26225 Bug 1771867 - Early Hints Phase 2 - Part 2: Pass early hint preloads to preloader from IPC r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161173
2022-12-02 16:15:53 +00:00
Csoregi Natalia 5a260d61a4 Backed out 13 changesets (bug 1771867) for causing CanonicalBrowsingContext crashes. CLOSED TREE
Backed out changeset 120838b58449 (bug 1771867)
Backed out changeset aea7ca0bbd17 (bug 1771867)
Backed out changeset 2fe2afdee09d (bug 1771867)
Backed out changeset 8bdb1f682d22 (bug 1771867)
Backed out changeset a9f3158ed688 (bug 1771867)
Backed out changeset 1177913e1edf (bug 1771867)
Backed out changeset d33ccbbf407d (bug 1771867)
Backed out changeset 110ac12e16f5 (bug 1771867)
Backed out changeset 7f20525f5e94 (bug 1771867)
Backed out changeset b3d65b1aa872 (bug 1771867)
Backed out changeset 7cdf3cef2773 (bug 1771867)
Backed out changeset 5090eae24a5c (bug 1771867)
Backed out changeset f8a03d226c73 (bug 1771867)
2022-12-02 13:44:55 +02:00
Manuel Bucher e4a53f90d5 Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 09:45:26 +00:00
Manuel Bucher f155e62e3b Bug 1771867 - Early Hints Phase 2 - Part 6: Pass early hint preload to style preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161176
2022-12-02 09:45:26 +00:00
Manuel Bucher 4ec279d231 Bug 1771867 - Early Hints Phase 2 - Part 5: Pass early hint preload to script preloader r=necko-reviewers,valentin
Note that modules can't be specified in Link preloads with `rel=preload`,
only in `rel=modulepreload`.  We currently only support `rel=preload` in
early hints. See Bug 1798319 for updates on module preloads.

Differential Revision: https://phabricator.services.mozilla.com/D161175
2022-12-02 09:45:25 +00:00
Manuel Bucher 89f0bd5a93 Bug 1771867 - Early Hints Phase 2 - Part 4: Pass early hint preload to fetch and font preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161174
2022-12-02 09:45:25 +00:00
Manuel Bucher 808529a4e4 Bug 1771867 - Early Hints Phase 2 - Part 2: Pass early hint preloads to preloader from IPC r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161173
2022-12-02 09:45:24 +00:00
Nika Layzell 1f06e7ba7b Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-12-01 15:43:19 +00:00
Marian-Vasile Laza 7492025127 Backed out 7 changesets (bug 1793463) for causing bustages on nsIOService.cpp. CLOSED TREE
Backed out changeset 47c3acb30de2 (bug 1793463)
Backed out changeset 71afe900eb17 (bug 1793463)
Backed out changeset d168599a269e (bug 1793463)
Backed out changeset d0f18d300818 (bug 1793463)
Backed out changeset a116e6f089f2 (bug 1793463)
Backed out changeset eba1123c8b56 (bug 1793463)
Backed out changeset 68a3eb8a3057 (bug 1793463)
2022-12-01 02:30:02 +02:00
Nika Layzell 20db36cecb Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-11-30 18:13:43 +00:00
Meg Viar 47d49c4025 Bug 1795894 - Enable triggering Feature Callouts in chrome by content location r=jprickett
Differential Revision: https://phabricator.services.mozilla.com/D160503
2022-11-30 01:47:23 +00:00
Gijs Kruitbosch b0e84f1da8 Bug 1800954 - update mots and moz.build metadata for uriloader folder, r=nika,mak,valentin,zeid
Differential Revision: https://phabricator.services.mozilla.com/D163114
2022-11-30 01:22:01 +00:00
Nika Layzell 399a2f946d Bug 1538028 - Part 3: Validate loads by TriggeringRemoteType, r=smaug,ckerschb
The previous part introduced a new mechanism to track the triggering remote
type for a specific load in a reliable way. This adds some basic checks based
on the triggering remote type to the nsContentSecurityManager, while also
providing the potential infrastructure to expand these checks in the future.

As these checks are performed before some other content security checks (to
ensure that they are performed before InitialSecurityCheckDone() is checked),
they may reject a load which would otherwise have been rejected by a later
check. For this reason, the diagnostic assertions added in this part are only
fired if the check appears as though it would otherwise have succeeded. This
check is not fully accurate, however, so may miss some cases.

This is important, as we have some tests, such as service worker navigation
tests, which will try to load file:/// URIs in content processes, and only fail
in the later content security checks.

For now, no checks are performed for non-document loads, though that may change
in the future.

Differential Revision: https://phabricator.services.mozilla.com/D161199
2022-11-29 20:41:45 +00:00
Nika Layzell 34e62a0d9c Bug 1538028 - Part 2: Track TriggeringRemoteType through nsDocShellLoadState and LoadInfo, r=smaug,ckerschb,necko-reviewers,valentin
This is done using slightly different mechanisms for each of LoadInfo and
nsDocShellLoadState, and will be used in the next part to validate document
loads based on the RemoteType responsible for the load.

For subresource loads, the TriggeringRemoteType is fairly straightforward - it
is the process which created the channel. We can handle this by getting the
current remote type when creating the channel, and then using the remote type
of the sending process when receiving the LoadInfo over IPC to either replace
the triggering remote type, or validate it.

For document loads, the situation is a bit more complex, as there are at least
3 (potentially-)different processes responsible for different parts of the
navigation:

 1. The "Triggering Process" is the process which provided the URI to load.
    This is also the process which provides the Triggering Principal. This is
    the process being tracked in this patch.

 2. The "Loading Process" is the process which actually creates the channel and
    starts the load. This may be the same as the triggering process, or may be
    a different process starting the navigation on behalf of the triggering
    process. In general this is the process hosting the current docshell,
    though it may be the parent process in the case of parent-initiated loads.

 3. The "Final Process" is the process which receives the response and renders
    the final document. This isn't known at channel creation time, and is
    determined by the result principal and process isolation policy.

This change uses a serializer and special field on nsDocShellLoadState to track
the "Triggering Process" for the load, even as the load state is serialized
between processes by tracking which loads were sent into which content
processes, and matching them up when the parent process sees them again. The
information is then copied into the LoadInfo before configuring the real
channel, so it can be used for security checks.

The "Triggering Process" is overridden to be the parent process for history
loads, as history loads are often started in processes which wouldn't normally
be able to navigate to those pages. This is OK thanks to the changes in part 1
which validate history loads against the real session history when SHIP is
enabled.

Differential Revision: https://phabricator.services.mozilla.com/D161198
2022-11-29 20:41:45 +00:00
Butkovits Atila 80588bf3b3 Backed out changeset 8742903f6f19 (bug 1800954) for causing linting failures. CLOSED TREE 2022-11-28 22:17:16 +02:00
Gijs Kruitbosch a8725d77c0 Bug 1800954 - update mots and moz.build metadata for uriloader folder, r=nika,mak,valentin,zeid
Differential Revision: https://phabricator.services.mozilla.com/D163114
2022-11-28 19:48:17 +00:00
Sandor Molnar 77a39e7595 Backed out changeset 28484915dc1b (bug 1795894) for causing mochitest failures. CLOSED TREE 2022-11-28 04:33:07 +02:00
Meg Viar 84f96f4bc4 Bug 1795894 - Enable triggering Feature Callouts in chrome by content location r=jprickett
Differential Revision: https://phabricator.services.mozilla.com/D160503
2022-11-28 00:54:14 +00:00
Barret Rennie 88d50de4b9 Bug 1541508 - Use Services.env in uriloader/ r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D160151
2022-11-25 19:09:12 +00:00
Calixte 705175683e Bug 1754499 - Add pdf.js in GeckoView r=geckoview-reviewers,pdfjs-reviewers,marco,m_kato
Just add the minimal stuff in order to be able to view a pdf in using pdf.js
(whatever the content disposition is).
There are still some things to plug (e.g. find stuff), we must change the UI
and add support for pinch-to-zoom, hence we set the pref pdfjs.disabled to true.

Differential Revision: https://phabricator.services.mozilla.com/D162122
2022-11-24 13:36:17 +00:00
Stanca Serban 3811bf75f5 Backed out changeset 02a9e51358f1 (bug 1792138) for causing mochitests failures on browser_ext_windows_create_url.js. CLOSED TREE 2022-11-17 18:38:00 +02:00
Dave Townsend 1573156d9c Bug 1792138: Show the extension's name in permission prompts for opening external links. r=ckerschb,robwu,fluent-reviewers,pbz,flod
In order to handle the content script case correctly we must expose the
contentScriptAddonPolicy to JavaScript. With that we can always see what
extension is trying to perform an action and use its name rather than internal
ID in the dialog.

Differential Revision: https://phabricator.services.mozilla.com/D161282
2022-11-17 14:44:57 +00:00
Mark Banner a9ec0b8434 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (uriloader/ dom/ docshell/). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161909
2022-11-17 12:00:28 +00:00
Valentin Gosu c05781f028 Bug 1667316 - Pass nsresult status to OnRedirectResult r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140569
2022-11-16 08:49:45 +00:00
Dan Robertson d349734f89 Bug 1771423 - Set Content-Type to an empty string for an blob with no type. r=kershaw,smaug,Gijs
Set the Content-Type to an empty string for an blob when the type was not
given. Ensure that the channel Content-Type is not overriden in the case
that it was previously set and the blob type is not valid.

Differential Revision: https://phabricator.services.mozilla.com/D147481
2022-11-14 15:26:36 +00:00
Neil Deakin 5586066f10 Bug 1796395, remove now unneeded downloads.helpertype telemetry probe, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D161825
2022-11-10 20:44:31 +00:00
Dave Townsend 7239bae84b Bug 1799632: Refactor `testOpenProto` to accept a callback to trigger protocol loads. r=Gijs
Currently this function uses six different booleans to decide which code to run
to trigger the load (many of which are used in just one test) and elsewhere I
need to add more cases. This changes the function to instead take a callback
function so individual tests can just pass their one-off functions. For the
few that are shared global functions are used to share those.

Differential Revision: https://phabricator.services.mozilla.com/D161588
2022-11-08 15:29:49 +00:00
alwu 5704ca1fd2 Bug 1782366 - part2 : mapping audio extension to 'video/mp4' as well. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D157685
2022-11-07 22:43:26 +00:00
Mark Banner a24dca9645 Bug 1798212 - Replace defineModuleGetter in Integration.sys.mjs with a ES version. r=settings-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D161014
2022-11-07 17:56:10 +00:00
Mark Banner 18753bfe42 Bug 1798212 - Convert consumers of downloads code to ES modules. r=mak,geckoview-reviewers,extension-reviewers,settings-reviewers,credential-management-reviewers,sgalich,mconley,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D161013
2022-11-07 17:56:10 +00:00
Mark Banner a9d47c7a8c Bug 1798212 - Convert downloads code to ES modules. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D161012
2022-11-07 17:56:09 +00:00
Shane Caraveo d3e7b16fa3 Bug 1705044 r=freddyb,Gijs,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D154919
2022-11-03 17:00:40 +00:00
Cristian Tuns 4d37cf70f1 Backed out 19 changesets (bug 1541508) for causing xpcshell failures on test_notHeadlessByDefault.js CLOSED TREE
Backed out changeset 08476fa2bc27 (bug 1541508)
Backed out changeset 0bf7514845db (bug 1541508)
Backed out changeset aa612a5e9ef7 (bug 1541508)
Backed out changeset 6bb9360473f7 (bug 1541508)
Backed out changeset b3d8e92f50c2 (bug 1541508)
Backed out changeset fa40dded133e (bug 1541508)
Backed out changeset 2e7db4aa8d4f (bug 1541508)
Backed out changeset 6098e2eb62ea (bug 1541508)
Backed out changeset 2c599ee639c4 (bug 1541508)
Backed out changeset 7d44f6e2644c (bug 1541508)
Backed out changeset c1279c3d674c (bug 1541508)
Backed out changeset 8bd08a62a590 (bug 1541508)
Backed out changeset 740010cb005c (bug 1541508)
Backed out changeset 0bfc7dd85c62 (bug 1541508)
Backed out changeset c4374a351356 (bug 1541508)
Backed out changeset 44ccfeca7364 (bug 1541508)
Backed out changeset e944e706a523 (bug 1541508)
Backed out changeset 2c59d66f43e4 (bug 1541508)
Backed out changeset a1896eacb6f1 (bug 1541508)
2022-11-01 22:38:52 -04:00
Barret Rennie 3250d6ee4d Bug 1541508 - Use Services.env in uriloader/ r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D160151
2022-11-02 02:08:59 +00:00
Daniel Holbert 16170f25a6 Bug 1797840: Replace stray tab characters with spaces in IDL files throughout the tree. r=mccr8,necko-reviewers,credential-management-reviewers,smaug,sgalich,valentin
DONTBUILD because this is just whitespace cleanup.

I found the files to fix up here using this command:
    grep -r '   ' * 2>/dev/null | grep -v "other-licenses" | grep "idl:"

I replaced the tab characters with however many spaces seemed consistent with
the indentation in the surrounding code (and did some minor space-indentation
cleanup in contextual lines to preserve alignment, in a few cases).

Differential Revision: https://phabricator.services.mozilla.com/D160577
2022-10-28 18:08:17 +00:00
Neil Deakin 7c2ed8357f Bug 1791033, avoid crash by computing the extension's byte length correctly and truncate the filename's extension when it is too long, r=gsvelto,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D159703
2022-10-21 09:11:27 +00:00
Cristian Tuns b27c341fe1 Backed out changeset 05f17b2551cb (bug 1791033) for causing xpcshell failures on test_filename_sanitize.js CLOSED TREE 2022-10-20 12:15:38 -04:00
Neil Deakin d174679a36 Bug 1791033, avoid crash by computing the extension's byte length correctly and truncate the filename's extension when it is too long, r=gsvelto,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D159703
2022-10-20 15:37:58 +00:00
Mike Conley 2ce45dc9bd Bug 1795188 - Migrate all uriloader/exthandler JSMs to ESMs. r=kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D159345
2022-10-19 18:34:02 +00:00
Neil Deakin 747ddabbcd Bug 1778597, append valid extensions only when saving a page, r=Gijs,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D159478
2022-10-19 12:50:16 +00:00
Mark Banner 2ffde1e92f Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Eemeli Aro f5267a48fb Bug 1791178 - Use correct identifier for localized downloads forder. r=Gijs
This appears to have been a typo introduced in bug 1737926.

Differential Revision: https://phabricator.services.mozilla.com/D158465
2022-10-12 11:48:19 +00:00
Shane Hughes ad03151040 Bug 1742999 - Make DownloadSpamProtection per-window. r=Gijs,mak
This patch modifies DownloadSpamProtection and DownloadIntegration so
that each window will track blocked spam downloads separately. (Which
shouldn't affect permissions.) When a download is blocked, the helper
app service dispatches a notification, passing the relevant browsing
context and URL to DownloadIntegration. Then it passes the window and
URL to the singleton DownloadSpamProtection. That maps all the windows
to objects that carry the spam download objects. This allows us to only
show blocked spam downloads in the downloads panel of the window from
which they were triggered.

Differential Revision: https://phabricator.services.mozilla.com/D148092
2022-10-04 22:38:18 +00:00
Mark Banner 8d1ebcb9d6 Bug 1792365 - Convert toolkit/modules consumers to use ES module imports directly. r=webdriver-reviewers,perftest-reviewers,geckoview-reviewers,extension-reviewers,preferences-reviewers,desktop-theme-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,robwu,Gijs,sgalich,bytesized,AlexandruIonescu,dao,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D158094
2022-09-29 06:52:34 +00:00
Andrew McCreight 2da84b8ac4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Mathew Hodson a72c385753 Bug 1776578 - Replace init tasks with add_setup in mochitests. r=application-update-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D149486
2022-09-26 13:58:49 +00:00
Dana Keeler 923d7b2029 Bug 1790451 - make nsIChannel.securityInfo concrete as nsITransportSecurityInfo r=kershaw,necko-reviewers,valentin,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D157136
2022-09-20 03:58:49 +00:00
Marco Bonardo 107460db8e Bug 1789500 - filename sanitization may cut surrogate pairs when truncating. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D157516
2022-09-16 09:47:05 +00:00
Nika Layzell 0316dc51b9 Bug 1790614 - Part 2: Use {ASSERT,ENSURE}_NS_{SUCCEEEDED,FAILED} in gtests, r=ahal,necko-reviewers
These macros will produce better outputs when they fail than these existing
patterns using `ENSURE_TRUE(NS_SUCCEEDED(...))` or similar, so this is a bulk
rewrite of existing tests to use them.

It should also help with discoverability when people base their tests off of
other existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D157214
2022-09-15 14:51:50 +00:00
Neil Deakin 2fb144622c Bug 1777207, don't replace extensions of executables when saving on Windows any more; the filename has already been validated and it can cause the filename a user chose to be incorrect, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D156729
2022-09-15 01:26:04 +00:00
Norisz Fay dff4f6d15e Backed out 2 changesets (bug 1771423) for causing webcompat regressions CLOSED TREE
Backed out changeset c1d1be434427 (bug 1771423)
Backed out changeset 2b7d886f374f (bug 1771423)
2022-09-13 16:26:16 +03:00
Kershaw Chang d164608d66 Bug 1760580 - P2: Provide a reason when request is cancelled with NS_BINDING_ABORTED, r=necko-reviewers,media-playback-reviewers,valentin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D156071
2022-09-08 09:11:19 +00:00
Kershaw Chang cc6c147f88 Bug 1760580 - P1: Make nsIRequest support to store canceled reason, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D156070
2022-09-08 09:11:18 +00:00
Masatoshi Kimura e7b3d513d4 Bug 1787633 - Make nsTextToSubURI::UnEscapeNonAsciiURI static. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D156007
2022-09-06 15:59:06 +00:00
Neil Deakin 895b11972d Bug 1772988, add some additional extensions for some media types as Windows doesn't provide some of them, causing valid extensions to be replaced when saving files, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D155972
2022-09-02 15:33:35 +00:00
Paul Zuehlcke cc5eea6b97 Bug 1736688 - Remove telemetry probe: EXTERNAL_PROTOCOL_HANDLER_DIALOG_CONTEXT_SCHEME. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D156213
2022-09-02 10:35:44 +00:00
Butkovits Atila ca18bee08c Backed out changeset 517b6c2b1d57 (bug 1772988) for causing failures at test_filename_sanitize.js . CLOSED TREE 2022-08-30 22:56:49 +03:00
Neil Deakin acdb08b9f4 Bug 1772988, add some additional extensions for some media types as Windows doesn't provide some of them, causing valid extensions to be replaced when saving files, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D155972
2022-08-30 19:23:34 +00:00
Andi-Bogdan Postelnicu eeac3728d2 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 14.0.5 (taskcluster-DydCt-ryTuKvBYw1HQOugw)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D154661
2022-08-16 07:08:27 +00:00
Dan Robertson 27907e8f9a Bug 1771423 - Set Content-Type to an empty string for an empty blob with no type. r=kershaw,smaug,necko-reviewers
Set the Content-Type to an empty string for an blob when the type was not
given. Ensure that the channel Content-Type is not overriden in the case
that it was previously set and the blob type is not valid.

Depends on D147568

Differential Revision: https://phabricator.services.mozilla.com/D147481
2022-08-15 13:52:12 +00:00
Mark Banner 7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Nika Layzell effe5537b9 Bug 1772006 - Part 6: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-07-30 00:12:49 +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
Christian Holler caf94dc5d4 Bug 1780741 - Add init checks to ExternalHelperAppParent. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D152633
2022-07-29 13:47:22 +00:00
Tim Huang daef272528 Bug 1773702 - Adding Content Blocking Event flags for email tracking protection. r=dimi
This patch adds a new Content Blocking Eveent flag and modifies the
current email tracking event flag. This would allow us to log the
loading of email tracker in two levels. The level 1 email tracker
contains the base list of the email trackers, The level 2 email tracker
contains both base and content email trackers.

Differential Revision: https://phabricator.services.mozilla.com/D152679
2022-07-27 20:07:53 +00:00
Neil Deakin 5c6bb2989e Bug 1778429, use utf-16 character literals when calling ReplaceChar in SanitizeFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D152669
2022-07-27 09:34:14 +00:00
Neil Deakin fca5ac1f23 Bug 1779128, rework filename sanitization to ensure that the extension is properly validated, r=Gijs
The existing code doesn't use the sanitized extension part of the filename, when it replaces the filename when it is too long but instead used a version passed to SanitizeFileName. This newer version always gets the extension from the filename after it has been validated.

Some tests have slightly different results, because the file is now cropped slightly differently when the character count and byte count of long filenames don't match, resulting in some filenames being cropped a few extra characters more than needed.

Differential Revision: https://phabricator.services.mozilla.com/D151826
2022-07-26 20:36:04 +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
Emilio Cobos Álvarez 42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Tim Huang 86d982dc94 Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151049
2022-07-18 21:48:15 +00:00
Shane Hughes d5fb4566c2 Bug 1739348 - Don't open downloads panel after download dialogs. r=NeilDeakin
This is a medium sized patch to legacy download construction. It takes
advantage of the new property added in Bug 1762033 to prevent the
downloads panel from being automatically shown when a download is added
after an interaction with the unknown content type dialog or the file
picker dialog. I chose to not do the same for failed transfers since I
thought it might serve some use, but that might be wrong. I don't know
if there's a way to test the dialog that appears when you download an
executable without going through the same path I adjusted with the
patch. It seems like it's covered but I could be wrong. Also add a test
to cover these changes from the bottom up. Thanks and apologies for my
sloppy C++, though I'm sure I'll learn a lot more from the review 😅

Differential Revision: https://phabricator.services.mozilla.com/D145312
2022-07-18 20:45:41 +00:00
smolnar 1888800945 Bug 1767358 - Fix lint failure in uriloader/exthandler/tests/unit/test_handlerService.js r=emilio 2022-07-18 15:52:22 +03:00
Emilio Cobos Álvarez 780d0666b4 Bug 1767358 - Change pref rather than environment in test_handlerService.
MANUAL PUSH: Trivial test fix CLOSED TREE
2022-07-18 14:20:18 +02:00