Skip to content

Commit 7bd1169

Browse files
author
Atlassian Bamboo
committed
deploy: update dist
1 parent 9e0a911 commit 7bd1169

File tree

5 files changed

+269
-7
lines changed

5 files changed

+269
-7
lines changed

dist/build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=1.6.15
1+
version=1.6.18

dist/redirects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# AdGuard Scriptlets (Redirects Source)
3-
# Version 1.6.15
3+
# Version 1.6.18
44
#
55
- title: 1x1-transparent.gif
66
description: |-

dist/scriptlets.corelibs.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.6.15",
2+
"version": "1.6.18",
33
"scriptlets": [
44
{
55
"names": [
@@ -439,6 +439,12 @@
439439
"prevent-element-src-loading"
440440
],
441441
"scriptlet": "function preventElementSrcLoading(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)}}var updatedArgs=args?[].concat(source).concat(args):[source];try{(function(source,tagName,match){if(\"undefined\"!=typeof Proxy&&\"undefined\"!=typeof Reflect){var instance,policy,srcMockData={script:\"data:text/javascript;base64,KCk9Pnt9\",img:\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\",iframe:\"data:text/html;base64, PGRpdj48L2Rpdj4=\"};if(\"script\"===tagName)instance=HTMLScriptElement;else if(\"img\"===tagName)instance=HTMLImageElement;else{if(\"iframe\"!==tagName)return;instance=HTMLIFrameElement}window.trustedTypes&&\"function\"==typeof window.trustedTypes.createPolicy&&(policy=window.trustedTypes.createPolicy(\"mock\",{createScriptURL:function(arg){return arg}}));var searchRegexp=function(){var input=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\",FORWARD_SLASH=\"/\";if(\"\"===input)return new RegExp(\".?\");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)}(match),setAttributeHandler={apply:function(target,thisArg,args){if(!args[0]||!args[1])return Reflect.apply(target,thisArg,args);var nodeName=thisArg.nodeName.toLowerCase(),attrName=args[0].toLowerCase(),attrValue=args[1];return\"src\"===attrName&&tagName.toLowerCase()===nodeName&&srcMockData[nodeName]&&searchRegexp.test(attrValue)?(hit(source),Reflect.apply(target,thisArg,[attrName,srcMockData[nodeName]])):Reflect.apply(target,thisArg,args)}};instance.prototype.setAttribute=new Proxy(Element.prototype.setAttribute,setAttributeHandler);var origDescriptor=(obj=instance.prototype,prop=\"src\",(descriptor=Object.getOwnPropertyDescriptor(obj,prop))&&descriptor.configurable?descriptor:null);origDescriptor&&Object.defineProperty(instance.prototype,\"src\",{enumerable:!0,configurable:!0,get:function(){return origDescriptor.get.call(this)},set:function(urlValue){var nodeName=this.nodeName.toLowerCase();if(tagName.toLowerCase()===nodeName&&srcMockData[nodeName]&&searchRegexp.test(urlValue)){if(policy&&urlValue instanceof TrustedScriptURL){var trustedSrc=policy.createScriptURL(urlValue);return origDescriptor.set.call(this,trustedSrc),void hit(source)}origDescriptor.set.call(this,srcMockData[nodeName]),hit(source)}else origDescriptor.set.call(this,urlValue)}})}var obj,prop,descriptor}).apply(this,updatedArgs)}catch(e){console.log(e)}}"
442+
},
443+
{
444+
"names": [
445+
"no-topics"
446+
],
447+
"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)}}"
442448
}
443449
]
444450
}

dist/scriptlets.js

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
33
* AdGuard Scriptlets
4-
* Version 1.6.15
4+
* Version 1.6.18
55
*/
66

