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

Commit

Permalink
fix site hacks for wired.com and extremetech.com
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Dec 18, 2016
1 parent daa7743 commit be32eaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/extensions/brave/content/scripts/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ chrome.webFrame.setGlobal("navigator.getBattery", function () {
if (chrome.contentSettings.doNotTrack == 'allow') {
executeScript("window.Navigator.prototype.__defineGetter__('doNotTrack', () => { return 1 })")
}

if (chrome.contentSettings.ads == 'block') {
chrome.webFrame.setGlobal("window.google_onload_fired", true)
}
4 changes: 4 additions & 0 deletions js/state/contentSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const getDefaultUserPrefContentSettings = (braveryDefaults, appSettings, appConf
setting: braveryDefaults.adControl === 'showBraveAds' ? 'allow' : 'block',
primaryPattern: '*'
}],
ads: [{
setting: ['blockAds', 'showBraveAds'].includes(braveryDefaults.adControl) ? 'block' : 'allow',
primaryPattern: '*'
}],
doNotTrack: [{
setting: getSetting(settings.DO_NOT_TRACK, appSettings) ? 'allow' : 'block',
primaryPattern: '*'
Expand Down

0 comments on commit be32eaf

Please sign in to comment.