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 1270
1270
} ) ( ) ;
1271
1271
1272
1272
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
+
1273
1297
// https://github.com/gorhill/uBlock/issues/1228
1274
1298
/// window.name-defuser
1275
1299
( function ( ) {
You can’t perform that action at this time.
0 commit comments