Skip to content

Commit

Permalink
Use 'PDF Viewer' instead of 'chrome-extension://...' for notifications
Browse files Browse the repository at this point in the history
fix brave#11020

Test Plan:
1. open any PDF in Brave
2. click the fullscreen button
3. the notification should say 'Allow PDF Viewer to use fullscreen?'
  • Loading branch information
diracdeltas authored and syuan100 committed Nov 9, 2017
1 parent cc7cc41 commit 1234b54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,13 @@ function registerPermissionHandler (session, partition) {
// TODO(bridiver) - the permission handling should be converted to an action because we should never call `appStore.getState()`
// Check whether there is a persistent site setting for this host
const appState = appStore.getState()
const isBraveOrigin = origin.startsWith(`chrome-extension://${config.braveExtensionId}/`)
const isPDFOrigin = origin.startsWith(`${pdfjsOrigin}/`)
let settings
let tempSettings
if (mainFrameUrl === appUrlUtil.getBraveExtIndexHTML() ||
origin.startsWith('chrome-extension://' + config.braveExtensionId)) {
// lookup, display and store site settings by "Brave Browser"
origin = 'Brave Browser'
if (mainFrameUrl === appUrlUtil.getBraveExtIndexHTML() || isPDFOrigin || isBraveOrigin) {
// lookup, display and store site settings by the origin alias
origin = isPDFOrigin ? 'PDF Viewer' : 'Brave Browser'
// display on all tabs
mainFrameUrl = null
// Lookup by exact host pattern match since 'Brave Browser' is not
Expand Down Expand Up @@ -464,8 +465,7 @@ function registerPermissionHandler (session, partition) {
response.push(true)
} else if (permission === 'openExternal' && (
// The Brave extension and PDFJS are always allowed to open files in an external app
origin.startsWith('chrome-extension://' + config.PDFJSExtensionId) ||
origin.startsWith('chrome-extension://' + config.braveExtensionId))) {
isPDFOrigin || isBraveOrigin)) {
response.push(true)
} else {
const permissionName = permission + 'Permission'
Expand Down

0 comments on commit 1234b54

Please sign in to comment.