This commit is contained in:
SukkaW
2024-11-25 09:47:33 +00:00
parent 4f27b4a9ae
commit 7a82202aab
4 changed files with 136 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
! Title: Sukka's Ruleset - Blocklist for AdGuardHome
! Last modified: Mon, 25 Nov 2024 09:14:48 GMT
! Last modified: Mon, 25 Nov 2024 09:47:00 GMT
! Expires: 6 hours
! License: https://github.com/SukkaW/Surge/blob/master/LICENSE
! Homepage: https://github.com/SukkaW/Surge

View File

@@ -0,0 +1,132 @@
(() => {
'use strict';
// https://developers.google.com/doubleclick-gpt/reference
const noopfn = function () {
// noop
}.bind();
const noopthisfn = function () {
return this;
};
const noopnullfn = function () {
return null;
};
const nooparrayfn = function () {
return [];
};
const noopstrfn = function () {
return '';
};
//
const companionAdsService = {
addEventListener: noopthisfn,
enableSyncLoading: noopfn,
setRefreshUnfilledSlots: noopfn
};
const contentService = {
addEventListener: noopthisfn,
setContent: noopfn
};
const PassbackSlot = noopfn;
let p = PassbackSlot.prototype;
p.display = noopfn;
p.get = noopnullfn;
p.set = noopthisfn;
p.setClickUrl = noopthisfn;
p.setTagForChildDirectedTreatment = noopthisfn;
p.setTargeting = noopthisfn;
p.updateTargetingFromMap = noopthisfn;
const pubAdsService = {
addEventListener: noopthisfn,
clear: noopfn,
clearCategoryExclusions: noopthisfn,
clearTagForChildDirectedTreatment: noopthisfn,
clearTargeting: noopthisfn,
collapseEmptyDivs: noopfn,
defineOutOfPagePassback() { return new PassbackSlot(); },
definePassback() { return new PassbackSlot(); },
disableInitialLoad: noopfn,
display: noopfn,
enableAsyncRendering: noopfn,
enableLazyLoad: noopfn,
enableSingleRequest: noopfn,
enableSyncRendering: noopfn,
enableVideoAds: noopfn,
get: noopnullfn,
getAttributeKeys: nooparrayfn,
getTargeting: nooparrayfn,
getTargetingKeys: nooparrayfn,
getSlots: nooparrayfn,
refresh: noopfn,
removeEventListener: noopfn,
set: noopthisfn,
setCategoryExclusion: noopthisfn,
setCentering: noopfn,
setCookieOptions: noopthisfn,
setForceSafeFrame: noopthisfn,
setLocation: noopthisfn,
setPublisherProvidedId: noopthisfn,
setPrivacySettings: noopthisfn,
setRequestNonPersonalizedAds: noopthisfn,
setSafeFrameConfig: noopthisfn,
setTagForChildDirectedTreatment: noopthisfn,
setTargeting: noopthisfn,
setVideoContent: noopthisfn,
updateCorrelator: noopfn
};
const SizeMappingBuilder = noopfn;
p = SizeMappingBuilder.prototype;
p.addSize = noopthisfn;
p.build = noopnullfn;
const Slot = noopfn;
p = Slot.prototype;
p.addService = noopthisfn;
p.clearCategoryExclusions = noopthisfn;
p.clearTargeting = noopthisfn;
p.defineSizeMapping = noopthisfn;
p.get = noopnullfn;
p.getAdUnitPath = nooparrayfn;
p.getAttributeKeys = nooparrayfn;
p.getCategoryExclusions = nooparrayfn;
p.getDomId = noopstrfn;
p.getResponseInformation = noopnullfn;
p.getSlotElementId = noopstrfn;
p.getSlotId = noopthisfn;
p.getTargeting = nooparrayfn;
p.getTargetingKeys = nooparrayfn;
p.set = noopthisfn;
p.setCategoryExclusion = noopthisfn;
p.setClickUrl = noopthisfn;
p.setCollapseEmptyDiv = noopthisfn;
p.setTargeting = noopthisfn;
p.updateTargetingFromMap = noopthisfn;
//
const gpt = window.googletag || {};
const cmd = gpt.cmd || [];
gpt.apiReady = true;
gpt.cmd = [];
gpt.cmd.push = function (a) {
try {
a();
} catch {
}
return 1;
};
gpt.companionAds = function () { return companionAdsService; };
gpt.content = function () { return contentService; };
gpt.defineOutOfPageSlot = function () { return new Slot(); };
gpt.defineSlot = function () { return new Slot(); };
gpt.destroySlots = noopfn;
gpt.disablePublisherConsole = noopfn;
gpt.display = noopfn;
gpt.enableServices = noopfn;
gpt.getVersion = noopstrfn;
gpt.pubads = function () { return pubAdsService; };
gpt.pubadsReady = true;
gpt.setAdIframeTitle = noopfn;
gpt.sizeMapping = function () { return new SizeMappingBuilder(); };
window.googletag = gpt;
while (cmd.length !== 0) {
gpt.cmd.push(cmd.shift());
}
})();

View File

