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

Commit

Permalink
Add duckduckgo.com to whitelist for Brave UA
Browse files Browse the repository at this point in the history
Fix #10020
  • Loading branch information
bbondy committed Jul 17, 2017
1 parent 8c60084 commit 8af2568
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions js/data/siteHacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports.localStorageExceptions = [
['https://mail.google.com', 'https://hangouts.google.com']
]

const braveUAWhitelist = ['adobe.com', 'duckduckgo.com']

module.exports.siteHacks = {
'sp1.nypost.com': emptyDataURI,
'sp.nasdaq.com': emptyDataURI,
Expand All @@ -58,16 +60,6 @@ module.exports.siteHacks = {
}
}
},
'adobe.com': {
onBeforeSendHeaders: function (details) {
let userAgent = details.requestHeaders['User-Agent']
userAgent = [userAgent.split('Chrome')[0], 'Brave Chrome', userAgent.split('Chrome')[1]].join('')
details.requestHeaders['User-Agent'] = userAgent
return {
requestHeaders: details.requestHeaders
}
}
},
'cityam.com': {
onBeforeSendHeaders: function (details) {
details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 Googlebot'
Expand Down Expand Up @@ -142,6 +134,19 @@ module.exports.siteHacks = {
},
'www.theatlantic.com': {
allowFirstPartyAdblockChecks: true
}
}
}

braveUAWhitelist.forEach((domain) => {
module.exports.siteHacks[domain] = {
onBeforeSendHeaders: function (details) {
let userAgent = details.requestHeaders['User-Agent']
userAgent = [userAgent.split('Chrome')[0], 'Brave Chrome', userAgent.split('Chrome')[1]].join('')
details.requestHeaders['User-Agent'] = userAgent
return {
requestHeaders: details.requestHeaders
}
}
}
})

0 comments on commit 8af2568

Please sign in to comment.