77
(function () {
@@ -5961,6 +5961,41 @@
59615961
preventElementSrcLoading$1.names = ['prevent-element-src-loading'];
59625962
preventElementSrcLoading$1.injections = [hit, toRegExp, safeGetDescriptor];
59635963

5964+
/**
5965+
* @scriptlet no-topics
5966+
*
5967+
* @description
5968+
* Prevents using The Topics API
5969+
* https://developer.chrome.com/docs/privacy-sandbox/topics/
5970+
*
5971+
* **Syntax**
5972+
* ```
5973+
* example.org#%#//scriptlet('no-topics')
5974+
* ```
5975+
*/
5976+
5977+
function noTopics$1(source) {
5978+
var TOPICS_PROPERTY_NAME = 'browsingTopics';
5979+
5980+
if (Document instanceof Object === false) {
5981+
return;
5982+
}
5983+
5984+
if (!Object.prototype.hasOwnProperty.call(Document.prototype, TOPICS_PROPERTY_NAME) || Document.prototype[TOPICS_PROPERTY_NAME] instanceof Function === false) {
5985+
return;
5986+
} // document.browsingTopics() is async function so it's better to return noopPromiseResolve()
5987+
// https://github.com/patcg-individual-drafts/topics#the-api-and-how-it-works
5988+
5989+
5990+
Document.prototype[TOPICS_PROPERTY_NAME] = function () {
5991+
return noopPromiseResolve('[]');
5992+
};
5993+
5994+
hit(source);
5995+
}
5996+
noTopics$1.names = ['no-topics'];
5997+
noTopics$1.injections = [hit, noopPromiseResolve];
5998+
59645999
/**
59656000
* This file must export all scriptlets which should be accessible
59666001
*/
@@ -6011,7 +6046,8 @@
60116046
preventXHR: preventXHR$1,
60126047
forceWindowClose: forceWindowClose$1,
60136048
preventRefresh: preventRefresh$1,
6014-
preventElementSrcLoading: preventElementSrcLoading$1
6049+
preventElementSrcLoading: preventElementSrcLoading$1,
6050+
noTopics: noTopics$1
60156051
});
60166052

60176053
/**
@@ -16119,6 +16155,97 @@
1611916155
}
1612016156
}
1612116157

16158+
function noTopics(source, args) {
16159+
function noTopics(source) {
16160+
var TOPICS_PROPERTY_NAME = "browsingTopics";
16161+
16162+
if (Document instanceof Object === false) {
16163+
return;
16164+
}
16165+
16166+
if (!Object.prototype.hasOwnProperty.call(Document.prototype, TOPICS_PROPERTY_NAME) || Document.prototype[TOPICS_PROPERTY_NAME] instanceof Function === false) {
16167+
return;
16168+
}
16169+
16170+
Document.prototype[TOPICS_PROPERTY_NAME] = function () {
16171+
return noopPromiseResolve("[]");
16172+
};
16173+
16174+
hit(source);
16175+
}
16176+
16177+
function hit(source, message) {
16178+
if (source.verbose !== true) {
16179+
return;
16180+
}
16181+
16182+
try {
16183+
var log = console.log.bind(console);
16184+
var trace = console.trace.bind(console);
16185+
var prefix = source.ruleText || "";
16186+
16187+
if (source.domainName) {
16188+
var AG_SCRIPTLET_MARKER = "#%#//";
16189+
var UBO_SCRIPTLET_MARKER = "##+js";
16190+
var ruleStartIndex;
16191+
16192+
if (source.ruleText.indexOf(AG_SCRIPTLET_MARKER) > -1) {
16193+
ruleStartIndex = source.ruleText.indexOf(AG_SCRIPTLET_MARKER);
16194+
} else if (source.ruleText.indexOf(UBO_SCRIPTLET_MARKER) > -1) {
16195+
ruleStartIndex = source.ruleText.indexOf(UBO_SCRIPTLET_MARKER);
16196+
}
16197+
16198+
var rulePart = source.ruleText.slice(ruleStartIndex);
16199+
prefix = "".concat(source.domainName).concat(rulePart);
16200+
}
16201+
16202+
var LOG_MARKER = "log: ";
16203+
16204+
if (message) {
16205+
if (message.indexOf(LOG_MARKER) === -1) {
16206+
log("".concat(prefix, " message:\n").concat(message));
16207+
} else {
16208+
log(message.slice(LOG_MARKER.length));
16209+
}
16210+
}
16211+
16212+
log("".concat(prefix, " trace start"));
16213+
16214+
if (trace) {
16215+
trace();
16216+
}
16217+
16218+
log("".concat(prefix, " trace end"));
16219+
} catch (e) {}
16220+
16221+
if (typeof window.__debug === "function") {
16222+
window.__debug(source);
16223+
}
16224+
}
16225+
16226+
function noopPromiseResolve() {
16227+
var responseBody = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "{}";
16228+
16229+
if (typeof Response === "undefined") {
16230+
return;
16231+
}
16232+
16233+
var response = new Response(responseBody, {
16234+
status: 200,
16235+
statusText: "OK"
16236+
});
16237+
return Promise.resolve(response);
16238+
}
16239+
16240+
var updatedArgs = args ? [].concat(source).concat(args) : [source];
16241+
16242+
try {
16243+
noTopics.apply(this, updatedArgs);
16244+
} catch (e) {
16245+
console.log(e);
16246+
}
16247+
}
16248+
1612216249
function noeval(source, args) {
1612316250
function noeval(source) {
1612416251
window.eval = function evalWrapper(s) {
@@ -20674,6 +20801,7 @@
2067420801
"ubo-aell": logAddEventListener,
2067520802
"log-eval": logEval,
2067620803
"log-on-stack-trace": logOnStacktrace,
20804+
"no-topics": noTopics,
2067720805
noeval: noeval,
2067820806
"noeval.js": noeval,
2067920807
"silent-noeval.js": noeval,

dist/umd/scriptlets.umd.js

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/**
33
* AdGuard Scriptlets
4-
* Version 1.6.15
4+
* Version 1.6.18
55
*/
66

