Skip to content

Commit

Permalink
deploy: update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlassian Bamboo committed Jun 2, 2022
1 parent 83f5040 commit 2ee9cd6
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 27 deletions.
2 changes: 1 addition & 1 deletion dist/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.6.18
version=1.6.20
2 changes: 1 addition & 1 deletion dist/redirects.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# AdGuard Scriptlets (Redirects Source)
# Version 1.6.18
# Version 1.6.20
#
- title: 1x1-transparent.gif
description: |-
Expand Down
6 changes: 3 additions & 3 deletions dist/scriptlets.corelibs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.18",
"version": "1.6.20",
"scriptlets": [
{
"names": [
Expand Down Expand Up @@ -422,7 +422,7 @@
"ubo-window-close-if.js",
"ubo-window-close-if"
],
"scriptlet": "function forceWindowClose(source,args){function hit(source,message){if(!0===source.verbose){try{var log=console.log.bind(console),trace=console.trace.bind(console),prefix=source.ruleText||\"\";if(source.domainName){var ruleStartIndex;source.ruleText.indexOf(\"#%#//\")>-1?ruleStartIndex=source.ruleText.indexOf(\"#%#//\"):source.ruleText.indexOf(\"##+js\")>-1&&(ruleStartIndex=source.ruleText.indexOf(\"##+js\"));var rulePart=source.ruleText.slice(ruleStartIndex);prefix=\"\".concat(source.domainName).concat(rulePart)}message&&(-1===message.indexOf(\"log: \")?log(\"\".concat(prefix,\" message:\\n\").concat(message)):log(message.slice(\"log: \".length))),log(\"\".concat(prefix,\" trace start\")),trace&&trace(),log(\"\".concat(prefix,\" trace end\"))}catch(e){}\"function\"==typeof window.__debug&&window.__debug(source)}}function toRegExp(){var input=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",DEFAULT_VALUE=\".?\",FORWARD_SLASH=\"/\";if(\"\"===input)return new RegExp(DEFAULT_VALUE);if(input[0]===FORWARD_SLASH&&input[input.length-1]===FORWARD_SLASH)return new RegExp(input.slice(1,-1));var escaped=input.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");return new RegExp(escaped)}var updatedArgs=args?[].concat(source).concat(args):[source];try{(function(source){var path=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",log=console.log.bind(console);if(\"function\"==typeof window.close){var closeImmediately=function(){try{hit(source),window.close()}catch(e){log(e)}};if(\"\"===path)closeImmediately();else{var pathRegexp=toRegExp(path),currentPath=\"\".concat(window.location.pathname).concat(window.location.search);pathRegexp.test(currentPath)&&closeImmediately()}}else source.verbose&&log(\"window.close() is not a function so 'close-window' scriptlet is unavailable\")}).apply(this,updatedArgs)}catch(e){console.log(e)}}"
"scriptlet": "function forceWindowClose(source,args){function hit(source,message){if(!0===source.verbose){try{var log=console.log.bind(console),trace=console.trace.bind(console),prefix=source.ruleText||\"\";if(source.domainName){var ruleStartIndex;source.ruleText.indexOf(\"#%#//\")>-1?ruleStartIndex=source.ruleText.indexOf(\"#%#//\"):source.ruleText.indexOf(\"##+js\")>-1&&(ruleStartIndex=source.ruleText.indexOf(\"##+js\"));var rulePart=source.ruleText.slice(ruleStartIndex);prefix=\"\".concat(source.domainName).concat(rulePart)}message&&(-1===message.indexOf(\"log: \")?log(\"\".concat(prefix,\" message:\\n\").concat(message)):log(message.slice(\"log: \".length))),log(\"\".concat(prefix,\" trace start\")),trace&&trace(),log(\"\".concat(prefix,\" trace end\"))}catch(e){}\"function\"==typeof window.__debug&&window.__debug(source)}}function toRegExp(){var input=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",DEFAULT_VALUE=\".?\",FORWARD_SLASH=\"/\";if(\"\"===input)return new RegExp(DEFAULT_VALUE);if(input[0]===FORWARD_SLASH&&input[input.length-1]===FORWARD_SLASH)return new RegExp(input.slice(1,-1));var escaped=input.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");return new RegExp(escaped)}var updatedArgs=args?[].concat(source).concat(args):[source];try{(function(source){var path=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",log=console.log.bind(console);if(\"function\"==typeof window.close){var closeImmediately=function(){try{hit(source),window.close()}catch(e){log(e)}},closeByExtension=function(){var extCall=function(){dispatchEvent(new Event(\"adguard:scriptlet-close-window\"))};window.addEventListener(\"adguard:subscribed-to-close-window\",extCall,{once:!0}),setTimeout((function(){window.removeEventListener(\"adguard:subscribed-to-close-window\",extCall,{once:!0})}),5e3)};(function(){if(\"\"===path)return!0;var pathRegexp=toRegExp(path),currentPath=\"\".concat(window.location.pathname).concat(window.location.search);return pathRegexp.test(currentPath)})()&&(closeImmediately(),navigator.userAgent.indexOf(\"Chrome\")>-1&&closeByExtension())}else source.verbose&&log(\"window.close() is not a function so 'close-window' scriptlet is unavailable\")}).apply(this,updatedArgs)}catch(e){console.log(e)}}"
},
{
"names": [
Expand All @@ -447,4 +447,4 @@
"scriptlet": "function noTopics(source,args){var updatedArgs=args?[].concat(source).concat(args):[source];try{(function(source){Document instanceof Object!=0&&Object.prototype.hasOwnProperty.call(Document.prototype,\"browsingTopics\")&&Document.prototype.browsingTopics instanceof Function!=0&&(Document.prototype.browsingTopics=function(){return function(){if(\"undefined\"!=typeof Response){var response=new Response(arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"{}\",{status:200,statusText:\"OK\"});return Promise.resolve(response)}}(\"[]\")},function(source,message){if(!0===source.verbose){try{var log=console.log.bind(console),trace=console.trace.bind(console),prefix=source.ruleText||\"\";if(source.domainName){var ruleStartIndex,AG_SCRIPTLET_MARKER=\"#%#//\",UBO_SCRIPTLET_MARKER=\"##+js\";source.ruleText.indexOf(AG_SCRIPTLET_MARKER)>-1?ruleStartIndex=source.ruleText.indexOf(AG_SCRIPTLET_MARKER):source.ruleText.indexOf(UBO_SCRIPTLET_MARKER)>-1&&(ruleStartIndex=source.ruleText.indexOf(UBO_SCRIPTLET_MARKER));var rulePart=source.ruleText.slice(ruleStartIndex);prefix=\"\".concat(source.domainName).concat(rulePart)}var LOG_MARKER=\"log: \";message&&(-1===message.indexOf(LOG_MARKER)?log(\"\".concat(prefix,\" message:\\n\").concat(message)):log(message.slice(LOG_MARKER.length))),log(\"\".concat(prefix,\" trace start\")),trace&&trace(),log(\"\".concat(prefix,\" trace end\"))}catch(e){}\"function\"==typeof window.__debug&&window.__debug(source)}}(source))}).apply(this,updatedArgs)}catch(e){console.log(e)}}"
}
]
}
}
69 changes: 58 additions & 11 deletions dist/scriptlets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/**
* AdGuard Scriptlets
* Version 1.6.18
* Version 1.6.20
*/

(function () {
Expand Down Expand Up @@ -5648,6 +5648,9 @@
* @description
* Closes the browser tab immediately.
*
* > `window.close()` usage is restricted in Chrome. In this case
* tab will only be closed if using AdGuard browser extension.
*
* **Syntax**
* ```
* example.org#%#//scriptlet('close-window'[, path])
Expand Down Expand Up @@ -5691,14 +5694,36 @@
}
};

if (path === '') {
closeImmediately();
} else {
var closeByExtension = function closeByExtension() {
var extCall = function extCall() {
dispatchEvent(new Event('adguard:scriptlet-close-window'));
};

window.addEventListener('adguard:subscribed-to-close-window', extCall, {
once: true
});
setTimeout(function () {
window.removeEventListener('adguard:subscribed-to-close-window', extCall, {
once: true
});
}, 5000);
};

var shouldClose = function shouldClose() {
if (path === '') {
return true;
}

var pathRegexp = toRegExp(path);
var currentPath = "".concat(window.location.pathname).concat(window.location.search);
return pathRegexp.test(currentPath);
};

if (pathRegexp.test(currentPath)) {
closeImmediately();
if (shouldClose()) {
closeImmediately();

if (navigator.userAgent.indexOf('Chrome') > -1) {
closeByExtension();
}
}
}
Expand Down Expand Up @@ -15184,14 +15209,36 @@
}
};

if (path === "") {
closeImmediately();
} else {
var closeByExtension = function closeByExtension() {
var extCall = function extCall() {
dispatchEvent(new Event("adguard:scriptlet-close-window"));
};

window.addEventListener("adguard:subscribed-to-close-window", extCall, {
once: true
});
setTimeout(function () {
window.removeEventListener("adguard:subscribed-to-close-window", extCall, {
once: true
});
}, 5e3);
};

var shouldClose = function shouldClose() {
if (path === "") {
return true;
}

var pathRegexp = toRegExp(path);
var currentPath = "".concat(window.location.pathname).concat(window.location.search);
return pathRegexp.test(currentPath);
};

if (shouldClose()) {
closeImmediately();

if (pathRegexp.test(currentPath)) {
closeImmediately();
if (navigator.userAgent.indexOf("Chrome") > -1) {
closeByExtension();
}
}
}
Expand Down
69 changes: 58 additions & 11 deletions dist/umd/scriptlets.umd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/**
* AdGuard Scriptlets
* Version 1.6.18
* Version 1.6.20
*/

(function (factory) {
Expand Down Expand Up @@ -5650,6 +5650,9 @@
* @description
* Closes the browser tab immediately.
*
* > `window.close()` usage is restricted in Chrome. In this case
* tab will only be closed if using AdGuard browser extension.
*
* **Syntax**
* ```
* example.org#%#//scriptlet('close-window'[, path])
Expand Down Expand Up @@ -5693,14 +5696,36 @@
}
};

if (path === '') {
closeImmediately();
} else {
var closeByExtension = function closeByExtension() {
var extCall = function extCall() {
dispatchEvent(new Event('adguard:scriptlet-close-window'));
};

window.addEventListener('adguard:subscribed-to-close-window', extCall, {
once: true
});
setTimeout(function () {
window.removeEventListener('adguard:subscribed-to-close-window', extCall, {
once: true
});
}, 5000);
};

var shouldClose = function shouldClose() {
if (path === '') {
return true;
}

var pathRegexp = toRegExp(path);
var currentPath = "".concat(window.location.pathname).concat(window.location.search);
return pathRegexp.test(currentPath);
};

if (pathRegexp.test(currentPath)) {
closeImmediately();
if (shouldClose()) {
closeImmediately();

if (navigator.userAgent.indexOf('Chrome') > -1) {
closeByExtension();
}
}
}
Expand Down Expand Up @@ -15186,14 +15211,36 @@
}
};

if (path === "") {
closeImmediately();
} else {
var closeByExtension = function closeByExtension() {
var extCall = function extCall() {
dispatchEvent(new Event("adguard:scriptlet-close-window"));
};

window.addEventListener("adguard:subscribed-to-close-window", extCall, {
once: true
});
setTimeout(function () {
window.removeEventListener("adguard:subscribed-to-close-window", extCall, {
once: true
});
}, 5e3);
};

var shouldClose = function shouldClose() {
if (path === "") {
return true;
}

var pathRegexp = toRegExp(path);
var currentPath = "".concat(window.location.pathname).concat(window.location.search);
return pathRegexp.test(currentPath);
};

if (shouldClose()) {
closeImmediately();

if (pathRegexp.test(currentPath)) {
closeImmediately();
if (navigator.userAgent.indexOf("Chrome") > -1) {
closeByExtension();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions wiki/about-scriptlets.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ defaults to match all callbacks; invalid regular expression will cause exit and

Closes the browser tab immediately.

> `window.close()` usage is restricted in Chrome. In this case
tab will only be closed if using AdGuard browser extension.

**Syntax**
```
example.org#%#//scriptlet('close-window'[, path])
Expand Down

0 comments on commit 2ee9cd6

Please sign in to comment.