Skip to content

Commit

Permalink
Don't set page title/location for external protocols
Browse files Browse the repository at this point in the history
Fix brave#1018

Auditors: @bbondy
  • Loading branch information
diracdeltas committed Apr 28, 2016
1 parent d6c4a44 commit 27e61f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,11 @@ class Frame extends ImmutableComponent {
windowActions.onWebviewLoadStart(
this.props.frame)
const key = this.props.frame.get('key')
windowActions.setLocation(event.url, key)
const parsedUrl = urlParse(event.url)
if (['http:', 'https:', 'about:', 'chrome:', 'chrome-extension:', 'file:',
'view-source:'].includes(parsedUrl.protocol)) {
windowActions.setLocation(event.url, key)
}
const hack = siteHacks[parsedUrl.hostname]
const isSecure = parsedUrl.protocol === 'https:' &&
(!hack || !hack.allowRunningInsecureContent)
Expand Down

0 comments on commit 27e61f2

Please sign in to comment.