1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Fix typos

This commit is contained in:
Viktor Szépe 2023-07-14 18:19:30 +00:00 committed by Raymond Hill
parent dd890667f2
commit c23a9ada33
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
12 changed files with 48 additions and 48 deletions

View File

@ -2585,7 +2585,7 @@ function m3uPrune(
* ```
*
* - `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
* value which will override the `href` attribute.
* - `text`: the value will be the first valid URL found in the text

View File

@ -21,7 +21,7 @@
// https://github.com/gorhill/uBlock/issues/533#issuecomment-164292868
// 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
// Because Chromium leaks WebRTC connections after they have been closed

View File

@ -707,7 +707,7 @@ vAPI.DOMFilterer = class {
object: 'object',
video: 'media',
};
let resquestIdGenerator = 1,
let requestIdGenerator = 1,
processTimer,
cachedBlockedSet,
cachedBlockedSetHash,
@ -801,10 +801,10 @@ vAPI.DOMFilterer = class {
const send = function() {
processTimer = undefined;
toCollapse.set(resquestIdGenerator, toProcess);
toCollapse.set(requestIdGenerator, toProcess);
messaging.send('contentscript', {
what: 'getCollapsibleBlockedRequests',
id: resquestIdGenerator,
id: requestIdGenerator,
frameURL: window.location.href,
resources: toFilter,
hash: cachedBlockedSetHash,
@ -813,7 +813,7 @@ vAPI.DOMFilterer = class {
});
toProcess = [];
toFilter = [];
resquestIdGenerator += 1;
requestIdGenerator += 1;
};
const process = function(delay) {

View File

@ -296,7 +296,7 @@ const FilteringContext = class {
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.
is3rdPartyToDoc() {
let docDomain = this.getDocDomain();
@ -359,7 +359,7 @@ const FilteringContext = class {
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.
is3rdPartyToTab() {
let tabDomain = this.getTabDomain();

View File

@ -599,11 +599,11 @@ const launchReporter = async function(request) {
const entries = await io.getUpdateAges({
filters: µb.selectedFilterLists.slice()
});
let shoudUpdateLists = false;
let shouldUpdateLists = false;
for ( const entry of entries ) {
if ( entry.age < (2 * 60 * 60 * 1000) ) { continue; }
io.purge(entry.assetKey);
shoudUpdateLists = true;
shouldUpdateLists = true;
}
// 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'));
supportURL.searchParams.set('pageURL', request.pageURL);
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
if ( shoudUpdateLists ) {
if ( shouldUpdateLists ) {
supportURL.searchParams.set('shouldUpdate', 1);
}
return supportURL.href;

View File

@ -1152,7 +1152,7 @@ const setFirewallRuleHandler = function(ev) {
/******************************************************************************/
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.
if ( popupData.hasUnprocessedRequest === true ) {
messaging.send('popupPanel', {

View File

@ -877,7 +877,7 @@ const filterToDOMInterface = (( ) => {
/******************************************************************************/
const onOptmizeCandidates = function(details) {
const onOptimizeCandidates = function(details) {
const { candidates } = details;
const results = [];
for ( const paths of candidates ) {
@ -1165,7 +1165,7 @@ const onDialogMessage = function(msg) {
}
break;
case 'optimizeCandidates':
onOptmizeCandidates(msg);
onOptimizeCandidates(msg);
break;
case 'dialogCreate':
filterToDOMInterface.queryAll(msg);

View File

@ -25,7 +25,7 @@
// to "should inject content scripts?"
//
// 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 {

View File

@ -103,9 +103,9 @@ const typeNameToTypeValue = {
'beacon': 10 << TypeBitsOffset,
'ping': 10 << TypeBitsOffset,
'other': 11 << TypeBitsOffset,
'popup': 12 << TypeBitsOffset, // start of behavorial filtering
'popup': 12 << TypeBitsOffset, // start of behavioral filtering
'popunder': 13 << TypeBitsOffset,
'main_frame': 14 << TypeBitsOffset, // start of 1p behavorial filtering
'main_frame': 14 << TypeBitsOffset, // start of 1p behavioral filtering
'generichide': 15 << TypeBitsOffset,
'specifichide': 16 << TypeBitsOffset,
'inline-font': 17 << TypeBitsOffset,
@ -2715,20 +2715,20 @@ class FilterBucket extends FilterCollection {
const isrccollection = filterData[idata+1];
const candidates = [];
this.forEach(idata, iunit => {
if ( fc.canCoallesce(iunit) === false ) { return; }
if ( fc.canCoalesce(iunit) === false ) { return; }
candidates.push(iunit);
});
if ( candidates.length < min ) { return 0; }
const idesbucket = FilterBucket.create();
const idescollection = filterData[idesbucket+1];
let coallesced;
let coalesced;
let isrcseq = filterData[isrccollection+1];
let iprev = 0;
for (;;) {
const iunit = filterData[isrcseq+0];
const inext = filterData[isrcseq+1];
if ( candidates.includes(iunit) ) {
coallesced = fc.coallesce(iunit, coallesced);
coalesced = fc.coalesce(iunit, coalesced);
// move the sequence slot to new bucket
filterData[isrcseq+1] = filterData[idescollection+1];
filterData[idescollection+1] = isrcseq;
@ -2745,7 +2745,7 @@ class FilterBucket extends FilterCollection {
if ( inext === 0 ) { break; }
isrcseq = inext;
}
return fc.create(coallesced, idesbucket);
return fc.create(coalesced, idesbucket);
}
static dumpInfo(idata) {
@ -2802,28 +2802,28 @@ class FilterBucketIfOriginHits extends FilterBucketIf {
return filterMatch(filterData[idata+2]);
}
static canCoallesce(iunit) {
static canCoalesce(iunit) {
return filterHasOriginHit(iunit);
}
static coallesce(iunit, coallesced) {
if ( coallesced === undefined ) {
coallesced = new Set();
static coalesce(iunit, coalesced) {
if ( coalesced === undefined ) {
coalesced = new Set();
}
const domainOpt = filterGetDomainOpt(iunit);
if ( domainOpt.includes('|') ) {
for ( const hn of domainOptIterator.reset(domainOpt) ) {
coallesced.add(hn);
coalesced.add(hn);
}
} else {
coallesced.add(domainOpt);
coalesced.add(domainOpt);
}
return coallesced;
return coalesced;
}
static create(coallesced, ibucket) {
static create(coalesced, ibucket) {
const units = [];
compileFromDomainOpt(coallesced, false, units);
compileFromDomainOpt(coalesced, false, units);
const ihittest = filterFromCompiled(units[0]);
const ipretest = super.create(
FilterBucketIfOriginHits.fid,
@ -2843,23 +2843,23 @@ class FilterBucketIfRegexHits extends FilterBucketIf {
return filterRefs[filterData[idata+2]].test($requestURLRaw);
}
static canCoallesce(iunit) {
static canCoalesce(iunit) {
const fc = filterGetClass(iunit);
if ( fc.hasRegexPattern === undefined ) { return false; }
if ( fc.hasRegexPattern(iunit) !== true ) { return false; }
return true;
}
static coallesce(iunit, coallesced) {
if ( coallesced === undefined ) {
coallesced = new Set();
static coalesce(iunit, coalesced) {
if ( coalesced === undefined ) {
coalesced = new Set();
}
coallesced.add(filterGetRegexPattern(iunit));
return coallesced;
coalesced.add(filterGetRegexPattern(iunit));
return coalesced;
}
static create(coallesced, ibucket) {
const reString = Array.from(coallesced).join('|');
static create(coalesced, ibucket) {
const reString = Array.from(coalesced).join('|');
return super.create(
FilterBucketIfRegexHits.fid,
ibucket,
@ -2877,7 +2877,7 @@ registerFilterClass(FilterBucketIfRegexHits);
/******************************************************************************/
class FilterStrictParty {
// TODO: diregard `www.`?
// TODO: disregard `www.`?
static match(idata) {
return ($requestHostname === $docHostname) === (filterData[idata+1] === 0);
}
@ -5026,7 +5026,7 @@ FilterContainer.prototype.matchAndFetchModifiers = function(
}
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 ) {
for ( const key of toAddImportant.keys() ) {
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
* 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) {
let typeBits = typeNameToTypeValue[fctxt.type];

View File

@ -13,7 +13,7 @@ https://github.com/gorhill/lz4-wasm
### `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.
If the chosen implementation is not specified, there will be an attempt to
@ -26,13 +26,13 @@ used.
### `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
ensuring that no code outside the package is loaded.
### `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
for whatever reason.

View File

@ -1,7 +1,7 @@
/*******************************************************************************
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.
Copyright (C) 2018 Raymond Hill

View File

@ -95,7 +95,7 @@
;;
;; 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
;; of the compressor.
@ -462,7 +462,7 @@
i32.eq
br_if 0
end end
local.get $outPtr ;; copy literals to ouput buffer
local.get $outPtr ;; copy literals to output buffer
local.get $inPtr
local.get $clen
call $copy
@ -523,7 +523,7 @@
i32.eq
br_if 0
end end
local.get $outPtr ;; copy match to ouput buffer
local.get $outPtr ;; copy match to output buffer
local.get $matchPtr
local.get $clen
call $copy