Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mneunomne committed Mar 6, 2021
2 parents 55b3c9e + dbec71f commit 0f733c2
Show file tree
Hide file tree
Showing 123 changed files with 6,121 additions and 3,774 deletions.
8 changes: 8 additions & 0 deletions assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
],
"supportURL": "https://www.eff.org/dnt-policy"
},
"ublock-badlists": {
"content": "internal",
"updateAfter": 13,
"contentURL": [
"https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badlists.txt",
"assets/ublock/badlists.txt"
]
},
"ublock-filters": {
"content": "filters",
"group": "default",
Expand Down
122 changes: 119 additions & 3 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,120 @@
})();


/// abort-on-stack-trace.js
/// alias aost.js
// Status is currently experimental
(function() {
let chain = '{{1}}';
let needle = '{{2}}';
let logLevel = '{{3}}';
const reRegexEscape = /[.*+?^${}()|[\]\\]/g;
if ( needle === '' || needle === '{{2}}' ) {
needle = '^';
} else if ( /^\/.+\/$/.test(needle) ) {
needle = needle.slice(1,-1);
} else {
needle = needle.replace(reRegexEscape, '\\$&');
}
const reNeedle = new RegExp(needle);
const magic = String.fromCharCode(Math.random() * 26 + 97) +
Math.floor(
(0.25 + Math.random() * 0.75) * Number.MAX_SAFE_INTEGER
).toString(36).slice(-8);
const log = console.log.bind(console);
const ErrorCtor = self.Error;
const mustAbort = function(err) {
let docURL = self.location.href;
const pos = docURL.indexOf('#');
if ( pos !== -1 ) {
docURL = docURL.slice(0, pos);
}
// Normalize stack trace
const lines = [];
for ( let line of err.stack.split(/[\n\r]+/) ) {
if ( line.includes(magic) ) { continue; }
line = line.trim();
let match = /(.*?@)?(\S+)(:\d+):\d+\)?$/.exec(line);
if ( match === null ) { continue; }
let url = match[2];
if ( url.startsWith('(') ) { url = url.slice(1); }
if ( url === docURL ) {
url = 'inlineScript';
} else if ( url.startsWith('<anonymous>') ) {
url = 'injectedScript';
}
let fn = match[1] !== undefined
? match[1].slice(0, -1)
: line.slice(0, match.index).trim();
if ( fn.startsWith('at') ) { fn = fn.slice(2).trim(); }
let rowcol = match[3];
lines.push(' ' + `${fn} ${url}${rowcol}:1`.trim());
}
lines[0] = `stackDepth:${lines.length-1}`;
const stack = lines.join('\t');
const r = reNeedle.test(stack);
if (
logLevel === '1' ||
logLevel === '2' && r ||
logLevel === '3' && !r
) {
log(stack.replace(/\t/g, '\n'));
}
return r;
};
const makeProxy = function(owner, chain) {
const pos = chain.indexOf('.');
if ( pos === -1 ) {
let v = owner[chain];
Object.defineProperty(owner, chain, {
get: function() {
if ( mustAbort(new ErrorCtor(magic)) ) {
throw new ReferenceError(magic);
}
return v;
},
set: function(a) {
if ( mustAbort(new ErrorCtor(magic)) ) {
throw new ReferenceError(magic);
}
v = a;
},
});
return;
}
const prop = chain.slice(0, pos);
let v = owner[prop];
chain = chain.slice(pos + 1);
if ( v ) {
makeProxy(v, chain);
return;
}
const desc = Object.getOwnPropertyDescriptor(owner, prop);
if ( desc && desc.set !== undefined ) { return; }
Object.defineProperty(owner, prop, {
get: function() { return v; },
set: function(a) {
v = a;
if ( a instanceof Object ) {
makeProxy(a, chain);
}
}
});
};
const owner = window;
makeProxy(owner, chain);
const oe = window.onerror;
window.onerror = function(msg, src, line, col, error) {
if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) {
return true;
}
if ( oe instanceof Function ) {
return oe(msg, src, line, col, error);
}
}.bind();
})();


/// addEventListener-defuser.js
/// alias aeld.js
(function() {
Expand Down Expand Up @@ -282,7 +396,9 @@
let owner = root;
let chain = path;
for (;;) {
if ( owner instanceof Object === false ) { return false; }
if ( typeof owner !== 'object' || owner === null ) {
return false;
}
const pos = chain.indexOf('.');
if ( pos === -1 ) {
const found = owner.hasOwnProperty(chain);
Expand All @@ -299,8 +415,8 @@
) {
const next = chain.slice(pos + 1);
let found = false;
for ( const item of owner.values() ) {
found = findOwner(item, next, prune) || found;
for ( const key of Object.keys(owner) ) {
found = findOwner(owner[key], next, prune) || found;
}
return found;
}
Expand Down
2 changes: 0 additions & 2 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ On Linux, the settings are saved in a SQlite file located at `~/.mozilla/firefox

On Windows, the settings are saved in a SQlite file located at `%APPDATA%\Mozilla\Firefox\Profiles\[profile name]\extension-data\ublock0.sqlite`.

If you want to automatically receive updates for this version, you can also install [uBlock Origin Updater](https://github.com/JustOff/ublock0-updater).

### Build instructions (for developers)

- Clone [uBlock](https://github.com/gorhill/uBlock) and [uAssets](https://github.com/uBlockOrigin/uAssets) repositories in the same parent directory
Expand Down
51 changes: 51 additions & 0 deletions dist/description/description-fil.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Isang episyenteng blocker: magaan sa memorya at CPU footprint, ngunit nakakapag-loload at nakakapag-enforce ng libo-libong mga filters kumpara sa mga ibang sikat na blockers.

Isinalarawan pangkalahatang-ideya ng kahusayan ng uBlock:
https://github.com/gorhill/uBlock/wiki/uBlock-vs.-ABP:-efficiency-compared

Paggamit: Ang malaking button sa sa popup ay upang permanenteng huwag paganahin / paganahin ang uBlock para sa kasalukuyang web site. Nalalapat ito sa kasalukuyang web site lamang , hindi ito pangkalahatang button.

***

May kakayahang umangkop. Ito ay higit pa sa isang "ad blocker " : Maaari rin itong magtakda at lumikha ng mga filter mula sa mga host ng mga files.

Ang mga listahang ito ng mga filter nag-loload at ipinapatupad :

- EasyList
- Peter Lowe’s Ad server list
- EasyPrivacy
- Malware domains

Higit pang mga listahan ay magagamit para sa iyo upang piliin kung nanaisin:

- Fanboy’s Enhanced Tracking List
- Dan Pollock’s hosts file
- hpHosts’s Ad and tracking servers
- MVPS HOSTS
- Spam404
- At iba pa.

Siyempre, mas maraming pinapaganang mga filter , mas mataas ang memory footprint. Ngunit , kahit ang pagdaragdag ng dalawang extra na mga listahan ng Fanboy , hpHosts’s Ad at tracking servers, ang uBlock₀ pa rin ay may mas mababang memory footprint kaysa sa iba pang mga sikat na blockers.

Gayundin, magkaroon ng kamalayan na ang pagpili ng ilan sa mga dagdag na mga listahan ay maaaring humantong sa mas mataas na posibilidad ng pagkasira ng web site - lalo na ang mga listahan na palaging ginagamit na hosts file.

***

Kung walang mga preset na listahan na mga filters, ang extension na ito ay wala kwenta. Kaya kung sakaling nais mong tumulong, isipin ang mga tao nagsusumikap upang mapanatili ang mga listahan ng filter na ginagamit mo , na ginawang libre para sa lahat.

***

Libre.
Open source with public license (GPLv3)
Para sa users by users.

Mga nag-aambag @ Github:
https://github.com/gorhill/uBlock/graphs/contributors
Mga nag-aambag @ Crowdin: https://crowdin.net/project/ublock

***

Kakalabas lang nito kaya't pag-isipan ang mga komentaryo bago magbigay ng review.

Mga pagbabago sa proyekto:
https://github.com/gorhill/uBlock/releases
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.5.101",
"version": "1.29.3.112",
"browser_specific_settings": { "gecko": { "strict_min_version": "55" } },
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.28.5rc1",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.28.5rc1/uBlock0_1.28.5rc1.firefox.signed.xpi"
"update_info_url": "https://github.com/gorhill/uBlock/releases/tag/1.29.3rc12",
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.29.3rc12/uBlock0_1.29.3rc12.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.29.2
1.30.0
5 changes: 5 additions & 0 deletions docs/tests/procedural-cosmetic-filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ <h3>Tests</h3>
<code>#pcf #a20 b:upward(.fail)</code>
</div>

<div id="a21" class="tile">
<div class="pass"><div class="fail"><a><b></b></a></div></div>
<code>#pcf #a21 b:upward(.fail):style(visibility: hidden !important)</code>
</div>

</div>

<script>
Expand Down
28 changes: 28 additions & 0 deletions docs/tests/static-filtering-parser-checklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ a*
:: AB
:: ab # comment

! valid hosts file entries
0.0.0.0 0.0.0.0.example.com
0.0.0.0 localhost.example.com
0.0.0.0 local-host.example.com
0.0.0.0 local.com
0.0.0.0 localhost.com
0.0.0.0 local-host.com

! valid options
$script,redirect=noop.js
*$empty
Expand All @@ -46,6 +54,14 @@ $script,redirect=noop.js
*$all,~inline-script
*$all,~inline-font

! valid domain option values
*$domain=toto.com|toto.*|~toto.com|~toto.*|tôtó.ça|tôtó.*|~tôtó.ça|[ff00::0]|1.1.1.1

! valid denyallow option values
*$denyallow=toto.com|tôtó.ça|[ff00::0]|1.1.1.1




!--------------------
! Parsing should fail
Expand All @@ -68,6 +84,11 @@ $
::/ ab
:: ab$

! ignored hosts file entries
0.0.0.0 0.0.0.0
0.0.0.0 local
0.0.0.0 localhost

! bad regex
/(abc|def/$xhr

Expand All @@ -92,3 +113,10 @@ $
*$~popup
*$~inline-script
*$~inline-font

! invalidity of IP addresses is browser-dependent
! invalid domain= option values
*$domain=.toto.com|toto.com.|[ff00::00000]|1.1.1.1111

! invalid denyallow= option values
*$denyallow=.toto.com|toto.com.|toto.*|~toto.com|~toto.*|[ff00::00000]|1.1.1.1111
8 changes: 6 additions & 2 deletions platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
},
{
"matches": [
"http://*/*",
"https://*/*"
"https://easylist.to/*",
"https://*.fanboy.co.nz/*",
"https://filterlists.com/*",
"https://forums.lanik.us/*",
"https://github.com/*",
"https://*.github.io/*"
],
"js": [
"/js/scriptlets/subscriber.js"
Expand Down
Loading

0 comments on commit 0f733c2

Please sign in to comment.