Skip to content

Commit

Permalink
Merge pull request gorhill#13 from gorhill/master
Browse files Browse the repository at this point in the history
Re-sync with uBo master
  • Loading branch information
pes10k authored Jul 20, 2020
2 parents 839ea16 + bf01fc7 commit 525d10a
Show file tree
Hide file tree
Showing 88 changed files with 460 additions and 377 deletions.
12 changes: 6 additions & 6 deletions assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@
],
"cdnURLs": [
"https://cdn.statically.io/gl/curben/urlhaus-filter/master/urlhaus-filter-online.txt",
"https://glcdn.githack.com/curben/urlhaus-filter/raw/master/urlhaus-filter-online.txt",
"https://gitcdn.xyz/repo/curbengh/urlhaus-filter/master/urlhaus-filter-online.txt",
"https://repo.or.cz/urlhaus-filter.git/blob_plain/refs/heads/master:/urlhaus-filter-online.txt"
"https://cdn.jsdelivr.net/gh/curbengh/urlhaus-filter/urlhaus-filter-online.txt",
"https://raw.githubusercontent.com/curbengh/urlhaus-filter/master/urlhaus-filter-online.txt",
"https://gitlab.com/curben/urlhaus-filter/raw/master/urlhaus-filter-online.txt"
],
"supportURL": "https://gitlab.com/curben/urlhaus-filter#urlhaus-malicious-url-blocklist"
},
Expand Down Expand Up @@ -336,12 +337,11 @@
"content": "filters",
"group": "regions",
"off": true,
"title": "FRA: EasyList Liste FR",
"title": "FRA: AdGuard Français",
"lang": "ar br fr oc",
"contentURL": "https://easylist-downloads.adblockplus.org/liste_fr.txt",
"supportURL": "https://forums.lanik.us/viewforum.php?f=91"
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/16.txt",
"supportURL": "https://github.com/AdguardTeam/AdguardFilters#adguard-filters"
},

