380
submitted 8 months ago* (last edited 8 months ago) by CaptainBasculin@lemmy.ml to c/firefox@lemmy.ml

Edit: Replies to this thread indicate this is not fully correct as it exists on all browsers; and is likely an ad thing.

all 40 comments
sorted by: hot top controversial new old
[-] superb@lemmy.blahaj.zone 182 points 8 months ago

If the person who tweeted this scrolled down in the hackernews thread, they’d see this code was misinterpreted. It’s part of an anti Adblock script that runs 5s after page load. Still shitty, but less insidious

[-] Johanno@feddit.de 11 points 8 months ago* (last edited 8 months ago)

Oh they think that delay in the beginning is malicious .

I noticed a huge drop in bandwidth until I logged out of YouTube. This was a onetimer however.

[-] HeChomk@lemmy.world 71 points 8 months ago

Don't use the youtube website. On any browser. Use freetube instead, if your situation and use case allows it. No Google bullshit required. Loads fast, no ads, no tracking. Fully self contained.

[-] Virkkunen@kbin.social 53 points 8 months ago

I really appreciate you saying "if your situation and use case allows it". I'm sick of people "suggesting" these kind of things by just saying "don't do this" "stop doing that" while completely ignoring that not everyone has the same use cases, preferences and possibilities for such.

[-] Fisch@lemmy.ml 5 points 8 months ago

I wish there was a GTK Piped client. Freetube has that kinda janky feeling of a browser (it's an Electron app, so not surprising) and I don't see why I wouldn't just use Piped in a browser then.

[-] rdmemd@lemdro.id 5 points 8 months ago

Does it proxy requests like piped?

[-] muix@infosec.pub 4 points 8 months ago

You can proxy through Invidious or use a local API

[-] CluckN@lemmy.world 5 points 8 months ago

Does freetube show recommendations? Most free clients seem to scrape your subscriptions and lack features like playlists.

[-] echodot@feddit.uk 62 points 8 months ago

Whoever posted this is not a programmer. Does no conditional on that code so it would run on every browser on every session so where's the check for Firefox?

Unless they are claiming that it is injected at runtime. But that's easily provable/disprovable with agent spoofing.

[-] heavyboots@lemmy.ml 35 points 8 months ago* (last edited 8 months ago)

In the demo I saw they did an agent spoofing to Chrome and the delay went away, but it didn’t look very extensively tested. As others said, the disappearance on reload could easily be because they thought he was returning to the page and had already seen the ad/been punished for not seeing the ad and so something ad-related disappeared instead.

[-] idunnololz@lemmy.world 17 points 8 months ago

Iirc the thing is it loads a different js file when it detects chrome which doesn't have the 5s delay. The reasoning is this is part of some anti adblocker code and chrome didn't need the extra logic.

[-] ToxicWaste@lemm.ee 2 points 8 months ago

The code is still present when spoofing the user agent or even using a freshly installed chrome. The demo video loafing faster after spoofing can be due to many different reasons.

If you want a better break down of what the code could be used for, this guy foes a good job: https://old.reddit.com/r/firefox/comments/17ywbjj/whenever_i_open_a_youtube_video_in_a_new_tab_its/ka08uqj/

[-] echodot@feddit.uk 1 points 8 months ago

So it's got nothing to do with Firefox it's to do with preventing and blocking so it'll happen on Chrome as well.

[-] idunnololz@lemmy.world 4 points 8 months ago

Well chrome doesn't need the 5s delay.

[-] echodot@feddit.uk 4 points 8 months ago

Chrome doesn't need a 5 second delay to implement ad blocking, or Chrome doesn't need a five second delay because it's Chrome?

Does an important difference here because one is anti-competitive and the other isn't.

[-] Boomkop3@reddthat.com 35 points 8 months ago

It would not be the first time Google was caught doing this. A couple years ago they were caught breaking apps like google maps if your user agent string wasnt chrome.

But recently I've noticed they can tell regardless of that string. So my guess is that they've hidden fingerprinting code in the chrome browser

[-] XEAL@lemm.ee 11 points 8 months ago

I hate how easy is for websites to fingerprint users...

[-] Boomkop3@reddthat.com 2 points 8 months ago

Yep, and it doesn't help that google controls almost all web browsers. They literally give websites your personal information now that cookies are no longer allowed.

So if you're gay and live in Iraq, you better make absolutely sure to only visit your school's website on computer you lend from friends or school computers

[-] ToxicWaste@lemm.ee 26 points 8 months ago

This is not correct.

Most of the posts/articles reference following reddit post: https://old.reddit.com/r/firefox/comments/17ywbjj/whenever_i_open_a_youtube_video_in_a_new_tab_its/k9w3ei4/ . It shows the code from your screenshot. However the code does not check the user agent and is not injected server side (I checked by user agent spoofing and using a freshly installed chrome). So it will run on every browser and cannot be used against some specific ones.

There is an answer to the post everyone seems to reference, which goes a bit deeper into what the code could do: https://old.reddit.com/r/firefox/comments/17ywbjj/whenever_i_open_a_youtube_video_in_a_new_tab_its/ka08uqj/

[-] dangblingus@lemmy.dbzer0.com 12 points 8 months ago

"Here's a screenshot of nothing to prove that I found code!"

[-] FuckyWucky@hexbear.net 12 points 8 months ago

yea there does appear to be delay but it doesnt target firefox users specifically (i think) or atleast isn't obvious to me cuz the code is obfuscated. more likely related to ads (since there is a 5 second delay before you can skip ads). anti-adblock maybe yes.

[-] barrbaric@hexbear.net 3 points 8 months ago

Can confirm it's happening to me even on Chrome (they won't let me remove it at work powercry-2 )

