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

2449 Коммитов

Автор SHA1 Сообщение Дата
Gijs Kruitbosch 3113290039 Bug 1738574 - add an option to put downloads in tmp to start with, r=mak,mkaply,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D146719
2022-05-24 12:54:42 +00:00
Jed Davis a051b1b2bc Bug 1763848 - Use IPC remoting for MIME type information on all platforms. r=haik
The component that handles MIME type information will consult whatever
the OS uses as a registry of file types / applications; in the past
this caused problems for sandboxing on macOS and then Windows, so IPC was
used to remote those queries to the parent process.

We've also been having similar problems on Linux, and none of the
infrastructure here seems to be OS-specific; therefore I've removed the
`#ifdef` so that we always use IPC.

Differential Revision: https://phabricator.services.mozilla.com/D145823
2022-05-20 00:02:45 +00:00
Andrew McCreight c8c5c819df Bug 1514936, part 1 - Remove the outer argument to nsIFactory::createInstance. r=xpcom-reviewers,preferences-reviewers,nika,Gijs
This patch won't actually build, because a few bits of code are used
for both nsIFactory::createInstance and static components, and static
components are not fixed until the next patch.

The first place is nsLoadGroupConstructor, which uses an nsIFactory
macro to create a static component constructor. (This could be worked
around by expanding the macro to the state before this patch.)

The other issue is that nsAppShellConstructor is used in an nsIFactory
on OSX, but as a static component on all other platforms. This could
be worked around by wrapping nsAppShellConstructor in an adaptor that
passes in the extra null argument to nsAppShellConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D146456
2022-05-17 20:24:19 +00:00
Neil Deakin 2d6e577801 Bug 1757771, always launch the save dialog when pressing the PDF Viewer download button, and remove test code that expected the unknown type dialog to appear, r=marco
Differential Revision: https://phabricator.services.mozilla.com/D145814
2022-05-16 14:34:14 +00:00
Kagami Sascha Rosylight 2774c39fc7 Bug 1768189 - Part 47: Apply modernize-concat-nested-namespaces to layout/style/MediaQueryList.h ... r=andi
Depends on D145782

Differential Revision: https://phabricator.services.mozilla.com/D145783
2022-05-09 20:41:21 +00:00
lyavor 9a4a1d18f2 Bug 1749525 - Download fails because it doesn't contain an auth header. r=Gijs,freddyb
Differential Revision: https://phabricator.services.mozilla.com/D137997
2022-05-06 11:56:52 +00:00
Neil Deakin 20f4aa5607 Bug 1746052, on Mac, set the always ask flag for the macbinary type as well, r=Gijs
This test involves clicking on a link to a .bin file. In the Mac test environment, this is given the macbinary content type. This test assumes that it will be octet-stream (another valid content type for the bin extension) and sets the alwaysAskBeforeHandling flag for that, so the dialog never shows up. However, another subtest needs octet-stream to prompt as well, so set the always ask for both.

