mirror of https://github.com/gorhill/uBlock.git
Fix handling of negated types in `all` filter option
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1730
Related commit:
- 8f98622374
This commit is contained in:
parent
6d21bd4af9
commit
a6cd954a2a
|
@ -3546,15 +3546,17 @@ class FilterCompiler {
|
||||||
|
|
||||||
compileToAtomicFilter(fdata, writer) {
|
compileToAtomicFilter(fdata, writer) {
|
||||||
const catBits = this.action | this.party;
|
const catBits = this.action | this.party;
|
||||||
let { typeBits } = this;
|
let { notTypeBits, typeBits } = this;
|
||||||
|
|
||||||
// Typeless
|
// Typeless
|
||||||
if ( typeBits === 0 ) {
|
if ( typeBits === 0 ) {
|
||||||
writer.push([ catBits, this.tokenHash, fdata ]);
|
writer.push([ catBits, this.tokenHash, fdata ]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If all network types are set, create a typeless filter
|
// If all network types are set, create a typeless filter. Excluded
|
||||||
if ( (typeBits & allNetworkTypesBits) === allNetworkTypesBits ) {
|
// network types are tested at match time, se we act as if they are
|
||||||
|
// set.
|
||||||
|
if ( ((typeBits | notTypeBits) & allNetworkTypesBits) === allNetworkTypesBits ) {
|
||||||
writer.push([ catBits, this.tokenHash, fdata ]);
|
writer.push([ catBits, this.tokenHash, fdata ]);
|
||||||
typeBits &= ~allNetworkTypesBits;
|
typeBits &= ~allNetworkTypesBits;
|
||||||
if ( typeBits === 0 ) { return; }
|
if ( typeBits === 0 ) { return; }
|
||||||
|
|
Loading…
Reference in New Issue