AllowAllRequests for Youtube

174 views
Skip to first unread message

Karim Villard

unread,
May 30, 2024, 9:14:30 AM5/30/24
to Chromium Extensions
Hello,
because of Youtube Anti-Ad block, i want to allow all requests on Youtube for my custom Ad blocker, but the rules i set don't seem to work and everything is still blocked on youtube.
Could you point me in the right direction :
(on top of what's below i have also tried to set requestDomains from id 2 to id 3 and 4 but it did not change anything.

[
{
"id": 2,
"priority": 1,
"action": {"type": "block"},
"condition": {
"resourceTypes":[
"script",
"xmlhttprequest"],
"requestDomains": ["ssl.google-analytics.com","google-analytics.com","click.googleanalytics.com","analytics.google.com","afs.googlesyndication.com","pagead2.googleadservices.com","adservice.google.com","pagead2.googlesyndication.com","mediavisor.doubleclick.net","m.doubleclick.net","static.doubleclick.net","ad.doubleclick.net","stats.g.doubleclick.net","offerwall.yandex.net","static.media.net","media.net","adservetx.media.net","fastclick.com","adtago.s3.amazonaws.com","analyticsengine.s3.amazonaws.com","advice-ads.s3.amazonaws.com","affiliationjs.s3.amazonaws.com","advertising-api-eu.amazon.com","amazonaax.com","amazonclix.com","assoc-amazon.com","hotjar.com","static.hotjar.com","mouseflow.com","a.mouseflow.com","freshmarketer.com","luckyorange.com","cdn.luckyorange.com","w1.luckyorange.com","upload.luckyorange.net","cs.luckyorange.net","settings.luckyorange.net","stats.wp.com","notify.bugsnag.com","sessions.bugsnag.com","api.bugsnag.com","app.bugsnag.com","browser.sentry-cdn.com","app.getsentry.com","pixel.facebook.com","ads.facebook.com","an.facebook.com","ads-api.twitter.com","advertising.twitter.com","ads.linkedin.com","analytics.pointdrive.linkedin.com","ads.pinterest.com","log.pinterest.com","ads-dev.pinterest.com","analytics.pinterest.com","trk.pinterest.com","widgets.pinterest.com","ads.reddit.com","d.reddit.com","rereddit.com","events.redditmedia.com","analytics.tiktok.com","ads.tiktok.com","analytics-sg.tiktok.com","ads-sg.tiktok.com","ads.yahoo.com","global.adserver.yahoo.com","analytics.yahoo.com","ads.yap.yahoo.com","appmetrica.yandex.com","yandexadexchange.net","analytics.mobile.yandex.net","analytics.s3.amazonaws.com","ads30.adcolony.com","adc3-launch.adcolony.com","events3alt.adcolony.com","wd.adcolony.com","app-measurement.com","events.hotjar.io","static.ads-twitter.com","events.reddit.com","ads-api.tiktok.com","business-api.tiktok.com","log.byteoversea.com","geo.yahoo.com","udc.yahoo.com","udcm.yahoo.com","advertising.yahoo.com","analytics.query.yahoo.com","partnerads.ysm.yahoo.com","log.fc.yahoo.com","gemini.yahoo.com","adtech.yahooinc.com","auction.unityads.unity3d.com","webview.unityads.unity3d.com","config.unityads.unity3d.com","adserver.unityads.unity3d.com","extmaps-api.yandex.net","appmetrica.yandex.ru","adfstat.yandex.ru","metrika.yandex.ru","advertising.yandex.ru","adfox.yandex.ru","iot-eu-logser.realme.com","iot-logser.realme.com","bdapi-ads.realmemobile.com","bdapi-in-ads.realmemobile.com","adsfs.oppomobile.com","adx.ads.oppomobile.com","ck.ads.oppomobile.com","ck.ads.oppomobile.com","data.ads.oppomobile.com","click.oneplus.cn","open.oneplus.net","advertising.apple.com","tr.iadsdk.apple.com","iadsdk.apple.com","metrics.icloud.com","metrics.apple.com","metrics.mzstatic.com","api-adservices.apple.com","books-analytics-events.apple.com","weather-analytics-events.apple.com","notes-analytics-events.apple.com","api.ad.xiaomi.com","data.mistat.xiaomi.com","data.mistat.india.xiaomi.com","data.mistat.rus.xiaomi.com","sdkconfig.ad.xiaomi.com","sdkconfig.ad.intl.xiaomi.com","globalapi.ad.xiaomi.com","tracking.rus.miui.com","metrics.data.hicloud.com","metrics2.data.hicloud.com","grs.hicloud.com","logservice.hicloud.com","logservice1.hicloud.com","logbak.hicloud.com","samsungads.com","smetrics.samsung.com","nmetrics.samsung.com","samsung-com.112.2o7.net","analytics-api.samsunghealthcn.com"]
}
},
{
"id": 3,
"priority": 3,
"action": { "type": "allowAllRequests" },
"condition": { "urlFilter": "https://youtube.com", "resourceTypes": ["main_frame","sub_frame"] }
}
,
{
"id": 4,
"priority": 3,
"action": { "type": "allow" },
"condition": { "urlFilter": "https://youtube.com", "resourceTypes": ["script","xmlhttprequest","main_frame","sub_frame"] }
}
]

Karim Villard

unread,
May 30, 2024, 9:39:43 AM5/30/24
to Chromium Extensions
i found my answer, i guess i did not understand the allow, vs excludeDomains so here's the answer for those as confused as me :
 "excludedRequestDomains": ["youtube.com"],
          "excludedInitiatorDomains": ["youtube.com"]

--
You received this message because you are subscribed to a topic in the Google Groups "Chromium Extensions" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-extensions/y1PTqk9LWqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/42525bb1-1d1d-4473-a147-f0e0f267487fn%40chromium.org.

woxxom

unread,
May 30, 2024, 10:12:38 AM5/30/24
to Chromium Extensions, Karim Villard
Indeed, excludedRequestDomains + excludedInitiatorDomains is the proper solution here, but the previous solution could work just as well, but didn't work because you've used the wrong URL in urlFilter. The correct urlFilter should be https://www.youtube.com, but you were deceived by Chrome's controversial decision to hide the so-called "trivial" subdomains like "www". You can restore the proper display by right-clicking inside the address bar and then ticking "Always show full URLs".

Another problem was that your urlFilter didn't anchor the pattern, so it would also incorrectly match https://example.com/?foo=https://youtube.com and https://youtube.company/. The best solution is "requestDomains":["youtube.com"], the next best one is a smart "urlFilter": "||youtube.com/" where / anchors the host part and || matches the domain itself and any sub-domains.

Karim Villard

unread,
Jun 1, 2024, 1:20:54 AM6/1/24
to Chromium Extensions, woxxom, Karim Villard
very insightful as always thanks !
Reply all
Reply to author
Forward
0 new messages