77
(function (factory) {
@@ -5963,6 +5963,41 @@
59635963
preventElementSrcLoading$1.names = ['prevent-element-src-loading'];
59645964
preventElementSrcLoading$1.injections = [hit, toRegExp, safeGetDescriptor];
59655965

5966+
/**
5967+
* @scriptlet no-topics
5968+
*
5969+
* @description
5970+
* Prevents using The Topics API
5971+
* https://developer.chrome.com/docs/privacy-sandbox/topics/
5972+
*
5973+
* **Syntax**
5974+
* ```
5975+
* example.org#%#//scriptlet('no-topics')
5976+
* ```
5977+
*/
5978+
5979+
function noTopics$1(source) {
5980+
var TOPICS_PROPERTY_NAME = 'browsingTopics';
5981+
5982+
if (Document instanceof Object === false) {
5983+
return;
5984+
}
5985+
5986+
if (!Object.prototype.hasOwnProperty.call(Document.prototype, TOPICS_PROPERTY_NAME) || Document.prototype[TOPICS_PROPERTY_NAME] instanceof Function === false) {
5987+
return;
5988+
} // document.browsingTopics() is async function so it's better to return noopPromiseResolve()
5989+
// https://github.com/patcg-individual-drafts/topics#the-api-and-how-it-works
5990+
5991+
5992+
Document.prototype[TOPICS_PROPERTY_NAME] = function () {
5993+
return noopPromiseResolve('[]');
5994+
};
5995+
5996+
hit(source);
5997+
}
5998+
noTopics$1.names = ['no-topics'];
5999+
noTopics$1.injections = [hit, noopPromiseResolve];
6000+
59666001
/**
59676002
* This file must export all scriptlets which should be accessible
59686003
*/
@@ -6013,7 +6048,8 @@
60136048
preventXHR: preventXHR$1,
60146049
forceWindowClose: forceWindowClose$1,
60156050
preventRefresh: preventRefresh$1,
6016-
preventElementSrcLoading: preventElementSrcLoading$1
6051+
preventElementSrcLoading: preventElementSrcLoading$1,
6052+
noTopics: noTopics$1
60176053
});
60186054

