mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Fix typos
This commit is contained in:
parent
dd890667f2
commit
c23a9ada33
@ -2585,7 +2585,7 @@ function m3uPrune(
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* - `selector`: required, CSS selector, specifies `a` elements for which the
|
* - `selector`: required, CSS selector, specifies `a` elements for which the
|
||||||
* `href` attribute must be overriden.
|
* `href` attribute must be overridden.
|
||||||
* - `source`: optional, default to `text`, specifies from where to get the
|
* - `source`: optional, default to `text`, specifies from where to get the
|
||||||
* value which will override the `href` attribute.
|
* value which will override the `href` attribute.
|
||||||
* - `text`: the value will be the first valid URL found in the text
|
* - `text`: the value will be the first valid URL found in the text
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/533#issuecomment-164292868
|
// https://github.com/gorhill/uBlock/issues/533#issuecomment-164292868
|
||||||
// If WebRTC is supported, there won't be an exception if we
|
// If WebRTC is supported, there won't be an exception if we
|
||||||
// try to instanciate a peer connection object.
|
// try to instantiate a peer connection object.
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/533#issuecomment-168097594
|
// https://github.com/gorhill/uBlock/issues/533#issuecomment-168097594
|
||||||
// Because Chromium leaks WebRTC connections after they have been closed
|
// Because Chromium leaks WebRTC connections after they have been closed
|
||||||
|
@ -707,7 +707,7 @@ vAPI.DOMFilterer = class {
|
|||||||
object: 'object',
|
object: 'object',
|
||||||
video: 'media',
|
video: 'media',
|
||||||
};
|
};
|
||||||
let resquestIdGenerator = 1,
|
let requestIdGenerator = 1,
|
||||||
processTimer,
|
processTimer,
|
||||||
cachedBlockedSet,
|
cachedBlockedSet,
|
||||||
cachedBlockedSetHash,
|
cachedBlockedSetHash,
|
||||||
@ -801,10 +801,10 @@ vAPI.DOMFilterer = class {
|
|||||||
|
|
||||||
const send = function() {
|
const send = function() {
|
||||||
processTimer = undefined;
|
processTimer = undefined;
|
||||||
toCollapse.set(resquestIdGenerator, toProcess);
|
toCollapse.set(requestIdGenerator, toProcess);
|
||||||
messaging.send('contentscript', {
|
messaging.send('contentscript', {
|
||||||
what: 'getCollapsibleBlockedRequests',
|
what: 'getCollapsibleBlockedRequests',
|
||||||
id: resquestIdGenerator,
|
id: requestIdGenerator,
|
||||||
frameURL: window.location.href,
|
frameURL: window.location.href,
|
||||||
resources: toFilter,
|
resources: toFilter,
|
||||||
hash: cachedBlockedSetHash,
|
hash: cachedBlockedSetHash,
|
||||||
@ -813,7 +813,7 @@ vAPI.DOMFilterer = class {
|
|||||||
});
|
});
|
||||||
toProcess = [];
|
toProcess = [];
|
||||||
toFilter = [];
|
toFilter = [];
|
||||||
resquestIdGenerator += 1;
|
requestIdGenerator += 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
const process = function(delay) {
|
const process = function(delay) {
|
||||||
|
@ -296,7 +296,7 @@ const FilteringContext = class {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The idea is to minimize the amout of work done to figure out whether
|
// The idea is to minimize the amount of work done to figure out whether
|
||||||
// the resource is 3rd-party to the document.
|
// the resource is 3rd-party to the document.
|
||||||
is3rdPartyToDoc() {
|
is3rdPartyToDoc() {
|
||||||
let docDomain = this.getDocDomain();
|
let docDomain = this.getDocDomain();
|
||||||
@ -359,7 +359,7 @@ const FilteringContext = class {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The idea is to minimize the amout of work done to figure out whether
|
// The idea is to minimize the amount of work done to figure out whether
|
||||||
// the resource is 3rd-party to the top document.
|
// the resource is 3rd-party to the top document.
|
||||||
is3rdPartyToTab() {
|
is3rdPartyToTab() {
|
||||||
let tabDomain = this.getTabDomain();
|
let tabDomain = this.getTabDomain();
|
||||||
|
@ -599,11 +599,11 @@ const launchReporter = async function(request) {
|
|||||||
const entries = await io.getUpdateAges({
|
const entries = await io.getUpdateAges({
|
||||||
filters: µb.selectedFilterLists.slice()
|
filters: µb.selectedFilterLists.slice()
|
||||||
});
|
});
|
||||||
let shoudUpdateLists = false;
|
let shouldUpdateLists = false;
|
||||||
for ( const entry of entries ) {
|
for ( const entry of entries ) {
|
||||||
if ( entry.age < (2 * 60 * 60 * 1000) ) { continue; }
|
if ( entry.age < (2 * 60 * 60 * 1000) ) { continue; }
|
||||||
io.purge(entry.assetKey);
|
io.purge(entry.assetKey);
|
||||||
shoudUpdateLists = true;
|
shouldUpdateLists = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/commit/6efd8eb#commitcomment-107523558
|
// https://github.com/gorhill/uBlock/commit/6efd8eb#commitcomment-107523558
|
||||||
@ -631,7 +631,7 @@ const launchReporter = async function(request) {
|
|||||||
const supportURL = new URL(vAPI.getURL('support.html'));
|
const supportURL = new URL(vAPI.getURL('support.html'));
|
||||||
supportURL.searchParams.set('pageURL', request.pageURL);
|
supportURL.searchParams.set('pageURL', request.pageURL);
|
||||||
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
|
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
|
||||||
if ( shoudUpdateLists ) {
|
if ( shouldUpdateLists ) {
|
||||||
supportURL.searchParams.set('shouldUpdate', 1);
|
supportURL.searchParams.set('shouldUpdate', 1);
|
||||||
}
|
}
|
||||||
return supportURL.href;
|
return supportURL.href;
|
||||||
|
@ -1152,7 +1152,7 @@ const setFirewallRuleHandler = function(ev) {
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const reloadTab = function(bypassCache = false) {
|
const reloadTab = function(bypassCache = false) {
|
||||||
// Premptively clear the unprocessed-requests status since we know for sure
|
// Preemptively clear the unprocessed-requests status since we know for sure
|
||||||
// the page is being reloaded in this code path.
|
// the page is being reloaded in this code path.
|
||||||
if ( popupData.hasUnprocessedRequest === true ) {
|
if ( popupData.hasUnprocessedRequest === true ) {
|
||||||
messaging.send('popupPanel', {
|
messaging.send('popupPanel', {
|
||||||
|
@ -877,7 +877,7 @@ const filterToDOMInterface = (( ) => {
|
|||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const onOptmizeCandidates = function(details) {
|
const onOptimizeCandidates = function(details) {
|
||||||
const { candidates } = details;
|
const { candidates } = details;
|
||||||
const results = [];
|
const results = [];
|
||||||
for ( const paths of candidates ) {
|
for ( const paths of candidates ) {
|
||||||
@ -1165,7 +1165,7 @@ const onDialogMessage = function(msg) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'optimizeCandidates':
|
case 'optimizeCandidates':
|
||||||
onOptmizeCandidates(msg);
|
onOptimizeCandidates(msg);
|
||||||
break;
|
break;
|
||||||
case 'dialogCreate':
|
case 'dialogCreate':
|
||||||
filterToDOMInterface.queryAll(msg);
|
filterToDOMInterface.queryAll(msg);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
// to "should inject content scripts?"
|
// to "should inject content scripts?"
|
||||||
//
|
//
|
||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/403
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/403
|
||||||
// If the content script was not boostrapped, give it another try.
|
// If the content script was not bootstrapped, give it another try.
|
||||||
|
|
||||||
(( ) => {
|
(( ) => {
|
||||||
try {
|
try {
|
||||||
|
@ -103,9 +103,9 @@ const typeNameToTypeValue = {
|
|||||||
'beacon': 10 << TypeBitsOffset,
|
'beacon': 10 << TypeBitsOffset,
|
||||||
'ping': 10 << TypeBitsOffset,
|
'ping': 10 << TypeBitsOffset,
|
||||||
'other': 11 << TypeBitsOffset,
|
'other': 11 << TypeBitsOffset,
|
||||||
'popup': 12 << TypeBitsOffset, // start of behavorial filtering
|
'popup': 12 << TypeBitsOffset, // start of behavioral filtering
|
||||||
'popunder': 13 << TypeBitsOffset,
|
'popunder': 13 << TypeBitsOffset,
|
||||||
'main_frame': 14 << TypeBitsOffset, // start of 1p behavorial filtering
|
'main_frame': 14 << TypeBitsOffset, // start of 1p behavioral filtering
|
||||||
'generichide': 15 << TypeBitsOffset,
|
'generichide': 15 << TypeBitsOffset,
|
||||||
'specifichide': 16 << TypeBitsOffset,
|
'specifichide': 16 << TypeBitsOffset,
|
||||||
'inline-font': 17 << TypeBitsOffset,
|
'inline-font': 17 << TypeBitsOffset,
|
||||||
@ -2715,20 +2715,20 @@ class FilterBucket extends FilterCollection {
|
|||||||
const isrccollection = filterData[idata+1];
|
const isrccollection = filterData[idata+1];
|
||||||
const candidates = [];
|
const candidates = [];
|
||||||
this.forEach(idata, iunit => {
|
this.forEach(idata, iunit => {
|
||||||
if ( fc.canCoallesce(iunit) === false ) { return; }
|
if ( fc.canCoalesce(iunit) === false ) { return; }
|
||||||
candidates.push(iunit);
|
candidates.push(iunit);
|
||||||
});
|
});
|
||||||
if ( candidates.length < min ) { return 0; }
|
if ( candidates.length < min ) { return 0; }
|
||||||
const idesbucket = FilterBucket.create();
|
const idesbucket = FilterBucket.create();
|
||||||
const idescollection = filterData[idesbucket+1];
|
const idescollection = filterData[idesbucket+1];
|
||||||
let coallesced;
|
let coalesced;
|
||||||
let isrcseq = filterData[isrccollection+1];
|
let isrcseq = filterData[isrccollection+1];
|
||||||
let iprev = 0;
|
let iprev = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const iunit = filterData[isrcseq+0];
|
const iunit = filterData[isrcseq+0];
|
||||||
const inext = filterData[isrcseq+1];
|
const inext = filterData[isrcseq+1];
|
||||||
if ( candidates.includes(iunit) ) {
|
if ( candidates.includes(iunit) ) {
|
||||||
coallesced = fc.coallesce(iunit, coallesced);
|
coalesced = fc.coalesce(iunit, coalesced);
|
||||||
// move the sequence slot to new bucket
|
// move the sequence slot to new bucket
|
||||||
filterData[isrcseq+1] = filterData[idescollection+1];
|
filterData[isrcseq+1] = filterData[idescollection+1];
|
||||||
filterData[idescollection+1] = isrcseq;
|
filterData[idescollection+1] = isrcseq;
|
||||||
@ -2745,7 +2745,7 @@ class FilterBucket extends FilterCollection {
|
|||||||
if ( inext === 0 ) { break; }
|
if ( inext === 0 ) { break; }
|
||||||
isrcseq = inext;
|
isrcseq = inext;
|
||||||
}
|
}
|
||||||
return fc.create(coallesced, idesbucket);
|
return fc.create(coalesced, idesbucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dumpInfo(idata) {
|
static dumpInfo(idata) {
|
||||||
@ -2802,28 +2802,28 @@ class FilterBucketIfOriginHits extends FilterBucketIf {
|
|||||||
return filterMatch(filterData[idata+2]);
|
return filterMatch(filterData[idata+2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static canCoallesce(iunit) {
|
static canCoalesce(iunit) {
|
||||||
return filterHasOriginHit(iunit);
|
return filterHasOriginHit(iunit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static coallesce(iunit, coallesced) {
|
static coalesce(iunit, coalesced) {
|
||||||
if ( coallesced === undefined ) {
|
if ( coalesced === undefined ) {
|
||||||
coallesced = new Set();
|
coalesced = new Set();
|
||||||
}
|
}
|
||||||
const domainOpt = filterGetDomainOpt(iunit);
|
const domainOpt = filterGetDomainOpt(iunit);
|
||||||
if ( domainOpt.includes('|') ) {
|
if ( domainOpt.includes('|') ) {
|
||||||
for ( const hn of domainOptIterator.reset(domainOpt) ) {
|
for ( const hn of domainOptIterator.reset(domainOpt) ) {
|
||||||
coallesced.add(hn);
|
coalesced.add(hn);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
coallesced.add(domainOpt);
|
coalesced.add(domainOpt);
|
||||||
}
|
}
|
||||||
return coallesced;
|
return coalesced;
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(coallesced, ibucket) {
|
static create(coalesced, ibucket) {
|
||||||
const units = [];
|
const units = [];
|
||||||
compileFromDomainOpt(coallesced, false, units);
|
compileFromDomainOpt(coalesced, false, units);
|
||||||
const ihittest = filterFromCompiled(units[0]);
|
const ihittest = filterFromCompiled(units[0]);
|
||||||
const ipretest = super.create(
|
const ipretest = super.create(
|
||||||
FilterBucketIfOriginHits.fid,
|
FilterBucketIfOriginHits.fid,
|
||||||
@ -2843,23 +2843,23 @@ class FilterBucketIfRegexHits extends FilterBucketIf {
|
|||||||
return filterRefs[filterData[idata+2]].test($requestURLRaw);
|
return filterRefs[filterData[idata+2]].test($requestURLRaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
static canCoallesce(iunit) {
|
static canCoalesce(iunit) {
|
||||||
const fc = filterGetClass(iunit);
|
const fc = filterGetClass(iunit);
|
||||||
if ( fc.hasRegexPattern === undefined ) { return false; }
|
if ( fc.hasRegexPattern === undefined ) { return false; }
|
||||||
if ( fc.hasRegexPattern(iunit) !== true ) { return false; }
|
if ( fc.hasRegexPattern(iunit) !== true ) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static coallesce(iunit, coallesced) {
|
static coalesce(iunit, coalesced) {
|
||||||
if ( coallesced === undefined ) {
|
if ( coalesced === undefined ) {
|
||||||
coallesced = new Set();
|
coalesced = new Set();
|
||||||
}
|
}
|
||||||
coallesced.add(filterGetRegexPattern(iunit));
|
coalesced.add(filterGetRegexPattern(iunit));
|
||||||
return coallesced;
|
return coalesced;
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(coallesced, ibucket) {
|
static create(coalesced, ibucket) {
|
||||||
const reString = Array.from(coallesced).join('|');
|
const reString = Array.from(coalesced).join('|');
|
||||||
return super.create(
|
return super.create(
|
||||||
FilterBucketIfRegexHits.fid,
|
FilterBucketIfRegexHits.fid,
|
||||||
ibucket,
|
ibucket,
|
||||||
@ -2877,7 +2877,7 @@ registerFilterClass(FilterBucketIfRegexHits);
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
class FilterStrictParty {
|
class FilterStrictParty {
|
||||||
// TODO: diregard `www.`?
|
// TODO: disregard `www.`?
|
||||||
static match(idata) {
|
static match(idata) {
|
||||||
return ($requestHostname === $docHostname) === (filterData[idata+1] === 0);
|
return ($requestHostname === $docHostname) === (filterData[idata+1] === 0);
|
||||||
}
|
}
|
||||||
@ -5026,7 +5026,7 @@ FilterContainer.prototype.matchAndFetchModifiers = function(
|
|||||||
}
|
}
|
||||||
if ( toAddImportant.size === 0 && toAdd.size === 0 ) { return; }
|
if ( toAddImportant.size === 0 && toAdd.size === 0 ) { return; }
|
||||||
|
|
||||||
// Remove entries overriden by important block filters.
|
// Remove entries overridden by important block filters.
|
||||||
if ( toAddImportant.size !== 0 ) {
|
if ( toAddImportant.size !== 0 ) {
|
||||||
for ( const key of toAddImportant.keys() ) {
|
for ( const key of toAddImportant.keys() ) {
|
||||||
toAdd.delete(key);
|
toAdd.delete(key);
|
||||||
@ -5260,7 +5260,7 @@ FilterContainer.prototype.matchRequestReverse = function(type, url) {
|
|||||||
* Bit 1: lookup allow realm regardless of whether there was a match in
|
* Bit 1: lookup allow realm regardless of whether there was a match in
|
||||||
* block realm.
|
* block realm.
|
||||||
*
|
*
|
||||||
* @returns {integer} 0=no match, 1=block, 2=allow (exeption)
|
* @returns {integer} 0=no match, 1=block, 2=allow (exception)
|
||||||
*/
|
*/
|
||||||
FilterContainer.prototype.matchRequest = function(fctxt, modifiers = 0) {
|
FilterContainer.prototype.matchRequest = function(fctxt, modifiers = 0) {
|
||||||
let typeBits = typeNameToTypeValue[fctxt.type];
|
let typeBits = typeNameToTypeValue[fctxt.type];
|
||||||
|
@ -13,7 +13,7 @@ https://github.com/gorhill/lz4-wasm
|
|||||||
|
|
||||||
### `lz4-block-codec-any.js`
|
### `lz4-block-codec-any.js`
|
||||||
|
|
||||||
The purpose is to instanciate a WebAssembly- or pure javascript-based
|
The purpose is to instantiate a WebAssembly- or pure javascript-based
|
||||||
LZ4 block codec.
|
LZ4 block codec.
|
||||||
|
|
||||||
If the chosen implementation is not specified, there will be an attempt to
|
If the chosen implementation is not specified, there will be an attempt to
|
||||||
@ -26,13 +26,13 @@ used.
|
|||||||
|
|
||||||
### `lz4-block-codec-wasm.js`
|
### `lz4-block-codec-wasm.js`
|
||||||
|
|
||||||
This contains the code to instanciate WebAssembly-based LZ4 block codec. Note
|
This contains the code to instantiate WebAssembly-based LZ4 block codec. Note
|
||||||
that the WebAssembly module is loaded using a `same-origin` fetch, hence
|
that the WebAssembly module is loaded using a `same-origin` fetch, hence
|
||||||
ensuring that no code outside the package is loaded.
|
ensuring that no code outside the package is loaded.
|
||||||
|
|
||||||
### `lz4-block-codec-js.js`
|
### `lz4-block-codec-js.js`
|
||||||
|
|
||||||
This contains the code to instanciate pure javascript-based LZ4 block codec.
|
This contains the code to instantiate pure javascript-based LZ4 block codec.
|
||||||
|
|
||||||
This is used as a fallback implementation should WebAssembly not be available
|
This is used as a fallback implementation should WebAssembly not be available
|
||||||
for whatever reason.
|
for whatever reason.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
lz4-block-codec-any.js
|
lz4-block-codec-any.js
|
||||||
A wrapper to instanciate a wasm- and/or js-based LZ4 block
|
A wrapper to instantiate a wasm- and/or js-based LZ4 block
|
||||||
encoder/decoder.
|
encoder/decoder.
|
||||||
Copyright (C) 2018 Raymond Hill
|
Copyright (C) 2018 Raymond Hill
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
;;
|
;;
|
||||||
;; The implementation below is modified from the reference one.
|
;; The implementation below is modified from the reference one.
|
||||||
;;
|
;;
|
||||||
;; - There is no skip adjustement for repeated failure to find a match.
|
;; - There is no skip adjustment for repeated failure to find a match.
|
||||||
;;
|
;;
|
||||||
;; - All configurable values are hard-coded to match the generic version
|
;; - All configurable values are hard-coded to match the generic version
|
||||||
;; of the compressor.
|
;; of the compressor.
|
||||||
@ -462,7 +462,7 @@
|
|||||||
i32.eq
|
i32.eq
|
||||||
br_if 0
|
br_if 0
|
||||||
end end
|
end end
|
||||||
local.get $outPtr ;; copy literals to ouput buffer
|
local.get $outPtr ;; copy literals to output buffer
|
||||||
local.get $inPtr
|
local.get $inPtr
|
||||||
local.get $clen
|
local.get $clen
|
||||||
call $copy
|
call $copy
|
||||||
@ -523,7 +523,7 @@
|
|||||||
i32.eq
|
i32.eq
|
||||||
br_if 0
|
br_if 0
|
||||||
end end
|
end end
|
||||||
local.get $outPtr ;; copy match to ouput buffer
|
local.get $outPtr ;; copy match to output buffer
|
||||||
local.get $matchPtr
|
local.get $matchPtr
|
||||||
local.get $clen
|
local.get $clen
|
||||||
call $copy
|
call $copy
|
||||||
|
Loading…
Reference in New Issue
Block a user