Closed ParticleCore closed 7 months ago
Yeah, no. This person is me, and I know it is Iridium because the moment I uninstall Iridium from Chrome, YouTube starts working again. The only adblocker I have is Ublock, and it is evidentially not causing it because as said, once Iridium is uninstalled things are working fine. And notably things have worked fine for years between Ublock and Iridium until this recent update.
I don't know, what code or console things am I supposed to be showing here?
Thanks for letting me know about that. There is a chance that your issue might reveal a possible incompatibility between both extensions, I am very interested in finding out what that might be.
Unfortunately I have been using both for at least 3 months, and I have not yet stumbled on an issue like yours, the closest issue I faced so far is the one I encountered in #919 on Firefox mainly.
As a result I also am kind of clueless here as to what you can look for, there wouldn't be any logs on the console but you can surely check if you have the time! Let me know if something shows up.
Other than that I can only ask if did you try testing with Iridium enabled and uBlock disabled in the Chrome extension settings?
Like this:
I did experience in the past YouTube detecting the adblocker with uBlock enabled (and disabled as per #919) without Iridium even being installed (fresh browser profile running only uBlock), that is why my initial assumption being that this is an issue being caused by, or contributed by uBlock.
And the fact that the Iridium extension is no-op when ads are allowed raises the suspicion of this issue being related to another extension even further, even if it just makes it more evident as a result.
Just an update on this topic;
YouTube has multiple different ways to detect an adblocker. These can be grouped into 3 types:
For each of these they employ a few different ways to detect ad blocking, some of which are still unknown to me.
However, I am able to confirm one method they have been using for years, but never used it to act on it.
YouTube tries to load the following script:
https://static.doubleclick.net/instream/ad_status.js
The contents of which is a simple window
level flag:
window.google_ad_status = 1;
This is then used in code in a couple of locations, example:
https://www.youtube.com/s/desktop/a4aa4e18/jsbin/desktop_polymer.vflset/desktop_polymer.js
function REc() {
if (!H("disable_biscotti_fetch_for_ad_blocker_detection") && !H("disable_biscotti_fetch_entirely_for_all_web_clients") && A4a()) {
var a = dl("PLAYER_VARS", {});
if ("1" != Hb.get(a, "privembed", !1) && !G4a(a)) {
var b = function() {
QEc = !0;
"google_ad_status"in window ? cl("DCLKSTAT", 1) : cl("DCLKSTAT", 2)
};
try {
Mz("//static.doubleclick.net/instream/ad_status.js", b)
} catch (c) {}
PEc.push(yi.addLowPriorityJob(function() {
if (!(QEc || "google_ad_status"in window)) {
try {
n4a("//static.doubleclick.net/instream/ad_status.js", b)
} catch (c) {}
QEc = !0;
cl("DCLKSTAT", 3)
}
}, 5E3))
}
}
}
The way this works is by simply using the same ad serving host (doubleclick.net) to load this script, any adblockers not excluding specifically this file and using a generic static.doubleclick.net
blocking rule, will inadvertedly prevent the flag from being enabled, thus resulting in a detection. Or this might be to avoid biting CPM due to page robots/crawlers.
The result of this operation is then stored in yt.config_.DCLKSTAT
Another method they have in place if enabled is the player event based detection in which the player dispatches the onAbnormalityDetected
event and triggers the detection:
(...)
H("enable_async_ab_enf") && this.playerEvents_.set("onAbnormalityDetected", this.onAdBlockingDetected_);
(...)
onAdBlockingDetected_: function() {
var a = qpb(this.playerData);
a && (KF(5),
this.playerData = Object.assign({}, this.playerData, {
playabilityStatus: Object.assign({}, this.playerData.playabilityStatus, {
status: "ERROR",
errorScreen: {
enforcementMessageViewModel: a
}
})
}))
},
As to how the event is dispatched is not known to me since there isn't any evident call in code, but I suspect this would be triggered by injecting a deferred loading script that invokes the call, similar to the previous technique.
Likely this method is linked to https://support.google.com/admanager/answer/6147120
In tandem with:
https://www.youtube.com/s/player/5e928255/player_ias.vflset/en_US/base.js
g.k.Ch = function(a, b) {
if (!this.j.has(a))
return {};
if ("seek" === b) {
b = this.J.U().L("html5_dai_enable_active_view_creating_completed_adblock");
b = void 0 === b ? !1 : b;
var c = Cr(Lu).cI(a, {});
c ? Kt(c) : b && (a = Cr(Lu).iF(null, es(), !1, a),
a.gk = 3,
Pja([a]));
return {}
}
b = meb(b);
if (null === b)
return {};
var d = this.J.ud()
, e = d && Mbb(d);
if (!e)
return {};
I1(this.Da.get()) ? (d = this.J.getPresentingPlayerType(!0),
d = null == (c = this.J.getVideoData(d)) ? void 0 : c.isAd()) : d = this.J.U().L("enable_server_stitched_dai") ? 2 === this.J.getPresentingPlayerType(!0) : 2 === d.getPlayerType();
if (!d)
return {};
c = {
opt_adElement: e,
opt_fullscreen: this.Ia.get().isFullscreen()
};
return Pka(b, a, c)
}
Or by testing script injected values behind the ab_det_sc_inj_val
(adblock detect script injected values) experiment flag:
function lqb() {
try {
var a = Apa("ab_det_sc_inj_val");
1 === a.length && "" === a[0] && (a = ["json=JSON.parse(text);for(k of[\"playerAds\",\"adPlacements\",\"adSlots\"])"]);
for (var b = document.querySelectorAll("script"), c = k(b), d = c.next(); !d.done; d = c.next())
for (var e = d.value, h = k(a), l = h.next(); !l.done; l = h.next()) {
var m = l.value;
b = void 0;
if (null == (b = e.textContent) ? 0 : b.includes(m))
return 0
}
} catch (p) {
return 4
}
return 1
}
This basically checks if there is a script injected in the page that matches a specific string pattern. I assume this might be a method used by an adblocker extension, meaning that specific extension could have the script injected and not doing anything, and it would still trigger the YouTube detection by presence alone.
This assumption is proven true given that's exactly a snippet from one of the methods that were attempted before in uBlock Origin: https://www.reddit.com/r/uBlockOrigin/comments/163cy47/comment/jyjj4ck/ https://github.com/uBlockOrigin/uAssets/issues/19550#issuecomment-1702270763
These are other methods I could find:
ab_det_apb_b
possibly adblock detect adblocplus block
ab_det_el_h
possibly adblock detect element hiding
ab_det_fet_wr
unknown
ab_det_fet_wr_en
unknown
ab_det_gen_re
unknown
During this time I haven't been able to encounter a detection method implemented by YouTube that might target specifically the method Iridium uses in its ad manager.
Whereas typical adblockers usually employ the following methods; Object override, Script blocking, and DOM manipulation Iridium goes a bit further than that and actually disables the ads at the source code before they are processed and rendered:
I am still unable to believe that Iridium can be the reason for the detection, I would be more inclined to believe that Iridium allows issues with third-party adblockers to become more evident which may lead to unintended detection as a result. However, it would also be very valid to consider the blame on the third-party adblocker side if by disabling the third-party adblocker and keeping Iridium enabled the issue does not occur.
Hopefully progress can be done on this, and if there is something I can do on my side to help avoid this issue I'll be more than happy to try and find it.
Unfortunately, even though I understand code I understand very little of web code so I cannot really corroborate with any of the code snippets. But I did try to go into the extensions and disable ublock origin and kept iridium, and yes the adblocking message on youtube still occurred.
I'd at least provide console errors if even relevant, but I get a ton of console errors because of my existing extensions regardless of Iridium even being there so it would likely be a waste of time.
Thanks for the update. So there are more extensions installed, would it be possible to turn all off except Iridium, refresh YouTube and see if it keeps detecting? Since I am unable to replicate this on my side my goal is to ensure the problem happens on your end only with Iridium running and nothing else.
Also could you tell me what are the other extensions you're running? I can try installing them all on my side and test it as well.
Other than that could you run the following in the browser console (Ctrl+J) and let me know what it returns
$("#base-js").src
and yt.config_.PLAYER_JS_URL
It should show something like this:
https://www.youtube.com/s/desktop/2144b1c0/jsbin/desktop_polymer.vflset/desktop_polymer.js
/s/player/2b39c590/player_ias.vflset/en_US/base.js
If you have different files I will try to inject the ones you're being served on my end to see if I can make it happen to me.
Yep I got pretty much the exact same responses from those two commands.
As for extensions, these are the ones that I'd imagine even remotely affect YouTube adblocking.
hyde — hide the YouTube video player controls Dark Reader (It better not lol) Privacy Badger Return YouTube Dislike Volume Master and Ublock and Iridium.
Thanks, I was really counting on the files being different in hopes of some new code YouTube might have added that would explain this, but seems like this isn't the case.
I will install all of those and test things on my side as well.
Forgot to ask, did you try turning off all extensions except Iridum to see if the issue still persists?
Privacy Badger, for example, does interfere with YouTube Ads and has been documented as one extension that triggered YouTube detection: https://www.reddit.com/r/youtube/comments/176apzt/finally_they_just_reached_me_who_is_a/
Going back to the detection methods I mentioned before, the most common one is such that is being affected by Privacy Badger:
And this is confirmed by entering the following command in the console on a YouTube page:
window.google_ad_status
which returns undefined
when it should return 1
if it wasn't affected
So for sure Privacy Badger is affecting ads in YouTube as well, and can even trigger their most basic and oldest detection method.
Sorry yeah, I just tried turning off all the extensions now. I kept on my password manager and Session Buddy because I dont want to risk losing any of their data, but with just them and Iridium it still caught the adblock detector.
Also, it can be inferred from that, but turning off Privacy Badger also did not fix it.
I see, I am now running all of the extensions you listed but I have yet to encounter the detection.
When you mentioned in https://github.com/ParticleCore/Iridium/issues/928#issuecomment-1943006408 "pretty much the exact same responses" did you mean literally the exact same ones or close to it?
Because for the most part the links will be pretty much identical, except for their version IDs. For example, the version id for this one
https://www.youtube.com/s/desktop/2144b1c0/jsbin/desktop_polymer.vflset/desktop_polymer.js
is in the middle 2144b1c0
and for this one /s/player/2b39c590/player_ias.vflset/en_US/base.js
is close to the beggining 2b39c590
Are yours using the same id or a different one? If any of them are different let me know what version each one it is respectively so I can try loading them on my side too.
It could be that you're being served with new versions of their scripts that I have yet to receive so the issue has not happened to me yet.
Ohhh, I was just looking for a similar looking response.
For the base-js I got 2144b1c0
, so the same.
And for player_js_url I got 2b39c590
, also the same.
Thank you, I have officially run out of ideas now and will see if I can make it happen on my side using the same extensions you have.
You mentioned you also had session buddy and a password manager, would it be possible to say which one if that is ok with you?
And is there any other extension you might have installed that I could add to my current test profile?
I almost forgot, could you attach your Iridium settings so I load the exact same config as yours?
In the Iridium settings you can export your current settings into a .json file, you can just copy the content here or attach it, whichever you prefer.
Sorry, not comfortable to say which password manager.
And I don't think any other extensions would be too relevant, other extensions in question would be things like BetterTTV and Chrome Tab Counter which do not affect the YouTube page at all. That's pretty much all thats left, extensions for particular websites and extensions that need to be called on.
That is perfectly understandable. Regarding the Iridium settings would you be willing to share them?
Oh I didn't see that message. Iridium2.0.3.json
Hmmmm those are not my usual settings. When they were exported they must have changed to default... youtube wasnt detecting the adblocker for like, 2 minutes. But now even when changing back to default it doesnt work again so I am very confused.
Perhaps its something with my settings, changed from default I:
Disable default video focus Turn on auto-play Disable scroll volume Allow info cards End screen hidden on
If I had to guess, and I don't know your code, my guess is that may be autoplay.
From this I am pretty sure it is SOMETHING to do with the settings. Because Iridium works for short periods when I switch back and forth from default to my usual settings.
Thanks for the detailed updates, I am really glad the issue got fixed in a way. The autoplay feature does in fact mess with some player internals so it is possible it might have something to do with it. I will now focus on testing these settings based on what you shared.
Sorry about all this trouble, and I really appreciate your help in trying to figure this one out.
Edit: I am assuming that with the default settings the issue stops happening, am I correct? I ask this because I am a bit confused about this part
works for short periods when I switch back and forth from default to my usual settings
I will be using the default settings except for these changes:
Autoplay: Enabled Scroll volume: Disabled Info cards: Enabled End screen hidden: Enabled Video focus: Disabled
Let me know if there is any other setting I might need to change to replicate your configuration.
Yeah those are the right settings.
And yeah sorry for the confusing wording, on the default settings, after a ctrl-f5 refresh there seems to be no problems, but with those settings that I described, the adblock detector shows up. It was only going in-and-out because I was switching back and forth and perhaps the settings didnt all apply between a normal f5 refresh.
I am afraid I have yet to make it happen to me.
I am unsure of what else to try at this moment
One consideration to test still is updating from the previous store version 0.2.5 to 2.0.3 and see if any old settings are carried over and affect the extension functionality.
If this is the case then uninstalling and installing the extension should clear the issue.
I will test this today.
Assuming that means 'remove from chrome' then 'add to chrome' in the chrome web store - I did already try that. Is there another way to fully uninstall and reinstall?
Thanks for letting me know, and no, what you did was pretty much what needed to be done.
This is quite the puzzling situation, I have been playing videos with a configuration like yours on Chrome since yesterday and not once did the detection got triggered.
I wonder if this is a region-like situation, which is not the same thing as just changing the location in YouTube.
I understand you might not prefer to say it, but I have tested this through VPN in USA and Canada. Do any of these cover your location? If not, and if you're ok with saying it, which other country should I try?
Yep, those cover me.
One thing I haven't confirmed yet because I was assuming it was Chrome all along is what browser are you using? Is it the latest Chrome or is it some other chromium based browser?
It is Chrome. I can only assume it is latest Chrome, doesnt it update automatically?
Correct, it should, though the concern was mostly if it was Chrome (sorry for my confusing question) or a Chromium based browser like Edge and so on.
I am afraid I am unable to find out why this is happening to you in order to fix it, so I will keep an eye on it to see if it eventually happens to me, but I will have to resume work on the other features and fixes by the end of this week.
Yep all good. I get when a coding problem appears to make 0 sense and when you just gotta put it on the backburner haha. Especially if it is literally only me that it is happening to lol
Would it be possible to share the list of experiments YouTube has enabled on your side? This could be another reason why it is happening to you and not to me.
Open the chrome console while in YouTube and enter the following:
yt.config_.EXPERIMENT_FLAGS
Then right click on the data that shows and select Copy object
and paste here in your reply, it should look something like this:
{
"H5_enable_full_pacf_logging": true,
"H5_use_async_logging": true,
"PremiumClientSharedConfig__enable_att_context_processor": true,
"PremiumClientSharedConfig__enable_att_for_get_download_action_on_web_client": true,
"PremiumClientSharedConfig__enable_att_for_get_premium_on_web_client": true,
"ab_det_apb_b": true,
"ab_det_el_h": true,
"ab_det_fet_wr": true,
"ab_det_fet_wr_en": true,
"ab_det_gen_re": true,
"action_companion_center_align_description": true,
"allow_skip_networkless": true,
"att_web_record_metrics": true,
(continues...)
}
This has started happening to me as well. With all other extensions turned off and only Iridium on, the youtube detection is triggered. Disable Iridium and youtube plays. Happens on both Chrome and Brave. I have tried everything listed above. The only way I can watch is with Iridium disabled.
@axxes8 can you share the experiments running on your side? See the instructions in my previous reply: https://github.com/ParticleCore/Iridium/issues/928#issuecomment-1951398730
@ParticleCore Sure thing.
{
"H5_enable_full_pacf_logging": true,
"H5_use_async_logging": true,
"PremiumClientSharedConfig__enable_att_context_processor": true,
"PremiumClientSharedConfig__enable_att_for_get_premium_on_web_client": true,
"ab_det_apb_b": true,
"ab_det_el_h": true,
"ab_det_fet_wr": true,
"ab_det_fet_wr_en": true,
"ab_det_gen_re": true,
(truncated by ParticleCore, original in history)
}
Thank you so much, I went ahead and fixed the formatting of your data. I will now analyze the experiments you have enabled on your side and compare with mine.
By the way, if you reset your Iridium settings to default (simply uninstalling and reinstalling the extension will do), does the problem go away like it does for the other user?
One thing I have been noticing is the autoplay
feature is not sufficiently passive when it is enabled. This means it can cause the video to blink a second time (or restart) when opened for the first time on a fresh page, or when the video is refreshed.
Given @JoshS-dev detailed experience, I am now inclined to believe the issue occurs when:
However, for this to happen then the ads should be enabled in the Iridium settings, which by default are not enabled and the user did not mention touching those to cause the issue to happen.
Still testing YT using @axxes8 experiement flags, but so far no detection has occurred. Will keep testing with his experiments for a while longer.
Thank you so much, I went ahead and fixed the formatting of your data. I will now analyze the experiments you have enabled on your side and compare with mine.
By the way, if you reset your Iridium settings to default (simply uninstalling and reinstalling the extension will do), does the problem go away like it does for the other user?
Resetting Iridium did not fix it for me. I uninstalled. restarted my browser, reinstalled, tried a youtube video. still detected.
I also turned off autoplay in Iridium, but that didn't fix it either.
@axxes8 if you enter the following in your console while YouTube is open on a video page what does it show?
yt.config_.PLAYER_JS_URL
and $("#base-js").src
yt.config_. PLAYER_JS_URL
/s/player/5683fc5e/player_ias.vflset/en_US/base.js
$("#base-js").src
https://www.youtube.com/s/desktop/87423d78/jsbin/desktop_polymer.vflset/desktop_polymer.js
Thanks, so I'm using the exact same sources as you are with the same limited experiements list, wondering why it never triggers the detection for me yet.
@axxes8 could you try running this version temporarily to see if the issue still happens? You can find it attached below.
chrome://extensions/
)Developer Mode
Load unpacked
@ParticleCore Yes, the issue still happens.
Then it should be one of the overrides most likely.
Could you try the following still using the same version you just tested above:
background-inject.js
in any notepadIf the issue still persists, repeat the above steps but for the following code sections (remember to do each one once at a time):
If at any point the issue disappears let me know which of the code sections above you deleted that caused the issue to stop happening.
In the meantime I am still trying to make the issue happen on my side with your settings but still no luck yet.
@ParticleCore When I comment out all 5 of those code sections, then the youtube video will play.
Playing around with those different functions, having the 1st one and the 5th one commented out, and leaving in the 2nd through the 4th, does not trigger the block.
So in the version you sent me, that would be lines 215-233. and lines 394-405.
I emptied my cache between each test to try to make sure there were no other factors that could be triggering the block.
Thank you so much for going through this trouble, I am glad to finally have something out of this.
So I am understanding that if you only comment the 5th and leave everything else untouched then the issue still takes place, and the same happens if you only comment the first one?
@ParticleCore That is correct.
If you comment the 5th just like before, and only comment this section of the 1st one does the issue still happen?
This will let us know if the issue in that override is specifically with just having the override in place, or with the features making use of that override.
With the if statement commented out the video plays.
That's good to hear, that would be a tricky one to work around.
There are multiple features that make use of that override, something as simple as the extension button all the way to the ad manager.
Could you do a similar round of tests as before, but this time you only comment each one of these entries one by one and test the issue after each one until the issue stops happening?
OverrideJsonParse.onParseListener(
Remember to uncomment this: https://github.com/ParticleCore/Iridium/issues/928#issuecomment-1951485439
So in summary:
OverrideJsonParse.onParseListener(
, reload the extension and see if the issue still happens, if it still happens then comment another entry of OverrideJsonParse.onParseListener(
, reload the extension and see if the issue still happens, and so on until it stops happeningLet me know after which one did the issue finally stop.
A Chrome user reported YouTube detecting the Iridium ad manager even if it is disabled:
Iridium does not have any code modifications when ad manager is disabled, it is built as a non-running rule logic:
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1250
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1103
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1118
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1141
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1168
https://github.com/ParticleCore/Iridium/blob/12f011b5a64e8b4731ff3994f643ed6fc6ff0e9e/src/chrome/js/background-inject.js#L1202
As a result it is not possible for YouTube to detect Iridium's ad manager even when it is disabled since in that scenario there is no code modification that could trigger detection.
On top of that, ever since I resumed work on Iridium, YouTube has never detected the ad manager once.
What is likely happening is the user has a third party adblocker which he thinks is disabled on YouTube, but it is actually still affecting it.
See #919 as a confirmed example of that situation.
At this time this is not an actionable item, hopefully the user can follow up here so we can figure out what is happening.