@@ -18,3 +18,4 @@ hostname = %APPEND% *.google-analytics.com, *.googletagmanager.com, *.googlesynd
^https?://.+\.amazon-adsystem\.com/aax2/apstag\.js https://ruleset.skk.moe/Mock/amazon-adsystem-com_amazon-apstag.js 302
^https?://static\.chartbeat\.com/chartbeat\.js https://ruleset.skk.moe/Mock/static-chartbeat-com_chartbeat_mab.js 302
^https?://widgets\.outbrain\.com/outbrain\.js https://ruleset.skk.moe/Mock/widgets-outbrain-com_outbrain.js 302
^https?://securepubads\.g\.doubleclick\.net/tag/js/gpt\.js https://ruleset.skk.moe/Mock/securepubads-g-doubleclick-net_tag_js_gpt.js 302

View File

@@ -29,7 +29,7 @@
<p>
Made by <a href="https://skk.moe">Sukka</a> | <a href="https://github.com/SukkaW/Surge/">Source @ GitHub</a> | Licensed under <a href="/LICENSE" target="_blank">AGPL-3.0</a>
</p>
<p>Last Build: 2024-11-25T09:14:50.020Z</p>
<p>Last Build: 2024-11-25T09:47:00.983Z</p>
<br>
<ul class="directory-list">
@@ -127,7 +127,7 @@
<li class="folder">
Mock
<ul>
<li><a class="file directory-list-file" href="/Mock/200.array.json">200.array.json</a></li><li><a class="file directory-list-file" href="/Mock/200.json">200.json</a></li><li><a class="file directory-list-file" href="/Mock/200.txt">200.txt</a></li><li><a class="file directory-list-file" href="/Mock/addthis-com_addthis_widget.js">addthis-com_addthis_widget.js</a></li><li><a class="file directory-list-file" href="/Mock/amazon-adsystem-com_amazon-apstag.js">amazon-adsystem-com_amazon-apstag.js</a></li><li><a class="file directory-list-file" href="/Mock/ampproject-org_v0.js">ampproject-org_v0.js</a></li><li><a class="file directory-list-file" href="/Mock/doubleclick-net_instream_ad_status.js">doubleclick-net_instream_ad_status.js</a></li><li><a class="file directory-list-file" href="/Mock/nomo.json">nomo.json</a></li><li><a class="file directory-list-file" href="/Mock/static-chartbeat-com_chartbeat_mab.js">static-chartbeat-com_chartbeat_mab.js</a></li><li><a class="file directory-list-file" href="/Mock/widgets-outbrain-com_outbrain.js">widgets-outbrain-com_outbrain.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_analytics.js">www-google-analytics-com_analytics.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_cx_api.js">www-google-analytics-com_cx_api.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_ga.js">www-google-analytics-com_ga.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_inpage_linkid.js">www-google-analytics-com_inpage_linkid.js</a></li><li><a class="file directory-list-file" href="/Mock/www-googlesyndication-com_adsbygoogle.js">www-googlesyndication-com_adsbygoogle.js</a></li><li><a class="file directory-list-file" href="/Mock/www-googletagservices-com_gpt.js">www-googletagservices-com_gpt.js</a></li>
<li><a class="file directory-list-file" href="/Mock/200.array.json">200.array.json</a></li><li><a class="file directory-list-file" href="/Mock/200.json">200.json</a></li><li><a class="file directory-list-file" href="/Mock/200.txt">200.txt</a></li><li><a class="file directory-list-file" href="/Mock/addthis-com_addthis_widget.js">addthis-com_addthis_widget.js</a></li><li><a class="file directory-list-file" href="/Mock/amazon-adsystem-com_amazon-apstag.js">amazon-adsystem-com_amazon-apstag.js</a></li><li><a class="file directory-list-file" href="/Mock/ampproject-org_v0.js">ampproject-org_v0.js</a></li><li><a class="file directory-list-file" href="/Mock/doubleclick-net_instream_ad_status.js">doubleclick-net_instream_ad_status.js</a></li><li><a class="file directory-list-file" href="/Mock/nomo.json">nomo.json</a></li><li><a class="file directory-list-file" href="/Mock/securepubads-g-doubleclick-net_tag_js_gpt.js">securepubads-g-doubleclick-net_tag_js_gpt.js</a></li><li><a class="file directory-list-file" href="/Mock/static-chartbeat-com_chartbeat_mab.js">static-chartbeat-com_chartbeat_mab.js</a></li><li><a class="file directory-list-file" href="/Mock/widgets-outbrain-com_outbrain.js">widgets-outbrain-com_outbrain.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_analytics.js">www-google-analytics-com_analytics.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_cx_api.js">www-google-analytics-com_cx_api.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_ga.js">www-google-analytics-com_ga.js</a></li><li><a class="file directory-list-file" href="/Mock/www-google-analytics-com_inpage_linkid.js">www-google-analytics-com_inpage_linkid.js</a></li><li><a class="file directory-list-file" href="/Mock/www-googlesyndication-com_adsbygoogle.js">www-googlesyndication-com_adsbygoogle.js</a></li><li><a class="file directory-list-file" href="/Mock/www-googletagservices-com_gpt.js">www-googletagservices-com_gpt.js</a></li>
</ul>
</li>