-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow downloading PDFs instead of opening them in Brave.
Fixes brave/brave-browser#1531 The fix does the following: 1. Makes the initial decision on whether to load PDFJS extension based on the value of kPluginsAlwaysOpenPdfExternally profile preference. 2. Watches profile preference value kPluginsAlwaysOpenPdfExternally and adds/removes PDFJS extension when the value changes. 3. Modifies js behind the chrome://settings/content/pdfDocuments so that if the PDFJS extension is disabled from the command line the option to download PDF files instead of opening them in Brave is set to ON and the toggle is disabled. Note, that this fix doesn't address being able to turn off opening PDFs in Brave in Guest/Tor profiles. The web ui setting to do so is not available in these profiles. The command line switch to not load PDFJS already applies to all profile types.
- Loading branch information
Showing
4 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
patches/chrome-browser-resources-settings-site_settings-pdf_documents.js.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/chrome/browser/resources/settings/site_settings/pdf_documents.js b/chrome/browser/resources/settings/site_settings/pdf_documents.js | ||
index 66f61a6db59bc5a549db3ec505518462f72b5cb7..dc96ac708d68be5f82972aa3273e38ce687b61ab 100644 | ||
--- a/chrome/browser/resources/settings/site_settings/pdf_documents.js | ||
+++ b/chrome/browser/resources/settings/site_settings/pdf_documents.js | ||
@@ -17,4 +17,12 @@ Polymer({ | ||
notify: true, | ||
}, | ||
}, | ||
+ | ||
+ /** @override */ | ||
+ ready: function () { | ||
+ if (loadTimeData.getBoolean('isPdfjsDisabled')) { | ||
+ this.$.toggle.disabled = true; | ||
+ this.$.toggle.checked = true; | ||
+ } | ||
+ }, | ||
}); |