File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 12701270} ) ( ) ;
12711271
12721272
1273+ // https://github.com/uBlockOrigin/uAssets/issues/10323#issuecomment-992312847
1274+ // https://github.com/AdguardTeam/Scriptlets/issues/158
1275+ /// window-close-if.js
1276+ ( function ( ) {
1277+ const arg1 = '{{1}}' ;
1278+ let reStr ;
1279+ if ( arg1 === '{{1}}' || arg1 === '' ) {
1280+ reStr = '^' ;
1281+ } else if ( arg1 . startWith ( '/' ) && arg1 . endsWith ( '/' ) ) {
1282+ reStr = arg1 . slice ( 1 , - 1 ) ;
1283+ } else {
1284+ reStr = arg1 . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' ) ;
1285+ }
1286+ try {
1287+ const re = new RegExp ( reStr ) ;
1288+ if ( re . test ( `${ window . location . pathname } ${ window . location . search } ` ) ) {
1289+ window . close ( ) ;
1290+ }
1291+ } catch ( ex ) {
1292+ console . log ( ex ) ;
1293+ }
1294+ } ) ( ) ;
1295+
1296+
12731297// https://github.com/gorhill/uBlock/issues/1228
12741298/// window.name-defuser
12751299( function ( ) {
You can’t perform that action at this time.
0 commit comments