Differential Revision: https://phabricator.services.mozilla.com/D145547
2022-05-06 10:00:57 +00:00
Neil Deakin 457b4db102 Bug 1746052, add tests for filename validation when dragging images, copy/paste of images, saving a document or image, and when content disposition: attachment is used, and add a unit test that verifies nsIMIMEService.validateFileNameForSaving, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D135959
2022-05-06 10:00:56 +00:00
Neil Deakin ff6532ba51 Bug 1746052, use validateFileNameForSaving to get and validate the default filename when a document or image is chosen to be saved, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135958
2022-05-06 10:00:55 +00:00
Neil Deakin d8b26cb066 Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-06 10:00:55 +00:00
Neil Deakin fd86ee2ff6 Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-06 10:00:55 +00:00
Neil Deakin ea69612638 Bug 1746052, don't modify the extension for text and binary types, as this is the behaviour that save as had, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135955
2022-05-06 10:00:54 +00:00
Neil Deakin 3dd82cbf48 Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-06 10:00:52 +00:00
Neil Deakin 45e161641c Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-06 10:00:52 +00:00
Csoregi Natalia 27daffd9fc Backed out changeset 076c2a81804a (bug 1739348) for xpcshell failures on test_DownloadBlockedTelemetry.js. CLOSED TREE 2022-05-06 12:07:31 +03:00
Shane Hughes 0c6f58f214 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-05-06 08:20:39 +00:00
Noemi Erli 295eab376a Backed out 14 changesets (bug 1746052) for causing build bustages in nsExternalHelperAppService.cpp CLOSED TREE
Backed out changeset bf46b0add531 (bug 1746052)
Backed out changeset 684b2aca10bb (bug 1746052)
Backed out changeset d4796eeeaf64 (bug 1746052)
Backed out changeset 5cf2378f6eb4 (bug 1746052)
Backed out changeset 2055ec1e9a57 (bug 1746052)
Backed out changeset 1398fc0669d2 (bug 1746052)
Backed out changeset 1f979899c843 (bug 1746052)
Backed out changeset 561a24801d4d (bug 1746052)
Backed out changeset 73e4689120f0 (bug 1746052)
Backed out changeset 9891f3b0229b (bug 1746052)
Backed out changeset 4c1ab30de0bd (bug 1746052)
Backed out changeset 108e14122e53 (bug 1746052)
Backed out changeset 1ee59c52578a (bug 1746052)
Backed out changeset 41fe77c5f4b2 (bug 1746052)
2022-05-05 23:13:33 +03:00
Neil Deakin 45169441ca Bug 1746052, on Mac, set the always ask flag for the macbinary type as well, r=Gijs
This test involves clicking on a link to a .bin file. In the Mac test environment, this is given the macbinary content type. This test assumes that it will be octet-stream (another valid content type for the bin extension) and sets the alwaysAskBeforeHandling flag for that, so the dialog never shows up. However, another subtest needs octet-stream to prompt as well, so set the always ask for both.

Differential Revision: https://phabricator.services.mozilla.com/D145547
2022-05-05 19:46:49 +00:00
Neil Deakin af5ca09057 Bug 1746052, add tests for filename validation when dragging images, copy/paste of images, saving a document or image, and when content disposition: attachment is used, and add a unit test that verifies nsIMIMEService.validateFileNameForSaving, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D135959
2022-05-05 19:46:49 +00:00
Neil Deakin 91d7b0f640 Bug 1746052, use validateFileNameForSaving to get and validate the default filename when a document or image is chosen to be saved, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135958
2022-05-05 19:46:48 +00:00
Neil Deakin c1e573cd3c Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-05 19:46:48 +00:00
Neil Deakin 679f61ea4c Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-05 19:46:48 +00:00
Neil Deakin 86c85f8ec9 Bug 1746052, don't modify the extension for text and binary types, as this is the behaviour that save as had, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135955
2022-05-05 19:46:47 +00:00
Neil Deakin 7fdbbc3e3c Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-05 19:46:45 +00:00
Neil Deakin d0aaa88f44 Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-05 19:46:45 +00:00
Jens Stutte 16283839ad Bug 1767214: Make ContentHandlerService::Init return an error on failed initialization. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145573
2022-05-05 12:35:41 +00:00
Csoregi Natalia 7896e7e124 Backed out 13 changesets (bug 1746052) for causing failures on uriloader/exthandler/tests/. CLOSED TREE
Backed out changeset d19cc58e3cab (bug 1746052)
Backed out changeset 229edc158a2b (bug 1746052)
Backed out changeset b0ef7c68abcf (bug 1746052)
Backed out changeset 30de4b77f242 (bug 1746052)
Backed out changeset ebc6720fdab3 (bug 1746052)
Backed out changeset daccb796a093 (bug 1746052)
Backed out changeset 5b76d8d76b2b (bug 1746052)
Backed out changeset a698068d078f (bug 1746052)
Backed out changeset 73d17535d8d1 (bug 1746052)
Backed out changeset 94c95f004221 (bug 1746052)
Backed out changeset 1a389759585a (bug 1746052)
Backed out changeset c91230a8ea90 (bug 1746052)
Backed out changeset 7665f02c114e (bug 1746052)
2022-05-04 01:15:12 +03:00
Mike Hommey 2d6c8fdbc6 Bug 1766561 - Adjust UTF-16 string formatting. r=nika
With MOZ_FORMAT_PRINTF annotations, the compiler expects a wchar_t*, and
it won't automatically consider char16ptr_t to be compatible with that.

