Firefox users are reporting an ‘artificial’ load time on YouTube videos. YouTube says it’s part of a plan to make people who use adblockers “experience suboptimal viewing, regardless of the browser they are using.”
Firefox users are reporting an ‘artificial’ load time on YouTube videos. YouTube says it’s part of a plan to make people who use adblockers “experience suboptimal viewing, regardless of the browser they are using.”
That’s out of context. That snippet of code existing is not sufficient to understand when does that part of the code gets actually executed, right?
For all we know, that might have been taken from a piece of logic like this that adds the delay only for specific cases:
if ( complex_obfuscated_logic_to_discriminate_users ) { setTimeout(function() { c(); a.resolve(1) }, 5E3); } else { c(); a.resolve(1) }
It’s possible that
complex_obfuscated_logic_to_discriminate_users
has some logic that changes based on user agent.And I expect it’s likely more complex than just one if-else. I haven’t had the time to check it myself, but there’s probably a mess of extremely hard to read obfuscated code as result of some compilation steps purposefully designed to make it very hard to properly understand when are some paths actually being executed, as a way to make tampering more difficult.
The code is not obfuscated. The person i linked to even formatted it nicely. I do not have the time or energy to go through all of youtube’s JS. But the 5s everyone is talking about does target every browser the same. Serverside the code isn’t altered based on browser detection.
Obfuscated javascript can be formatted nicely easily. But that doesn’t necessarily make it easy to understand.
What that person posted was a function named
smb()
that gets called byrmb()
under certain conditions, andrmb()
gets called byAdB()
under other conditions which is called fromeeB()
used inBaP()
… it’s a long list of hard to read minified functions and variables in a mess of calls, often functions that get called only in one place and nowhere else, declared in an order that doesn’t necessarily match up with what you’d expect.In the same file you can also easily find references to the user agent being read at multiple points, sometimes storing it in variables with equally esoteric short names.
Like, for example, there’s this function: