@@ -2885,10 +2885,8 @@ function noWindowOpenIf(
28852885 pattern = pattern . slice ( 1 ) ;
28862886 }
28872887 const rePattern = safe . patternToRegex ( pattern ) ;
2888- let autoRemoveAfter = parseInt ( delay ) ;
2889- if ( isNaN ( autoRemoveAfter ) ) {
2890- autoRemoveAfter = - 1 ;
2891- }
2888+ const autoRemoveAfter = parseInt ( delay , 10 ) || 0 ;
2889+ const setTimeout = self . setTimeout ;
28922890 const createDecoy = function ( tag , urlProp , url ) {
28932891 const decoyElem = document . createElement ( tag ) ;
28942892 decoyElem [ urlProp ] = url ;
@@ -2909,7 +2907,13 @@ function noWindowOpenIf(
29092907 return Reflect . apply ( target , thisArg , args ) ;
29102908 }
29112909 safe . uboLog ( logPrefix , `Prevented (${ args . join ( ', ' ) } )` ) ;
2912- if ( autoRemoveAfter < 0 ) { return null ; }
2910+ if ( delay === '' ) { return null ; }
2911+ if ( decoy === 'blank' ) {
2912+ args [ 0 ] = 'about:blank' ;
2913+ const r = Reflect . apply ( target , thisArg , args ) ;
2914+ setTimeout ( ( ) => { r . close ( ) ; } , autoRemoveAfter ) ;
2915+ return r ;
2916+ }
29132917 const decoyElem = decoy === 'obj'
29142918 ? createDecoy ( 'object' , 'data' , ...args )
29152919 : createDecoy ( 'iframe' , 'src' , ...args ) ;
0 commit comments