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

Commit

Permalink
Show 'Brave Browser' as the origin if origin is null
Browse files Browse the repository at this point in the history
in the permission notification bar

fix #4198

Test Plan:
1. go to brave.com
2. scroll down to the contact section
4. right click on one of the email addresses to open in a new tab
5. the notification bar should say, 'Allow Brave Browser to open an external application?'
  • Loading branch information
diracdeltas committed Aug 25, 2017
1 parent f4b456a commit 3383ff6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,9 @@ function registerPermissionHandler (session, partition) {
return
}

const message = locale.translation('permissionMessage').replace(/{{\s*host\s*}}/, origin).replace(/{{\s*permission\s*}}/, permissions[permission].action)
// Display 'Brave Browser' if the origin is null; ex: when a mailto: link
// is opened in a new tab via right-click
const message = locale.translation('permissionMessage').replace(/{{\s*host\s*}}/, origin || 'Brave Browser').replace(/{{\s*permission\s*}}/, permissions[permission].action)

// If this is a duplicate, clear the previous callback and use the new one
if (permissionCallbacks[message]) {
Expand All @@ -495,7 +497,7 @@ function registerPermissionHandler (session, partition) {
],
frameOrigin: getOrigin(mainFrameUrl),
options: {
persist: true
persist: !!origin
},
message
})
Expand Down

0 comments on commit 3383ff6

Please sign in to comment.