File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 367
367
// When no "prune paths" argument is provided, the scriptlet is
368
368
// used for logging purpose and the "needle paths" argument is
369
369
// used to filter logging output.
370
+ //
371
+ // https://github.com/uBlockOrigin/uBlock-issues/issues/1545
372
+ // - Add support for "remove everything if needle matches" case
373
+ //
370
374
( function ( ) {
371
375
const rawPrunePaths = '{{1}}' ;
372
376
const rawNeedlePaths = '{{2}}' ;
401
405
}
402
406
const pos = chain . indexOf ( '.' ) ;
403
407
if ( pos === - 1 ) {
404
- const found = owner . hasOwnProperty ( chain ) ;
405
- if ( found === false ) { return false ; }
406
- if ( prune ) {
408
+ if ( prune === false ) {
409
+ return owner . hasOwnProperty ( chain ) ;
410
+ }
411
+ if ( chain === '*' ) {
412
+ for ( const key in owner ) {
413
+ if ( owner . hasOwnProperty ( key ) === false ) { continue ; }
414
+ delete owner [ key ] ;
415
+ }
416
+ } else if ( owner . hasOwnProperty ( chain ) ) {
407
417
delete owner [ chain ] ;
408
418
}
409
419
return true ;
You can’t perform that action at this time.
0 commit comments