Commit Graph

160 Commits

Author SHA1 Message Date
Tooru Fujisawa
6d6e149534 Bug 1772101 - Part 30: Use plain object for lazy getter in toolkit/components/pdfjs/. r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D147971
2022-06-07 04:31:01 +00:00
Tooru Fujisawa
b5e1e2bcbe Bug 1772101 - Part 29: Use plain object for lazy getter in toolkit/components/pdfjs/content/. r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D147970
2022-06-07 04:31:01 +00:00
Neil Deakin
6e3e942a21 Bug 1761265, don't show the downloads panel when a download was started by user action that they expect will save the file, r=mhowell,necko-reviewers,kershaw
The download panel should still appear when clicking on download links or those with content-disposition: attachment

Differential Revision: https://phabricator.services.mozilla.com/D147875
2022-06-06 22:23:58 +00:00
Neil Deakin
f9ab48956f Bug 1762868, handle pdfs inline that use the content type octet-stream when they have a pdf extension, r=mhowell
To do this we look at the extension on the content disposition filename, if present, or the extension
of the url, and, if it is .pdf, we assume that the file will be a pdf.

Differential Revision: https://phabricator.services.mozilla.com/D147409
2022-06-06 18:58:19 +00:00
Tooru Fujisawa
ebcb6dfd9c Bug 1772360 - Remove unnecessary call for XPCOMUtils.defineLazyGlobalGetters. r=florian,webdriver-reviewers,webcompat-reviewers,denschub,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148168
2022-06-06 04:42:10 +00:00
Molnar Sandor
4c2b06df41 Backed out 15 changesets (bug 1772313, bug 1772351, bug 1772360) for causing xpc failures in telemetry/tests/unit/test_SocketScalars.js CLOSED TREE
Backed out changeset c8b0a2ed239e (bug 1772360)
Backed out changeset 1922adad6abe (bug 1772351)
Backed out changeset 6d3634cce489 (bug 1772351)
Backed out changeset f03968a9d053 (bug 1772351)
Backed out changeset e7a38ef90fe4 (bug 1772351)
Backed out changeset b389e7654771 (bug 1772313)
Backed out changeset 59a33598ff51 (bug 1772313)
Backed out changeset ab60885a8a93 (bug 1772313)
Backed out changeset aad8efac9d05 (bug 1772313)
Backed out changeset 4378e519a8e7 (bug 1772313)
Backed out changeset 302ac54741f8 (bug 1772313)
Backed out changeset 74c59f9fd51c (bug 1772313)
Backed out changeset 575fb877c56c (bug 1772313)
Backed out changeset 2eaa68f10b19 (bug 1772313)
Backed out changeset 4a8b3ba193dc (bug 1772313)
2022-06-06 07:04:25 +03:00
Tooru Fujisawa
81758ebac5 Bug 1772360 - Remove unnecessary call for XPCOMUtils.defineLazyGlobalGetters. r=florian,webdriver-reviewers,webcompat-reviewers,denschub,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148168
2022-06-06 02:49:14 +00:00
Updatebot
30bc747daf Bug 1772598 - Update PDF.js to 19539676813b5df6ca4726a1bfa6765193b1067c r=pdfjs-reviewers,Snuffleupagus
Differential Revision: https://phabricator.services.mozilla.com/D148307
2022-06-05 18:44:01 +00:00
Calixte
9eafb7c7a0 Bug 1766030 - Add an optional source URL when saving an URL. r=Gijs
In pdf.js, files are saved thanks to a blob but the original URL is lost.
Consequently, the download panel doesn't contain any information about the
origins of a saved pdf.
The saveURL, internalSave and nsITransfer.init functions has now a parameter for this originalURL.

Differential Revision: https://phabricator.services.mozilla.com/D147651
2022-05-31 17:25:29 +00:00
Tom Ritter
ad7c8fe379 Bug 1770895: Switch to pdfjs-reviewers and set the blocking bug r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D147215
2022-05-31 15:43:38 +00:00
Tom Ritter
6c6360aa26 Bug 1770983: Fix the pdfjs frequency and assignee r=jewilde
Differential Revision: https://phabricator.services.mozilla.com/D147206
2022-05-24 16:47:35 +00:00
Tom Ritter
5e062e739e Bug 1731594: Add an update task for pdf.js r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D142367
2022-05-23 20:13:25 +00:00
Neil Deakin
22c92b2131 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
Calixte
50ac65fe36 Bug 1768821 - Update pdf.js to version 2.14.290 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D146057
2022-05-11 11:50:06 +00:00
Nika Layzell
22da0176b0 Bug 1767321 - Preserve content-disposition filename through cross-process redirects, r=smaug,Gijs
The relevant information was already being set on the final channel when
not performing a process switch [1], but it was not copied for
cross-process redirects, despite being sent to the child process. This
wasn't a problem previously, as we would handle downloads in the parent
process, but with the download panel improvements, it is an issue.

This issue led to the wrong filename being selected by default when
clicking on the save icon in a downloaded PDF from a blob URL, as the
information was lost before being passed to the pdf.js stream filter.

[1]: https://searchfox.org/mozilla-central/rev/87ecd21d3ca517f8d90e49b32bf042a754ed8f18/netwerk/ipc/DocumentChannelChild.cpp#308-315

Differential Revision: https://phabricator.services.mozilla.com/D145255
2022-05-03 15:02:12 +00:00
Calixte
4356c3f7ec Bug 1766222 - Update pdf.js to version 2.14.224 r=pdfjs-reviewers,robwu
Differential Revision: https://phabricator.services.mozilla.com/D144544
2022-04-25 19:44:06 +00:00
Cristian Tuns
df55173f82 Backed out changeset 2f832cfab538 (bug 1766222) for causing mochitest failures in browser_all_files_referenced.js CLOSED TREE 2022-04-25 14:40:26 -04:00
Calixte
40380981b2 Bug 1766222 - Update pdf.js to version 2.14.224 r=pdfjs-reviewers,robwu
Differential Revision: https://phabricator.services.mozilla.com/D144544
2022-04-25 17:35:02 +00:00
Shane Hughes
0604bb580c 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
Calixte
098ac875cb Bug 1764886 - Update pdf.js to version 2.14.171 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D143819
2022-04-15 14:39:47 +00:00
criss
99ab290c14 Backed out changeset a1e9e031f3a1 (bug 1764886) for causing failures on browser_parsable_script.js . CLOSED TREE 2022-04-15 16:57:08 +03:00
Calixte
787c2e38ec Bug 1764886 - Update pdf.js to version 2.14.171 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D143819
2022-04-15 12:50:55 +00:00
Gijs Kruitbosch
edda40141b Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 16:16:42 +00:00
Norisz Fay
e1d7571cc8 Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch
1214ac636b Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 08:18:51 +00:00
Calixte
c05a2729b8 Bug 1761323 - Update pdf.js to version 2.14.102 r=pdfjs-reviewers,bdahl
Differential Revision: https://phabricator.services.mozilla.com/D141984
2022-03-24 18:17:23 +00:00
Jonas Jenwald
03aaad9856 Bug 1757527 - Slightly reduce (repeated) message passing overhead when localizing the PDF Viewer. r=pdfjs-reviewers,calixte,bdahl
Currently there's a fair bit of unneeded overhead when localizing the PDF Viewer, since *every single* string requires a round-trip from the `viewer.js` file to the `PdfStreamConverter.jsm` file.
This despite the fact that the relevant `viewer.properties` file is read *only once*, and its result is then cached, see https://searchfox.org/mozilla-central/rev/8f42809e51cb07aa4f5739932a06d14581e9dd4a/toolkit/components/pdfjs/content/PdfStreamConverter.jsm#470-473

Hence we can improve things here by instead sending the *entire* localization data at once when it's first requested, and also cache it in the viewer, to reduce completely unneeded message passing overhead caused by localizing the PDF Viewer.

To put these changes into perspective, let's look at what happens when loading the PDF Specification; i.e. https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
When loading that document we first of all need to localize the viewer UI, however the initialization/rendering of the PDF Document itself also causes some l10n-string lookups. All-in-all, simply loading the above PDF document in Firefox currently results in just over `3900` l10n-strings being fetched (with most of them being duplicates).
Furthermore, all these l10n-string lookups also have a measurable performance impact on the viewer UI localization. Using some, admittedly crude, benchmarking with `console.time/timeEnd` around the viewer UI localization code in https://searchfox.org/mozilla-central/rev/8f42809e51cb07aa4f5739932a06d14581e9dd4a/toolkit/components/pdfjs/content/web/viewer.js#484-485 gives the following results (using the best observed values, with `privacy.reduceTimerPrecision = false` set):

 - With the current code, the viewer UI localization takes around `12-13` ms.

 - With this patch, the viewer UI localization takes around `4-5` ms.

While these improvements are obviously not huge, they thus cannot hurt as far as I'm concerned.

(Assuming this is accepted, I'll obviously follow-up with the relevant `web/viewer.js` patch at GitHub. However, these changes must be synchronized in the both the viewer/integration code.)

Differential Revision: https://phabricator.services.mozilla.com/D139928
2022-03-11 01:24:05 +00:00
Brendan Dahl
efc2367f25 Bug 1757825 - Update pdf.js to version 2.14.13 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D140107
2022-03-02 22:41:56 +00:00
Cristian Tuns
984cce335f Backed out changeset 3978f169f641 (bug 1752149) for causing mochitest failures browser_download_open_with_internal_handler.js CLOSED TREE. 2022-03-01 13:15:07 -05:00
Marco Castelluccio
49f0e1a94f Bug 1752149 - Always launch the save dialog when pressing the PDF Viewer download button. r=pdfjs-reviewers,Gijs,bdahl
Independently from the value of the browser.download.improvements_to_download_panel pref.

Differential Revision: https://phabricator.services.mozilla.com/D138607
2022-03-01 16:45:35 +00:00
Brendan Dahl
61db54bf21 Bug 1756928 - Update pdf.js to version 2.13.189 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D139564
2022-02-24 16:09:29 +00:00
Calixte
33d9dfd234 Bug 1753509 - Add support for search with or without diacritics in the pdf viewer r=pdfjs-reviewers,bdahl
Differential Revision: https://phabricator.services.mozilla.com/D137796
2022-02-11 16:28:19 +00:00
Brendan Dahl
16c4e781ee Bug 1754585 - Update pdf.js to version 2.13.133 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D138359
2022-02-10 16:28:09 +00:00
Brendan Dahl
f0c0b29353 Bug 1752574 - Update pdf.js to version 2.13.93 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D137301
2022-01-29 23:53:08 +00:00
Brendan Dahl
78c17ebda9 Bug 1748701 - Update pdf.js to version 2.13.24 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D135177
2022-01-06 15:21:58 +00:00
Brendan Dahl
caf3905d2c Bug 1743838 - Update pdf.js to version 2.12.248 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D132586
2021-12-02 23:04:11 +00:00
Sam Foster
a0a77588ff Bug 1740135 - Treat download button like save action to avoid opening on completion. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D131945
2021-11-29 20:07:57 +00:00
Neil Deakin
e3859c48bb Bug 1719892, when pdfs are set to open internally, open downloads or responses marked as content-disposition: attachment directly using the pdf viewer instead of downloading them locally first, r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D131004
2021-11-23 14:56:17 +00:00
Neil Deakin
cb9e7f78f9 Bug 1736864, add extra telemetry flag to indicate if the pdf viewer is opening an attachment, r=Gijs
Note that this doesn't ever trigger currently as pdf files loaded as attachments always get downloaded go through the external helper service

Differential Revision: https://phabricator.services.mozilla.com/D130098
2021-11-10 18:52:24 +00:00
Brendan Dahl
380e4fb697 Bug 1739229 - Update pdf.js to version 2.12.126 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D130308
2021-11-03 22:18:53 +00:00
Brendan Dahl
1db2253640 Bug 1737299 - Update pdf.js to version 2.12.69 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D129280
2021-10-22 17:19:07 +00:00
Emilio Cobos Álvarez
2119007c36 Bug 1736038 - Remove -moz-toolbar-prefers-color-scheme. r=dao
By making prefers-color-scheme return the ColorSchemeForChrome(), which
accounts for the Firefox theme.

Differential Revision: https://phabricator.services.mozilla.com/D128611
2021-10-15 16:53:08 +00:00
Brendan Dahl
23d0fe3081 Bug 1735409 - Update pdf.js to version 2.12.16 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D128291
2021-10-12 23:49:41 +00:00
Sam Foster
eeccc11c0b Bug 1724319 - Fix pdfjs component tests for when new download changes are enabled. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D127009
2021-09-30 22:35:15 +00:00
Mike Kaply
41c6fa3ae0 Bug 1728286 - Fix typo - clearIntPref to clearUserPref. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D126713
2021-09-27 23:59:06 +00:00
Brendan Dahl
0bdf7abbc8 Bug 1732395 - Update pdf.js to version 2.11.298 r=pdfjs-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D126554
2021-09-24 00:02:03 +00:00
Brendan Dahl
11d022c59d Bug 1732117 - Update pdf.js to version 2.11.283 r=pdfjs-reviewers,calixte
Differential Revision: https://phabricator.services.mozilla.com/D126363
2021-09-22 20:23:13 +00:00
Neil Deakin
6b3580b4b6 Bug 1690390, change appendNotification to take a smaller number of arguments: the string type value, a dictionary containing the notification details, and the button list, r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D107755
2021-09-17 09:04:59 +00:00
Narcis Beleuzu
c25133b5dc Backed out 3 changesets (bug 1690390) for mochitest failures on test_notificationbox.xhtml . CLOSED TREE
Backed out changeset e6404b7424cd (bug 1690390)
Backed out changeset a161177099af (bug 1690390)
Backed out changeset cc7e02d3d418 (bug 1690390)
2021-09-16 23:41:21 +03:00
Neil Deakin
60bf60be5c Bug 1690390, change appendNotification to take a smaller number of arguments: the string type value, a dictionary containing the notification details, and the button list, r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D107755
2021-09-16 19:11:17 +00:00