From b33835f094fc78a3885bf18ddd4ffa0c4774a360 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Mon, 18 Sep 2017 21:47:51 -0400 Subject: [PATCH] Allow adblock checking within the same origin Fix #11004 --- app/browser/ads/adBlockUtil.js | 19 ++----------------- js/data/siteHacks.js | 6 ------ 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/app/browser/ads/adBlockUtil.js b/app/browser/ads/adBlockUtil.js index 7406037b54c..46f368952e0 100644 --- a/app/browser/ads/adBlockUtil.js +++ b/app/browser/ads/adBlockUtil.js @@ -2,10 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -const {siteHacks} = require('../../../js/data/siteHacks') const {FilterOptions} = require('ad-block') -const isThirdPartyHost = require('../isThirdPartyHost') - const whitelistHosts = ['disqus.com', 'a.disquscdn.com'] /** @@ -30,20 +27,8 @@ const mapFilterType = { */ const shouldDoAdBlockCheck = (resourceType, firstPartyUrl, url, shouldCheckMainFrame) => firstPartyUrl.protocol && - // By default first party hosts are allowed, but enable the check if a flag is specified in siteHacks - ( - shouldCheckMainFrame || - ( - ( - resourceType !== 'mainFrame' && - isThirdPartyHost(firstPartyUrl.hostname || '', url.hostname) - ) || - ( - siteHacks[firstPartyUrl.hostname] && - siteHacks[firstPartyUrl.hostname].allowFirstPartyAdblockChecks - ) - ) - ) && + // By default first party hosts are allowed + (shouldCheckMainFrame || resourceType !== 'mainFrame') && // Only check http and https for now firstPartyUrl.protocol.startsWith('http') && // Only do adblock if the host isn't in the whitelist diff --git a/js/data/siteHacks.js b/js/data/siteHacks.js index 36dc84bbb84..874202895e4 100644 --- a/js/data/siteHacks.js +++ b/js/data/siteHacks.js @@ -124,12 +124,6 @@ module.exports.siteHacks = { 'player.siriusxm.com': { enableFlashCTP: true, redirectURL: 'https://player.siriusxm.com' - }, - 'www.youtube.com': { - allowFirstPartyAdblockChecks: true - }, - 'www.theatlantic.com': { - allowFirstPartyAdblockChecks: true } }