Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit e962ef9

Browse files
committed
Only replace PDF URL when PDFJS is enabled
Fix #2530 Auditors: @diracdeltas
1 parent 0464ce3 commit e962ef9

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

app/extensions/brave/locales/en-US/preferences.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ usePasswordManager=Use Brave's password manager
6666
useOnePassword=Use 1Password (requires 1Password Application)
6767
useDashlane=Use Dashlane (requires Dashlane Application)
6868
useLastPass=Use LastPass
69-
usePDFJS=Use HTML5 PDF reader
69+
usePDFJS=Use HTML5 PDF reader (requires browser restart)
7070
enableFlash=Enable Adobe Flash support (requires browser restart)
7171
enableFlashSubtext=Flash support is experimental and requires Pepper Flash to be installed from
7272
enableFlashSubtextLinux=Flash support is experimental and requires the pepperflashplugin-nonfree package.

docs/appActions.md

+11
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,17 @@ Adds a word to the dictionary
282282

283283

284284

285+
### setPDFJSOrigin(origin)
286+
287+
Sets PDFJS origin
288+
289+
**Parameters**
290+
291+
**origin**: `string`, The origin of the PDFJS extension. Ends in
292+
a slash.
293+
294+
295+
285296

286297
* * *
287298

js/stores/windowStore.js

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ const updateNavBarInput = (loc, frameStatePath = activeFrameStatePath()) => {
5555
* @param {string=} loc - Original URL
5656
*/
5757
const setPDFLocation = (loc) => {
58+
if (!getSetting(settings.PDFJS_ENABLED)) {
59+
return loc
60+
}
5861
PDFJS_ORIGIN = PDFJS_ORIGIN || require('./appStoreRenderer').state.get('pdfjsOrigin')
5962
if (loc && PDFJS_ORIGIN &&
6063
UrlUtil.isFileType(loc, 'pdf') && !loc.startsWith(PDFJS_ORIGIN)) {

0 commit comments

Comments
 (0)