File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 367367// When no "prune paths" argument is provided, the scriptlet is
368368// used for logging purpose and the "needle paths" argument is
369369// 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+ //
370374( function ( ) {
371375 const rawPrunePaths = '{{1}}' ;
372376 const rawNeedlePaths = '{{2}}' ;
401405 }
402406 const pos = chain . indexOf ( '.' ) ;
403407 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 ) ) {
407417 delete owner [ chain ] ;
408418 }
409419 return true ;
You can’t perform that action at this time.
0 commit comments