diff --git a/app/browser/ads/adBlockUtil.js b/app/browser/ads/adBlockUtil.js index 0b28a69e308..c054af5f5b0 100644 --- a/app/browser/ads/adBlockUtil.js +++ b/app/browser/ads/adBlockUtil.js @@ -31,16 +31,27 @@ 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) && - // Only check http and https for now - firstPartyUrl.protocol.startsWith('http') && - // Only do adblock if the host isn't in the whitelist - !whitelistHosts.find((whitelistHost) => whitelistHost === url.hostname || url.hostname.endsWith('.' + whitelistHost)) && - // Make sure there's a valid resource type before trying to use adblock - mapFilterType[resourceType] !== undefined + ( + ( + ( + resourceType !== 'mainFrame' && + isThirdPartyHost(firstPartyUrl.hostname || '', url.hostname) + ) || + ( + siteHacks[firstPartyUrl.hostname] && + siteHacks[firstPartyUrl.hostname].allowFirstPartyAdblockChecks + ) + ) && + // Only check http and https for now + firstPartyUrl.protocol.startsWith('http') && + // Only do adblock if the host isn't in the whitelist + !whitelistHosts.find((whitelistHost) => whitelistHost === url.hostname || url.hostname.endsWith('.' + whitelistHost)) && + // Make sure there's a valid resource type before trying to use adblock + mapFilterType[resourceType] !== undefined + ) + ) module.exports = { mapFilterType, diff --git a/app/renderer/components/preferences/payment/ledgerTable.js b/app/renderer/components/preferences/payment/ledgerTable.js index 6bfae1cdc52..a366e7e8651 100644 --- a/app/renderer/components/preferences/payment/ledgerTable.js +++ b/app/renderer/components/preferences/payment/ledgerTable.js @@ -27,7 +27,6 @@ const aboutActions = require('../../../../../js/about/aboutActions') const {SettingCheckbox, SiteSettingCheckbox} = require('../../settings') class LedgerTable extends ImmutableComponent { - get synopsis () { return this.props.ledgerData.get('synopsis') } diff --git a/js/stores/eventStore.js b/js/stores/eventStore.js index 27face354dd..4d370bb31d3 100644 --- a/js/stores/eventStore.js +++ b/js/stores/eventStore.js @@ -54,7 +54,7 @@ const addPageView = (url, tabId) => { tab.isDestroyed() || !tab.session.partition.startsWith('persist:') - if (url && isSourceAboutUrl(url) || isPrivate) { + if ((url && isSourceAboutUrl(url)) || isPrivate) { url = null } diff --git a/test/unit/about/newTabPageTest.js b/test/unit/about/newTabPageTest.js index 632576af26c..7d2a086c144 100644 --- a/test/unit/about/newTabPageTest.js +++ b/test/unit/about/newTabPageTest.js @@ -109,7 +109,8 @@ describe('NewTab component unit tests', function () { describe('randomBackgroundImage', function () { it('calls random to get a random index', function () { randomSpy.reset() - wrapper.instance().randomBackgroundImage + const result = wrapper.instance().randomBackgroundImage + assert.notEqual(result, undefined) assert.equal(randomSpy.calledOnce, true) })