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

Commit

Permalink
Remove permission exception for brave and pdf viewer
Browse files Browse the repository at this point in the history
quick fix for
#14679 (comment)
by just removing the special exception for these origins. this probably
breaks something but i'm not sure what.
  • Loading branch information
diracdeltas authored and riastradh-brave committed Jul 31, 2018
1 parent 5c46b3b commit 156d971
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,16 @@ function registerPermissionHandler (session, partition) {
requestingOrigin = isPDFOrigin ? 'PDF Viewer' : 'Brave Browser'
// display on all tabs
mainFrameOrigin = null
} else if (isOpenExternal) {
} else {
requestingOrigin = getOrigin(requestingUrl) || requestingUrl
}

if (isOpenExternal) {
// Open external is a special case since we want to apply the permission
// for the entire scheme to avoid cluttering the saved permissions. See
// https://github.com/brave/browser-laptop/issues/13642
const protocol = urlParse(requestingUrl).protocol
requestingOrigin = protocol ? `${protocol} URLs` : requestingUrl
} else {
requestingOrigin = getOrigin(requestingUrl) || requestingUrl
}

// Look up by host pattern since requestingOrigin is not necessarily
Expand All @@ -577,10 +579,6 @@ function registerPermissionHandler (session, partition) {
} else if (isFullscreen && alwaysAllowFullscreen) {
// Always allow fullscreen if setting is ON
response.push(true)
} else if (isOpenExternal && (
// The Brave extension and PDFJS are always allowed to open files in an external app
isPDFOrigin || isBraveOrigin)) {
response.push(true)
} else {
const permissionName = permission + 'Permission'
let isAllowed
Expand Down

0 comments on commit 156d971

Please sign in to comment.