60196055
/**
@@ -16121,6 +16157,97 @@
1612116157
}
1612216158
}
1612316159

16160+
function noTopics(source, args) {
16161+
function noTopics(source) {
16162+
var TOPICS_PROPERTY_NAME = "browsingTopics";
16163+
16164+
if (Document instanceof Object === false) {
16165+
return;
16166+
}
16167+
16168+
if (!Object.prototype.hasOwnProperty.call(Document.prototype, TOPICS_PROPERTY_NAME) || Document.prototype[TOPICS_PROPERTY_NAME] instanceof Function === false) {
16169+
return;
16170+
}
16171+
16172+
Document.prototype[TOPICS_PROPERTY_NAME] = function () {
16173+
return noopPromiseResolve("[]");
16174+
};
16175+
16176+
hit(source);
16177+
}
16178+
16179+
function hit(source, message) {
16180+
if (source.verbose !== true) {
16181+
return;
16182+
}
16183+
16184+
try {
16185+
var log = console.log.bind(console);
16186+
var trace = console.trace.bind(console);
16187+
var prefix = source.ruleText || "";
16188+
16189+
if (source.domainName) {
16190+
var AG_SCRIPTLET_MARKER = "#%#//";
16191+
var UBO_SCRIPTLET_MARKER = "##+js";
16192+
var ruleStartIndex;
16193+
16194+
if (source.ruleText.indexOf(AG_SCRIPTLET_MARKER) > -1) {
16195+
ruleStartIndex = source.ruleText.indexOf(AG_SCRIPTLET_MARKER);
16196+
} else if (source.ruleText.indexOf(UBO_SCRIPTLET_MARKER) > -1) {
16197+
ruleStartIndex = source.ruleText.indexOf(UBO_SCRIPTLET_MARKER);
16198+
}
16199+
16200+
var rulePart = source.ruleText.slice(ruleStartIndex);
16201+
prefix = "".concat(source.domainName).concat(rulePart);
16202+
}
16203+
16204+
var LOG_MARKER = "log: ";
16205+
16206+
if (message) {
16207+
if (message.indexOf(LOG_MARKER) === -1) {
16208+
log("".concat(prefix, " message:\n").concat(message));
16209+
} else {
16210+
log(message.slice(LOG_MARKER.length));
16211+
}
16212+
}
16213+
16214+
log("".concat(prefix, " trace start"));
16215+
16216+
if (trace) {
16217+
trace();
16218+
}
16219+
16220+
log("".concat(prefix, " trace end"));
16221+
} catch (e) {}
16222+
16223+
if (typeof window.__debug === "function") {
16224+
window.__debug(source);
16225+
}
16226+
}
16227+
16228+
function noopPromiseResolve() {
16229+
var responseBody = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "{}";
16230+
16231+
if (typeof Response === "undefined") {
16232+
return;
16233+
}
16234+
16235+
var response = new Response(responseBody, {
16236+
status: 200,
16237+
statusText: "OK"
16238+
});
16239+
return Promise.resolve(response);
16240+
}
16241+
16242+
var updatedArgs = args ? [].concat(source).concat(args) : [source];
16243+
16244+
try {
16245+
noTopics.apply(this, updatedArgs);
16246+
} catch (e) {
16247+
console.log(e);
16248+
}
16249+
}
16250+
1612416251
function noeval(source, args) {
1612516252
function noeval(source) {
1612616253
window.eval = function evalWrapper(s) {
@@ -20676,6 +20803,7 @@
2067620803
"ubo-aell": logAddEventListener,
2067720804
"log-eval": logEval,
2067820805
"log-on-stack-trace": logOnStacktrace,
20806+
"no-topics": noTopics,
2067920807
noeval: noeval,
2068020808
"noeval.js": noeval,
2068120809
"silent-noeval.js": noeval,

0 commit comments

Comments
 (0)