While handling strings, there's one case of formatting that doesn't need
to use %S at all.

Differential Revision: https://phabricator.services.mozilla.com/D144919
2022-05-03 20:49:09 +00:00
Neil Deakin 2be09b9192 Bug 1746052, add tests for filename validation when dragging images, copy/paste of images, saving a document or image, and when content disposition: attachment is used, and add a unit test that verifies nsIMIMEService.validateFileNameForSaving, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D135959
2022-05-03 19:44:28 +00:00
Neil Deakin 435f7665b7 Bug 1746052, use validateFileNameForSaving to get and validate the default filename when a document or image is chosen to be saved, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135958
2022-05-03 19:44:28 +00:00
Neil Deakin c203e5ec80 Bug 1746052, don't allow Windows reserved filenames when sanitizing filenames. Move MangleTextToValidFileName to nsLocalFileWin and rename it to CheckForReservedFileName, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D138737
2022-05-03 19:44:27 +00:00
Neil Deakin f560834464 Bug 1746052, select a default filename for saving if the filename ends up being empty, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135957
2022-05-03 19:44:27 +00:00
Neil Deakin 22cf453e67 Bug 1746052, don't modify the extension for text and binary types, as this is the behaviour that save as had, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D135955
2022-05-03 19:44:26 +00:00
Neil Deakin daa3b8b384 Bug 1746052, improve file sanitization by filtering and collpasing more whitespace characters and truncating files to 255 bytes, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D138736
2022-05-03 19:44:25 +00:00
Neil Deakin 2596b808fa Bug 1746052, add methods to the mime service that compute and validate a filename for a given content type, r=Gijs
The code in SanitizeFilename will be expanded upon in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D135951
2022-05-03 19:44:24 +00:00
Neil Deakin 18f85bb221 Bug 1742648, remove special case for downloading pdfs in subframes, r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D145233
2022-05-03 18:13:52 +00:00
Nika Layzell 2cef287b86 Bug 1766682 - Request longer timeout for browser_download_open_with_internal_handler.js, r=Gijs DONTBUILD
The patch appears to have caused an increase in timeouts, but based on a
quick scan of the log, it appears it's due to the test running right
against the time limit, rather than due to the test deadlocking or
similar.

Differential Revision: https://phabricator.services.mozilla.com/D145235
2022-05-03 12:02:31 +00:00
Gijs Kruitbosch e6b256b16b Bug 1755308 - tests, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D138322
2022-04-28 11:08:57 +00:00
Nika Layzell 7664313328 Bug 1756980 - Part 2: Update tests for new download behaviour, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D143676
2022-04-27 15:22:00 +00:00
Sarah Clements 096901dbf5 Bug 1731898 - Change protocol handling logic for non-standard cases r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D141859
2022-04-26 10:01:31 +00:00
Paul Zuehlcke 59a9b4bb03 Bug 1735746 - External protocol navigation sandbox tests. r=nika
Depends on D141133

Differential Revision: https://phabricator.services.mozilla.com/D141134
2022-04-20 11:06:51 +00:00
Paul Zuehlcke 68b4cc3fce Bug 1735746 - Log an error message to the web console for blocked external protocol navigation from sandbox. r=ckerschb
Depends on D141132

