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) {
|
||||
const catBits = this.action | this.party;
|
||||
let { typeBits } = this;
|
||||
let { notTypeBits, typeBits } = this;
|
||||
|
||||
// Typeless
|
||||
if ( typeBits === 0 ) {
|
||||
writer.push([ catBits, this.tokenHash, fdata ]);
|
||||
return;
|
||||
}
|
||||
// If all network types are set, create a typeless filter
|
||||
if ( (typeBits & allNetworkTypesBits) === allNetworkTypesBits ) {
|
||||
// If all network types are set, create a typeless filter. Excluded
|
||||
// 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 ]);
|
||||
typeBits &= ~allNetworkTypesBits;
|
||||
if ( typeBits === 0 ) { return; }
|
||||
|
|
Loading…
Reference in New Issue