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

Commit

Permalink
Don't ignore internal requests in app/filtering
Browse files Browse the repository at this point in the history
and return details.firstPartyUrl as a fallback for main frame URL.

Internal requests (tabId == -1) were ignored in order to fix #5934 in 6023abd. However (1) #5934 works without ignoring internal requests now and (2) generally speaking, non-webview requests should also be protected by HTTPS Everywhere, etc.

fix #12253
fix #12252

Test Plan:
1. confirm HTTPS Everywhere and Safebrowsing are working using the test plans in #12253 and #12252
2. confirm that #5934 has not regressed by enabling Pocket
  • Loading branch information
diracdeltas authored and bsclifton committed Dec 14, 2017
1 parent 5af9495 commit 3ec1fc4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,6 @@ module.exports.initPartition = initPartition
const filterableProtocols = ['http:', 'https:', 'ws:', 'wss:', 'magnet:', 'file:']

function shouldIgnoreUrl (details) {
// internal requests
if (details.tabId === -1) {
return true
}

// data:, is a special origin from SecurityOrigin::urlWithUniqueSecurityOrigin
// and usually occurs when there is an https in an http main frame
if (details.firstPartyUrl === 'data:,') {
Expand Down Expand Up @@ -860,10 +855,10 @@ module.exports.getMainFrameUrl = (details) => {
return details.url
}
const tab = webContents.fromTabID(details.tabId)
if (tab && !tab.isDestroyed()) {
try {
return tab.getURL()
}
return null
} catch (ex) {}
return details.firstPartyUrl || null
}

module.exports.alwaysAllowFullscreen = () => {
Expand Down

0 comments on commit 3ec1fc4

Please sign in to comment.