flecs icon indicating copy to clipboard operation
flecs copied to clipboard

Advertisement plays when app is started (with adblock plugin enabled)

Open L3-NR opened this issue 3 years ago • 2 comments

When i start the app (for example after a computer restart), sometimes an advertisement plays (about the same frequency as if there was no adblock) before the last played song is played. This may be due to the adblock plugin not being loaded in time?

L3-NR avatar Aug 17 '22 15:08 L3-NR

Yes it's a known problem, apparently the adblocker doesn't load in time

I've tried fixing this myself, multiple times, but to no avail

Araxeus avatar Aug 18 '22 10:08 Araxeus

Could we just work around it by triggering a reload when the adblocker plugin is first loaded? Not ideal but it might work.

kotx avatar Aug 27 '22 03:08 kotx

Or just delay startup until all plugins are loaded :) image

kotx avatar Nov 30 '22 02:11 kotx

The sources are fetched on app launch, this might be the root of the problem

https://github.com/th-ch/youtube-music/blob/35bd62cc0d8856ed161bbd865255c88e15a08855/plugins/adblocker/blocker.js#L7-L14

If this is indeed the problem, we'll figure out a solution

Araxeus avatar Jan 11 '23 15:01 Araxeus

I have an experimental faster adblocker here: https://github.com/Araxeus/youtube-music/tree/experimental-faster-adblocker

Looking for people to test it (I don't get any ads with it enabled, but that might be just luck since they are pretty rare for me

@Zo-Bro-23

Araxeus avatar Jan 11 '23 17:01 Araxeus

I have an experimental faster adblocker here: https://github.com/Araxeus/youtube-music/tree/experimental-faster-adblocker

Looking for people to test it (I don't get any ads with it enabled, but that might be just luck since they are pretty rare for me

@Zo-Bro-23

Sure, but what exactly are we looking for? Sometimes I do get ads the first time I load the app, but I seldom restart the app, and even then, it's pretty rare (only around 5 times since I started using the app).

It might be better to use Chrome DevTools to see if ads are being blocked, since without the adblocker, I get roughly one ad per song.

Zo-Bro-23 avatar Jan 12 '23 01:01 Zo-Bro-23

Just clone and build the branch and see if it blocks ads for you

Araxeus avatar Jan 12 '23 05:01 Araxeus

Just clone and build the branch and see if it blocks ads for you

Build available here in case anyone needs it.

Zo-Bro-23 avatar Jan 12 '23 06:01 Zo-Bro-23

I have an experimental faster adblocker here: https://github.com/Araxeus/youtube-music/tree/experimental-faster-adblocker

Looking for people to test it (I don't get any ads with it enabled, but that might be just luck since they are pretty rare for me

@Zo-Bro-23

Okay, so it takes a really long time (20-40 secs?) to load the song when the app starts, but now AD banner is shown as is seen with the other version. Switching to another song doesn't help. After this initial load time, the songs play pretty quickly, with a <1 sec delay for loading, which although noticeable, is not very annoying. Testing the other version (main release) again, the delay between songs is the same (0-1 secs), but the delay before the first song on load is much much less (1-2 secs instead of 20-40).

The new adblocker blocks ad, but the initial delay is really pronounced; any idea why that is? The whole point is to make loading faster, so I would recommend not switching adblockers until this issue is fixed.

Zo-Bro-23 avatar Jan 12 '23 06:01 Zo-Bro-23

Hmmm sorry it's really hard for me to work on this since I almost never get ads even without the adblocker

Something to do with my dns probably (or portmaster, tho I doubt it because I disabled it for youtube-music since it makes the app lag on start for 2min)

btw this experimental adblocker loads way faster for me than the old (0.01 sec vs 1 sec+

Araxeus avatar Jan 12 '23 18:01 Araxeus

btw this experimental adblocker loads way faster for me than the old (0.01 sec vs 1 sec+

Hmm, interesting. Why do you think it takes so long to load for me?

Zo-Bro-23 avatar Jan 13 '23 05:01 Zo-Bro-23