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

Commit

Permalink
Merge pull request #11726 from brave/ad-block
Browse files Browse the repository at this point in the history
Move ad-block and tracking-protection to muon
  • Loading branch information
bbondy authored Oct 31, 2017
2 parents 41a0523 + 16f784a commit c9c7fba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
runtime = electron
target_arch = x64
brave_electron_version = 4.5.10
brave_electron_version = 4.5.11
chromedriver_version = 2.32
target = v4.5.10
target = v4.5.11
disturl=https://brave-laptop-binaries.s3.amazonaws.com/atom-shell/dist/
build_from_source = true
4 changes: 2 additions & 2 deletions app/adBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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 {adBlockLists} = require('ad-block')
const getSetting = require('../js/settings').getSetting
const {ADBLOCK_CUSTOM_RULES} = require('../js/constants/settings')
const customFilterRulesUUID = 'CE61F035-9F0A-4999-9A5A-D4E46AF676F7'
Expand Down Expand Up @@ -67,7 +67,7 @@ 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)
Expand Down
6 changes: 5 additions & 1 deletion app/browser/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const bookmarkOrderCache = require('../common/cache/bookmarkOrderCache')
const ledgerState = require('../common/state/ledgerState')
const {getWindow} = require('./windows')

let adBlockRegions
let currentPartitionNumber = 0
const incrementPartitionNumber = () => ++currentPartitionNumber

Expand Down Expand Up @@ -250,11 +251,14 @@ const updateAboutDetails = (tabId) => {
}
sendAboutDetails(tabId, messages.SETTINGS_UPDATED, appSettings)
} else if (location === 'about:adblock') {
if (!adBlockRegions) {
adBlockRegions = require('ad-block').adBlockLists.regions
}
const adblock = appState.get('adblock', Immutable.Map())
sendAboutDetails(tabId, messages.ADBLOCK_UPDATED, {
adblock: adblock.toJS(),
settings: appSettings.toJS(),
resources: require('ad-block/lib/regions')
resources: adBlockRegions
})
} else if (location === 'about:downloads') {
const downloads = appState.get('downloads', Immutable.Map())
Expand Down
32 changes: 0 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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.3",
Expand Down Expand Up @@ -124,7 +123,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"
Expand Down

0 comments on commit c9c7fba

Please sign in to comment.