Skip to content

Commit

Permalink
Import assets.json updates from master to firefox-legacy (#3764)
Browse files Browse the repository at this point in the history
* adress DandelionSprout/adfilt#7 (comment) (#3754)

* Add more languages for list selection at install/reset time

Related issue:
- uBlockOrigin/uBlock-issues#501

Also, the handling of 3-letter language codes has been fixed.

* Forgot to add `lij` re. uBlockOrigin/uBlock-issues#501

* Cater to legacy javascript engines

* Fix uBlockOrigin/uBlock-issues#531

* Fix NanoMeow/QuickReports#1091

* Removed seemingly abandoned "DNK: Schacks" list

Related discussion:
- DandelionSprout/adfilt#7 (comment)

* Remove "RUS: AdGuard Russian" from stock filter list

As per feedback from maintainers, AdGuard Russian
and RU AdList are incompatible and web site breakage
can occur when both are used together.

Related issue:
- uBlockOrigin/uBlock-issues#749

* Rename "Fanboy Cookie" to "EasyList Cookie" + update list link

Related issue:
- uBlockOrigin/uBlock-issues#804

Co-authored-by: okiehsch <okiehsch@users.noreply.github.com>
Co-authored-by: Raymond Hill <gorhill@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 2, 2020
1 parent 8650fed commit 0f3c467
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 50 deletions.
69 changes: 25 additions & 44 deletions assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@
"content": "filters",
"group": "ads",
"off": true,
"title": "Adblock Warning Removal List",
"title": "Adblock Warning Removal",
"contentURL": "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt",
"supportURL": "https://forums.lanik.us/"
},
"adguard-generic": {
"content": "filters",
"group": "ads",
"off": true,
"title": "AdGuard Base filter",
"title": "AdGuard Base",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
Expand All @@ -122,7 +122,7 @@
"content": "filters",
"group": "ads",
"off": true,
"title": "AdGuard Mobile Ads filter",
"title": "AdGuard Mobile Ads",
"ua": "mobile",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/11.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
Expand All @@ -144,7 +144,7 @@
"content": "filters",
"group": "privacy",
"off": true,
"title": "AdGuard Spyware filter",
"title": "AdGuard Tracking Protection",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/3.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
Expand Down Expand Up @@ -213,7 +213,7 @@
"content": "filters",
"group": "social",
"off": true,
"title": "AdGuard Annoyances filter",
"title": "AdGuard Annoyances",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/14.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
Expand All @@ -222,7 +222,7 @@
"content": "filters",
"group": "social",
"off": true,
"title": "AdGuard Social Media filter",
"title": "AdGuard Social Media",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/4.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
Expand All @@ -231,15 +231,15 @@
"content": "filters",
"group": "social",
"off": true,
"title": "Anti-Facebook List",
"title": "Anti-Facebook",
"contentURL": "https://fanboy.co.nz/fanboy-antifacebook.txt",
"supportURL": "https://github.com/ryanbr/fanboy-adblock/issues"
},
"fanboy-annoyance": {
"content": "filters",
"group": "social",
"off": true,
"title": "Fanboy’s Annoyance List",
"title": "Fanboy’s Annoyance",
"contentURL": [
"https://easylist.to/easylist/fanboy-annoyance.txt",
"https://fanboy.co.nz/fanboy-annoyance.txt"
Expand All @@ -250,15 +250,15 @@
"content": "filters",
"group": "social",
"off": true,
"title": "Fanboy's Cookie List",
"contentURL": "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt",
"supportURL": "https://github.com/ryanbr/fanboy-adblock/issues"
"title": "EasyList Cookie",
"contentURL": "https://easylist-downloads.adblockplus.org/easylist-cookie.txt",
"supportURL": "https://github.com/easylist/easylist/issues"
},
"fanboy-social": {
"content": "filters",
"group": "social",
"off": true,
"title": "Fanboy’s Social Blocking List",
"title": "Fanboy’s Social",
"contentURL": [
"https://easylist.to/easylist/fanboy-social.txt",
"https://fanboy.co.nz/fanboy-social.txt"
Expand Down Expand Up @@ -321,7 +321,7 @@
"group": "regions",
"off": true,
"title": "BGR: Bulgarian Adblock list",
"lang": "bg",
"lang": "bg mk",
"contentURL": "https://stanev.org/abp/adblock_bg.txt",
"supportURL": "https://stanev.org/abp/"
},
Expand Down Expand Up @@ -365,15 +365,6 @@
],
"supportURL": "https://forums.lanik.us/viewforum.php?f=90"
},
"DNK-0": {
"content": "filters",
"group": "regions",
"off": true,
"title": "DNK: Schacks Adblock Plus liste",
"lang": "da",
"contentURL": "https://adblock.dk/block.csv",
"supportURL": "https://henrik.schack.dk/adblock/"
},
"EST-0": {
"content": "filters",
"group": "regions",
Expand All @@ -397,7 +388,7 @@
"group": "regions",
"off": true,
"title": "FRA: EasyList Liste FR",
"lang": "ar fr",
"lang": "ar br fr oc",
"contentURL": "https://easylist-downloads.adblockplus.org/liste_fr.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=91"
},
Expand All @@ -417,8 +408,8 @@
"off": true,
"title": "HUN: hufilter",
"lang": "hu",
"contentURL": "https://raw.githubusercontent.com/szpeter80/hufilter/master/hufilter.txt",
"supportURL": "https://github.com/szpeter80/hufilter"
"contentURL": "https://raw.githubusercontent.com/hufilter/hufilter/master/hufilter.txt",
"supportURL": "https://github.com/hufilter/hufilter"
},
"IDN-0": {
"content": "filters",
Expand Down Expand Up @@ -461,7 +452,7 @@
"group": "regions",
"off": true,
"title": "ITA: EasyList Italy",
"lang": "it",
"lang": "it lij",
"contentURL": "https://easylist-downloads.adblockplus.org/easylistitaly.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=96"
},
Expand All @@ -477,7 +468,7 @@
"content": "filters",
"group": "regions",
"off": true,
"title": "JPN: AdGuard Japanese filter",
"title": "JPN: AdGuard Japanese",
"lang": "ja",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/7.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
Expand Down Expand Up @@ -524,7 +515,7 @@
"group": "regions",
"off": true,
"title": "NLD: EasyList Dutch",
"lang": "nl",
"lang": "af fy nl",
"contentURL": "https://easylist-downloads.adblockplus.org/easylistdutch.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=100"
},
Expand All @@ -533,7 +524,7 @@
"group": "regions",
"off": true,
"title": "NOR, DNK, ISL: Dandelion Sprouts nordiske filtre",
"lang": "nb no da is",
"lang": "nb nn no da is",
"contentURL": [
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianList.txt",
"https://repo.or.cz/FilterMirrorRepo.git/blob_plain/refs/heads/master:/NorwegianList.txt"
Expand Down Expand Up @@ -576,36 +567,26 @@
"group": "regions",
"off": true,
"title": "RUS: RU AdList",
"lang": "be ru uk",
"lang": "be kk ru uk uz",
"contentURL": "https://easylist-downloads.adblockplus.org/advblock+cssfixes.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=102",
"instructionURL": "https://forums.lanik.us/viewtopic.php?f=102&t=22512"
},
"RUS-2": {
"content": "filters",
"group": "regions",
"off": true,
"title": "RUS: AdGuard Russian filter",
"lang": "be ru uk",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/1.txt",
"supportURL": "https://forum.adguard.com/forumdisplay.php?69-%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80%D1%8B-Adguard",
"instructionURL": "https://kb.adguard.com/ru/general/adguard-ad-filters#russian"
},
"spa-0": {
"content": "filters",
"group": "regions",
"off": true,
"title": "spa: EasyList Spanish",
"lang": "es",
"lang": "an ast ca es eu gl",
"contentURL": "https://easylist-downloads.adblockplus.org/easylistspanish.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=103"
},
"spa-1": {
"content": "filters",
"group": "regions",
"off": true,
"title": "spa, por: AdGuard Spanish/Portuguese filter",
"lang": "es pt",
"title": "spa, por: AdGuard Spanish/Portuguese",
"lang": "an ast ca es eu gl pt",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/9.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
"instructionURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
Expand Down Expand Up @@ -641,7 +622,7 @@
"content": "filters",
"group": "regions",
"off": true,
"title": "TUR: AdGuard Turkish filter",
"title": "TUR: AdGuard Turkish",
"lang": "tr",
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/13.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters",
Expand Down
14 changes: 8 additions & 6 deletions src/js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1168,19 +1168,21 @@
// Support ability to auto-enable a filter list based on user agent.

µBlock.listMatchesEnvironment = function(details) {
var re;
// Matches language?
if ( typeof details.lang === 'string' ) {
re = this.listMatchesEnvironment.reLang;
var re = this.listMatchesEnvironment.reLang;
if ( re === undefined ) {
re = new RegExp('\\b' + self.navigator.language.slice(0, 2) + '\\b');
this.listMatchesEnvironment.reLang = re;
var match = /^[a-z]+/.exec(self.navigator.language);
if ( match !== null ) {
re = new RegExp('\\b' + match[0] + '\\b');
this.listMatchesEnvironment.reLang = re;
}
}
if ( re.test(details.lang) ) { return true; }
if ( re !== undefined && re.test(details.lang) ) { return true; }
}
// Matches user agent?
if ( typeof details.ua === 'string' ) {
re = new RegExp('\\b' + this.escapeRegex(details.ua) + '\\b', 'i');
var re = new RegExp('\\b' + this.escapeRegex(details.ua) + '\\b', 'i');
if ( re.test(self.navigator.userAgent) ) { return true; }
}
return false;
Expand Down

0 comments on commit 0f3c467

Please sign in to comment.