Differential Revision: https://phabricator.services.mozilla.com/D141133
2022-04-20 11:06:50 +00:00
Paul Zuehlcke 6f039abdf3 Bug 1735746 - Add a pref and limit external protocol sandbox blocking to Nightly. r=ckerschb,farre
Depends on D141131

Differential Revision: https://phabricator.services.mozilla.com/D141132
2022-04-20 11:06:50 +00:00
Paul Zuehlcke 1e4838aeeb Bug 1735746 - Block external protocol navigation from sandboxed contexts. r=nika,ckerschb,Gijs,smaug
Differential Revision: https://phabricator.services.mozilla.com/D141131
2022-04-20 11:06:50 +00:00
Shane Hughes 7810a6da05 Bug 1747343 - Add pref to set default action for new mimetypes. r=Gijs,fluent-reviewers,preferences-reviewers
When downloading a file, we check for existing mime types and construct
a new one if it's unrecognized. Mime types have a flag,
alwaysAskBeforeHandling, that determines whether the unknown content
type dialog should be opened before handling the file. Before bug
1733492, the default value for that flag was simply true. Since the new
downloads flow is intended to avoid unnecessary steps, the default value
was changed to the inverted value of the new downloads panel
improvements pref. This patch adds a new pref that the mime info
constructor will read in configuring the flag's value. If the
improvements pref is not enabled, then the flag will be true, so the UCT
dialog will open. If the improvements pref is enabled, then it'll use
the value of the new pref. Also add a an interface for the pref to the
about:preferences UI, and automatically migrate a false value for
browser.download.improvements_to_download_panel to a true value for this
pref. I'm updating some tangentially related test files since they
happen to be touched slightly by this change. Strictly speaking they
would still work, but if the pref value was somehow changed from the
default they would fail.

Differential Revision: https://phabricator.services.mozilla.com/D143002
2022-04-15 18:13:11 +00:00
Iulian Moraru 6c1743090b Backed out changeset 661c496ff0bd (bug 1731898) for causing bc failures on browser_first_prompt_not_blocked_without_user_interaction.js. CLOSED TREE 2022-04-13 21:54:28 +03:00
Sarah Clements a63dfc84ab Bug 1731898 - Change protocol handling logic for non-standard cases r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D141859
2022-04-13 17:13:50 +00:00
Butkovits Atila f90c8918d4 Backed out changeset 543a78ca4fa9 (bug 1747343) for causing mochitest failures at browser_bug676619.js. CLOSED TREE 2022-04-13 03:31:53 +03:00
Shane Hughes 9a0bc90754 Bug 1747343 - Add pref to set default action for new mimetypes. r=Gijs,fluent-reviewers,preferences-reviewers
When downloading a file, we check for existing mime types and construct
a new one if it's unrecognized. Mime types have a flag,
alwaysAskBeforeHandling, that determines whether the unknown content
type dialog should be opened before handling the file. Before bug
1733492, the default value for that flag was simply true. Since the new
downloads flow is intended to avoid unnecessary steps, the default value
was changed to the inverted value of the new downloads panel
improvements pref. This patch adds a new pref that the mime info
constructor will read in configuring the flag's value. If the
improvements pref is not enabled, then the flag will be true, so the UCT
dialog will open. If the improvements pref is enabled, then it'll use
the value of the new pref. Also add a an interface for the pref to the
about:preferences UI, and automatically migrate a false value for
browser.download.improvements_to_download_panel to a true value for this
pref. I'm updating some tangentially related test files since they
happen to be touched slightly by this change. Strictly speaking they
would still work, but if the pref value was somehow changed from the
default they would fail.

Differential Revision: https://phabricator.services.mozilla.com/D143002
2022-04-12 22:32:45 +00:00
Jan Rio Krause 057785b6d5 Bug 1519200 - Remove `NS_ERROR_FILE_TARGET_DOES_NOT_EXIST` in favor of `NS_ERROR_FILE_NOT_FOUND`. r=xpcom-reviewers,nika,dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D77575
2022-04-05 15:17:03 +00:00