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

Commit

Permalink
Prevent non-extension origins from navigating to chrome-extension://
Browse files Browse the repository at this point in the history
fix #14772
  • Loading branch information
diracdeltas committed Jul 18, 2018
1 parent d603250 commit c5ab0ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/browser/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,13 @@ const api = {
}

tab.on('did-start-navigation', (e, navigationHandle) => {
if (navigationHandle.isRendererInitiated() &&
navigationHandle.getURL().startsWith('chrome-extension://') &&
!tab.getURL().startsWith('chrome-extension://')) {
// XXX: tab.stop and tab.loadURL cause a crash here
appActions.loadURLRequested(tabId, 'about:blank')
return
}
if (!tab.isDestroyed() && navigationHandle.isValid() && navigationHandle.isInMainFrame()) {
const controller = tab.controller()
if (!controller.isValid()) {
Expand Down

0 comments on commit c5ab0ea

Please sign in to comment.