diff --git a/app/adBlock.js b/app/adBlock.js index 1da6c60118b..d27a9a114f0 100644 --- a/app/adBlock.js +++ b/app/adBlock.js @@ -5,7 +5,7 @@ 'use strict' const urlParse = require('./common/urlParse') -const {adBlockDataFileVersion, AdBlockClient} = require('ad-block') +const {adBlockDataFileVersion, adBlockLists, AdBlockClient} = require('ad-block') const dataFile = require('./dataFile') const Filtering = require('./filtering') const appConfig = require('../js/constants/appConfig') @@ -14,7 +14,6 @@ const debounce = require('../js/lib/debounce') const adblockInstances = new Map() const defaultAdblock = new AdBlockClient() const defaultSafeBrowsing = new AdBlockClient() -const regions = require('ad-block/lib/regions') const getSetting = require('../js/settings').getSetting const {ADBLOCK_CUSTOM_RULES} = require('../js/constants/settings') const customFilterRulesUUID = 'CE61F035-9F0A-4999-9A5A-D4E46AF676F7' @@ -67,7 +66,8 @@ module.exports.init = () => { .initInstance(defaultAdblock, module.exports.adBlockResourceName, false) .initInstance(defaultSafeBrowsing, module.exports.safeBrowsingResourceName, true) // Initialize the regional adblock files that are enabled - regions + adBlockLists + .regions .filter((region) => getSetting(`adblock.${region.uuid}.enabled`)) .forEach((region) => module.exports.updateAdblockDataFiles(region.uuid, true)) const customRules = getSetting(ADBLOCK_CUSTOM_RULES) diff --git a/app/browser/tabs.js b/app/browser/tabs.js index 3600f830d82..fd3a2354e22 100644 --- a/app/browser/tabs.js +++ b/app/browser/tabs.js @@ -226,7 +226,7 @@ const updateAboutDetails = (tab, tabValue) => { tab.send(messages.ADBLOCK_UPDATED, { adblock: adblock.toJS(), settings: appSettings.toJS(), - resources: require('ad-block/lib/regions') + resources: require('ad-block').adBlockLists.regions }) } else if (location === 'about:downloads' && downloads) { tab.send(messages.DOWNLOADS_UPDATED, { diff --git a/package-lock.json b/package-lock.json index 450c1044d87..b4d33a1dd0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,17 +88,6 @@ "acorn": "3.2.0" } }, - "ad-block": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/ad-block/-/ad-block-3.0.5.tgz", - "integrity": "sha512-PXpwgqjvEqu3JhUzZ4bp0mp7CDtdODkKAKrAZI07aHaAOTe2Z/b7QlK86NUqcuL2jqwUu7u7/Z79qg5IJV19xw==", - "requires": { - "bloom-filter-cpp": "1.1.6", - "cppunitlite": "1.0.0", - "hashset-cpp": "1.0.17", - "nan": "2.7.0" - } - }, "addr-to-ip-port": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/addr-to-ip-port/-/addr-to-ip-port-1.4.2.tgz", @@ -2041,11 +2030,6 @@ "superagent": "1.8.5" } }, - "bloom-filter-cpp": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/bloom-filter-cpp/-/bloom-filter-cpp-1.1.6.tgz", - "integrity": "sha1-3fAwWSOt9u2sG/QJ5nNeGW0srL8=" - }, "bluebird": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", @@ -7680,11 +7664,6 @@ "minimalistic-assert": "1.0.0" } }, - "hashset-cpp": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/hashset-cpp/-/hashset-cpp-1.0.17.tgz", - "integrity": "sha1-PFkR8Lf48tB4TJzO1OppaTROTIc=" - }, "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", @@ -17689,17 +17668,6 @@ "punycode": "2.1.0" } }, - "tracking-protection": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/tracking-protection/-/tracking-protection-1.1.6.tgz", - "integrity": "sha1-QTTZKjo3/JmKIlmXTSd3yK9DYLA=", - "requires": { - "cppunitlite": "1.0.0", - "hashset-cpp": "1.0.17", - "mkdirp": "0.5.1", - "nan": "2.7.0" - } - }, "traverse": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", diff --git a/package.json b/package.json index 2ef66b955a0..d5a170385d9 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "homepage": "https://www.brave.com/", "dependencies": { "acorn": "3.2.0", - "ad-block": "^3.0.5", "aphrodite": "1.1.0", "async": "^2.0.1", "bat-balance": "^1.0.1", @@ -122,7 +121,6 @@ "string.prototype.startswith": "^0.2.0", "tablesort": "5.0.1", "tldjs": "1.6.2", - "tracking-protection": "1.1.x", "underscore": "1.8.3", "url-loader": "~0.6.2", "webtorrent-remote": "^2.0.2"