[-] Ascend910@lemmy.ml 10 points 8 months ago
[-] nuke@yah.lol 18 points 8 months ago* (last edited 8 months ago)

Browser detection is rarely done through User Agent lookup anymore. Nowadays we determine browser through feature detection.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection

[-] flying_monkies@kbin.social 13 points 8 months ago* (last edited 8 months ago)

And yet in this case if I change my agent to any non-FF value while using FF, videos load immediately.

I set my agent back to FF, 5 second delay.

[-] off_brand_@beehaw.org 3 points 8 months ago

Yeah, but some amount of the time is just easier to rely on the user agent. Why bother with the fancy logic when user agent spoofing, adblocking Firefox users is a % of a % of a %?

[-] nuke@yah.lol 2 points 8 months ago* (last edited 8 months ago)

I tend to agree. I think there's little need as a developer to go that extra mile for accurate browser detection without UA unless it's for fingerprinting. Most feature sets are supported and where it isn't you have a polyfil or whatever shim to make it work. So in the case of fingerprinting you try not to rely fully on anything the user can alter easily.

[-] TrickDacy@lemmy.world 2 points 8 months ago

Doesn't matter what's the best way to do it in reality. UA is easily a possibility for any website. Nothing stopping it

[-] SpaceNoodle@lemmy.world 0 points 8 months ago
[-] krigo666@lemmy.world 14 points 8 months ago

I won't spoof the agent. I want Google to know I'll keep using Firefox no matter what. Except for YouTube, I don't use any other service of theirs, too shitty.

The best way to make them back down is to show we won't bow.

[-] Karyoplasma@discuss.tchncs.de 1 points 8 months ago

The other day, I finally switched to ProtonMail. I still just forward my gmail inbox for now because I'm too lazy to go through all my accounts and change the email all at once. In due time, I will have switched. Fuck Google.

[-] chemicalwonka@discuss.tchncs.de 9 points 8 months ago

I will make a call to a friend of mine called EU to solve this problem.

[-] uis@lemmy.world 4 points 8 months ago

EU legislation taxi

[-] SootySootySoot@hexbear.net 7 points 8 months ago* (last edited 8 months ago)

uBlock on firefox here, no User Agent spoofing, videos load in ~1-2 seconds as normal still. Wouldn't surprise me if it's used in nicher circumstances though.

this post was submitted on 21 Nov 2023
380 points (89.7% liked)

Firefox

17302 readers
120 users here now

A place to discuss the news and latest developments on the open-source browser Firefox

founded 4 years ago
MODERATORS