[GeckoView] Show the download button by default and add a pref to disable it (bug 1827963)

For the moment there is no real consensus on how we should download a pdf on Android.
Hence we keep this solution for the moment but behind a pref (which will be true on
nightly only).
This commit is contained in:
Calixte Denizet 2023-04-13 19:15:08 +02:00
parent 7571842d84
commit 7f0d45ce47
4 changed files with 61 additions and 23 deletions

View file

@ -588,7 +588,17 @@ const PDFViewerApplication = {
}
if (appConfig.toolbar) {
this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n);
if (
typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")
) {
if (AppOptions.get("enableFloatingToolbar")) {
this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n);
}
} else {
this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n);
}
}
if (appConfig.secondaryToolbar) {
@ -2917,17 +2927,6 @@ function webViewerTouchEnd(evt) {
}
function webViewerClick(evt) {
if (
typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")
) {
if (
document.activeElement === PDFViewerApplication.appConfig.mainContainer
) {
PDFViewerApplication.toolbar?.toggle();
}
}
if (!PDFViewerApplication.secondaryToolbar?.isOpen) {
return;
}