"GRC-0": {
"content": "filters",
"group": "regions",
Expand Down
103 changes: 67 additions & 36 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
self.EventTarget.prototype.addEventListener,
{
apply: function(target, thisArg, args) {
const type = args[0].toString();
const type = String(args[0]);
const handler = String(args[1]);
if (
needle1.test(type) === false ||
Expand All @@ -238,7 +238,7 @@
self.EventTarget.prototype.addEventListener,
{
apply: function(target, thisArg, args) {
const type = args[0].toString();
const type = String(args[0]);
const handler = String(args[1]);
log('uBO: addEventListener("%s", %s)', type, handler);
return target.apply(thisArg, args);
Expand Down Expand Up @@ -588,8 +588,9 @@
/// set-constant.js
/// alias set.js
(function() {
const thisScript = document.currentScript;
const chain = '{{1}}';
let cValue = '{{2}}';
const thisScript = document.currentScript;
if ( cValue === 'undefined' ) {
cValue = undefined;
} else if ( cValue === 'false' ) {
Expand Down Expand Up @@ -622,53 +623,83 @@
(typeof v !== typeof cValue);
return aborted;
};
const makeProxy = function(owner, chain) {
// https://github.com/uBlockOrigin/uBlock-issues/issues/156
// Support multiple trappers for the same property.
const trapProp = function(owner, prop, handler) {
if ( handler.init(owner[prop]) === false ) { return; }
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if ( odesc instanceof Object ) {
if ( odesc.get instanceof Function ) {
prevGetter = odesc.get;
}
if ( odesc.set instanceof Function ) {
prevSetter = odesc.set;
}
}
Object.defineProperty(owner, prop, {
configurable: true,
get() {
if ( prevGetter !== undefined ) {
prevGetter();
}
return handler.getter();
},
set(a) {
if ( prevSetter !== undefined ) {
prevSetter(a);
}
handler.setter(a);
}
});
};
const trapChain = function(owner, chain) {
const pos = chain.indexOf('.');
if ( pos === -1 ) {
const original = owner[chain];
if ( mustAbort(original) ) { return; }
const desc = Object.getOwnPropertyDescriptor(owner, chain);
if ( desc === undefined || desc.get === undefined ) {
Object.defineProperty(owner, chain, {
get: function() {
return document.currentScript === thisScript
? original
: cValue;
},
set: function(a) {
if ( mustAbort(a) ) {
cValue = a;
}
}
});
}
trapProp(owner, chain, {
v: undefined,
init: function(v) {
if ( mustAbort(v) ) { return false; }
this.v = v;
return true;
},
getter: function() {
return document.currentScript === thisScript
? this.v
: cValue;
},
setter: function(a) {
if ( mustAbort(a) === false ) { return; }
cValue = a;
}
});
return;
}
const prop = chain.slice(0, pos);
let v = owner[prop];
const v = owner[prop];
chain = chain.slice(pos + 1);
if (
(v instanceof Object) ||
(typeof v === 'object' && v !== null)
) {
makeProxy(v, chain);
if ( v instanceof Object || typeof v === 'object' && v !== null ) {
trapChain(v, chain);
return;
}
const desc = Object.getOwnPropertyDescriptor(owner, prop);
if ( desc && desc.set !== undefined ) { return; }
Object.defineProperty(owner, prop, {
get: function() {
return v;
trapProp(owner, prop, {
v: undefined,
init: function(v) {
this.v = v;
return true;
},
set: function(a) {
v = a;
getter: function() {
return this.v;
},
setter: function(a) {
this.v = a;
if ( a instanceof Object ) {
makeProxy(a, chain);
trapChain(a, chain);
}
}
});
};
makeProxy(window, '{{1}}');
trapChain(window, chain);
})();


Expand Down
2 changes: 1 addition & 1 deletion dist/description/description-es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Por defecto ya trae configuradas las siguientes listas de filtros:
- EasyList
- Peter Lowe’s Ad server list
- EasyPrivacy
- Malware domains
- Online Malicious URL Blocklist

Otras listas disponibles pueden ser seleccionadas, si se desea:

Expand Down
6 changes: 3 additions & 3 deletions dist/description/description-fr.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
uBlock₀ est un bloqueur efficace de publicités et de pisteurs. Utilisant peu de mémoire vive et de ressources du processeur, il est pourtant capable d'appliquer des milliers de filtres de plus que d'autres bloqueurs populaires.

Consultez cette page en Anglais pour avoir une vue d'ensemble illustrée de son efficacité : https://github.com/gorhill/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared
Consultez cette page en anglais pour avoir une vue d'ensemble illustrée de son efficacité : https://github.com/gorhill/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared

Utilisation : Le gros bouton "Power" dans la fenêtre pop-up permet de désactiver/activer en permanence uBlock₀ pour le site Web en cours de consultation. Cela s'applique uniquement au site Web actuel, ce n'est pas un bouton "Power" global.

Expand Down Expand Up @@ -38,10 +38,10 @@ Gratuit.
Source libre sous licence publique GPLv3
Conçu par des utilisateurs pour des utilisateurs.

Contributeurs sur Github : https://github.com/gorhill/uBlock/graphs/contributors
Contributeurs sur GitHub : https://github.com/gorhill/uBlock/graphs/contributors
Contributeurs sur Crowdin : https://crowdin.net/project/ublock

***

Consultez ici en Anglais le Journal des changements concernant le projet :
Journal des changements du projet (en anglais) :
https://github.com/gorhill/uBlock/releases
2 changes: 1 addition & 1 deletion dist/description/description-hy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Without the preset lists of filters, this extension is nothing. So if ever you r

***

Free.
Ազատ։
Open source with public license (GPLv3)
For users by users.

Expand Down
2 changes: 1 addition & 1 deletion dist/description/description-nb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Som standard er disse filterlistene lastet og i bruk:
- EasyList
- Peter Lowe’s Ad server list
- EasyPrivacy
- Malware domains
- Online Malicious URL Blocklist

Flere lister er tilgjengelige om ønskelig:

Expand Down
2 changes: 1 addition & 1 deletion dist/description/description-pl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Po zainstalowaniu są wczytywane i stosowane następujące listy filtrów:
– EasyList
– Peter Lowe’s Ad server list
– EasyPrivacy
Malware domains.
Online Malicious URL Blocklist

Można wybrać więcej list filtrów:

Expand Down
6 changes: 3 additions & 3 deletions dist/firefox/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"[email protected]": {
"updates": [
{
"version": "1.28.3.0",
"version": "1.28.5.4",
"browser_specific_settings": { "gecko": { "strict_min_version": "55" } },
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.28.3b0",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.28.3b0/uBlock0_1.28.3b0.firefox.signed.xpi"
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.28.5b4",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.28.5b4/uBlock0_1.28.5b4.firefox.signed.xpi"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion dist/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.28.3.0
1.28.5.4
19 changes: 16 additions & 3 deletions docs/tests/static-filtering-parser-checklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
!-----------------------
! Parsing should succeed
!-----------------------

! valid patterns
a*
|*
||*

! valid options
$script,redirect=noop.js
*$empty
*$xhr,empty
Expand All @@ -35,6 +42,15 @@ $script,redirect=noop.js
! Parsing should fail
!--------------------

! bad patterns
a
|
||
$

! bad regex
/(abc|def/$xhr

! can't redirect without type (except to `empty`)
*$redirect=noop.js

Expand All @@ -51,9 +67,6 @@ $script,redirect=noop.js
*$csp=default-src 'none',ghide
*$csp=default-src 'none',csp=script-src 'none'

! bad regex
/(abc|def/$xhr

! https://github.com/gorhill/uBlock/issues/2385#issuecomment-494078763
*$~document
*$~popup
Expand Down
5 changes: 3 additions & 2 deletions platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
"/js/vapi-client.js",
"/js/contentscript.js"
],
"run_at": "document_start",
"all_frames": true
"all_frames": true,
"match_about_blank": true,
"run_at": "document_start"
},
{
"matches": [
Expand Down
1 change: 1 addition & 0 deletions platform/chromium/webext.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const webext = {
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation
webNavigation: {
getFrame: promisify(chrome.webNavigation, 'getFrame'),
getAllFrames: promisify(chrome.webNavigation, 'getAllFrames'),
},
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows
windows: {
Expand Down
5 changes: 3 additions & 2 deletions platform/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
"/js/vapi-client.js",
"/js/contentscript.js"
],
"run_at": "document_start",
"all_frames": true
"all_frames": true,
"match_about_blank": true,
"run_at": "document_start"
},
{
"matches": [
Expand Down
11 changes: 6 additions & 5 deletions platform/opera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
},
"content_scripts": [
{
"all_frames": true,
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"js/vapi.js",
"js/vapi-client.js",
"js/contentscript.js"
],
"matches": [
"http://*/*",
"https://*/*"
],
"all_frames": true,
"match_about_blank": true,
"run_at": "document_start"
},
{
Expand Down
5 changes: 3 additions & 2 deletions platform/thunderbird/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"/js/vapi-client.js",
"/js/contentscript.js"
],
"run_at": "document_start",
"all_frames": true
"all_frames": true,
"match_about_blank": true,
"run_at": "document_start"
},
{
"matches": [
Expand Down
6 changes: 3 additions & 3 deletions src/_locales/ar/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@
"description": "English: dynamic rule syntax and full documentation."
},
"whitelistPrompt": {
"message": "القائمة البيضاء تشيرللصفحات التي سوف يتم تعطيل uBlock₀ فيها. مدخل واحد لكل سطر. الفلاتر الغير صحيحه سوف يتم تجاهلها وإستبعادها.",
"description": "English: An overview of the content of the dashboard's Whitelist pane."
"message": "القائمة الخاصه التي سوف يتم تجاهلها من قبل uBlock₀. رابط واحد كل سطر.\nالروابط الغير صحيحه سوف يتم تجاهلها.",
"description": "The name of the trusted sites pane."
},
"whitelistImport": {
"message": "استيراد",
Expand All @@ -565,7 +565,7 @@
},
"whitelistExportFilename": {
"message": "my-ublock-whitelist_{{datetime}}.txt",
"description": "English: my-ublock-whitelist_{{datetime}}.txt"
"description": "The default filename to use for import/export purpose"
},
"whitelistApply": {
"message": "حفظ التغيرات",
Expand Down
4 changes: 2 additions & 2 deletions src/_locales/az/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@
},
"whitelistPrompt": {
"message": "İstisnalar siyahısındakı təlimatlar uBlock Origin-in hansı veb-səhifələrdə işləyişinin dayandırılmasını təmin edir. Hər sətirdə yalnız bir təlimat ola bilər. Yanlış təlimatlar xəbərdarlıq edilmədən nəzərə alınmayacaq və şərhə çeviriləcəkdir.",
"description": "English: An overview of the content of the dashboard's Whitelist pane."
"description": "The name of the trusted sites pane."
},
"whitelistImport": {
"message": "İdxal və əlavə et",
Expand All @@ -565,7 +565,7 @@
},
"whitelistExportFilename": {
"message": "my-ublock-whitelist_{{datetime}}.txt",
"description": "English: my-ublock-whitelist_{{datetime}}.txt"
"description": "The default filename to use for import/export purpose"
},
"whitelistApply": {
"message": "Dəyişiklikləri tətbiq et",
Expand Down
Loading

0 comments on commit 525d10a

Please sign in to comment.