mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix how *$, |https://, http:// filters are reported in logger
This was a regression introduced in
3f3a1543ea
Reported in issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/528#issuecomment-485163348
This commit is contained in:
parent
a52b07ff6e
commit
537271f26b
1 changed files with 15 additions and 13 deletions
|
|
@ -1190,7 +1190,8 @@ const FilterJustOrigin = class {
|
||||||
return {
|
return {
|
||||||
raw: '*',
|
raw: '*',
|
||||||
regex: '^',
|
regex: '^',
|
||||||
compiled: this.h
|
compiled: this.h,
|
||||||
|
opts: `domain=${this.h}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1213,11 +1214,10 @@ const FilterHTTPSJustOrigin = class extends FilterJustOrigin {
|
||||||
}
|
}
|
||||||
|
|
||||||
logData() {
|
logData() {
|
||||||
return {
|
const out = super.logData();
|
||||||
raw: '|https://',
|
out.raw = '|https://';
|
||||||
regex: '^https://',
|
out.regex = '^https://';
|
||||||
compiled: this.h
|
return out;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static load(args) {
|
static load(args) {
|
||||||
|
|
@ -1235,11 +1235,10 @@ const FilterHTTPJustOrigin = class extends FilterJustOrigin {
|
||||||
}
|
}
|
||||||
|
|
||||||
logData() {
|
logData() {
|
||||||
return {
|
const out = super.logData();
|
||||||
raw: '|http://',
|
out.raw = '|https://';
|
||||||
regex: '^http://',
|
out.regex = '^https://';
|
||||||
compiled: this.h
|
return out;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static load(args) {
|
static load(args) {
|
||||||
|
|
@ -1258,8 +1257,6 @@ const FilterPair = class {
|
||||||
}
|
}
|
||||||
|
|
||||||
get size() {
|
get size() {
|
||||||
if ( this.f1 === undefined && this.f2 === undefined ) { return 0; }
|
|
||||||
if ( this.f1 === undefined || this.f2 === undefined ) { return 1; }
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2928,6 +2925,11 @@ FilterContainer.prototype.bucketHistogram = function() {
|
||||||
const results = [];
|
const results = [];
|
||||||
for ( const [ bits, category ] of this.categories ) {
|
for ( const [ bits, category ] of this.categories ) {
|
||||||
for ( const [ th, f ] of category ) {
|
for ( const [ th, f ] of category ) {
|
||||||
|
if ( f instanceof FilterPair ) {
|
||||||
|
const token = µBlock.urlTokenizer.stringFromTokenHash(th);
|
||||||
|
results.push({ bits: bits.toString(16), token, size: f.size, f });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ( f instanceof FilterBucket ) {
|
if ( f instanceof FilterBucket ) {
|
||||||
const token = µBlock.urlTokenizer.stringFromTokenHash(th);
|
const token = µBlock.urlTokenizer.stringFromTokenHash(th);
|
||||||
results.push({ bits: bits.toString(16), token, size: f.size, f });
|
results.push({ bits: bits.toString(16), token, size: f.size, f });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue