-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uBlock applying blocking rules for websites it is turned off #3083
Comments
Injected scriptlets will not disappear if you navigate from one video to another. YT is a long living page - content is dynamically updated by JS, you need to manually reload or open in new tab to load fresh scripts without modifications. |
Regarding the issue with a link to here:
Firefox has a good profiler tool to sort out performance issues: https://profiler.firefox.com/ I did experience at some point what appeared to be performance issue in Firefox, with no extension enabled. I submitted a profiling session, see https://bugzilla.mozilla.org/show_bug.cgi?id=1874862. More such profiling data need to be submitted if we want this issue to be investigated by Firefox devs. |
Although I did not explicitly stated in the first steps, I did force refresh every time in between toggling the setting in uBlock |
Did consider that, but as soon as uBlock was disabled in the addons manager the performance issues were gone. Unless the browser itself was causing the issues while the extension was enabled, then I can't think of any other way to explain it. Was not able to correctly confirm (YT scripts keep changing every now and then) but the behavior of that issue made me believe that the way uBlock was tampering with the ad data on the website was causing the YT scripts to enter into a error/retry loop which would eventually time out, causing the video to stop loading and show the circle icon on the video. From my experience playing with their code, it felt like part of their ad logic has instructions on how many are loaded and when to show an ad, and when it tries to pull the information for that ad (say 30s into the video) it never finds it, but since it is expecting to find something then it stays in that suspended state forever. Problem is, since their scripts keep changing almost daily, and with it some of their logic, it is hard to pinpoint the actual issue. |
You need to provide profiler data if you see performance issue. Otherwise, there's nothing to investigate. |
If you experience performance issue you think are caused by uBO, please provide profiling data, just presuming doesn't lead anywhere except endless misdagnosis. |
What is the test run? You (enable uBO => reload page => disable uBO => reload page) repeatedly? Or do you just disable uBO once then reload repeatedly? |
Forgot to address this. When the issue started happening I noticed the ad data was gone, when I tried to inspect it I stumbled on the ad data points overridden with constants, which then led me to those scriplets still running after the extension was turned off for that website and still persisted after page refresh. Only after disabling the extension in the addons manager the scriplets were no longer present. Just searched for parts of the code to try figure out where it was coming from, nothing special:
Sorry, hard to scope that one. The lag occurs briefly in the first few seconds of the video playback until it hits the 30s-ish mark then the video stops playing, does not buffer anymore, and the loading circle shows up on the player and stays like that. Most of the times when I am fast enough, I can tell when the issue is happening by checking in the player stats for dropped frames, it always drops frames when the issue occurs. I don't believe the performance problems are being caused by uBlock directly, but I do believe its scriplets/code modifications made by it induces the YT code into a state that causes performance issues, at the very least with the YT scripts that were loading for me at that time.
Open YT Sometimes it looks like the issue is not happening in the first 30s, but some of those times it happens 1:30s in. This one just happened right now (with uBlock enabled for YT) to me, and stays like this: Relevant YT scripts loaded for the above specific test are as follows: player https://www.youtube.com/s/player/787e9b63/player_ias.vflset/en_US/base.js Those might change at any time though, but just in case they can be helpful I included them here. |
Profiling data means using https://profiler.firefox.com/ |
I meant to say it is hard to pin the performance issue on uBlock since it is most likely YT that is having performance issues as a result of uBlock modifications. |
That's why you need profiler data. It will show what the website is loading. It's NOT just for pointing the issue to uBO. |
Alright I am going to try to gather all the detailed steps to repro in one place, tell me if I get this right:
Result: Eventually issue when repeating 1 to 8? Or is it 4 to 8? Correct? |
Beginning to wonder if it is all tied to that one somehow. |
The part that is not clear is you said:
What were the exact repeated steps in these runs? It's what I am trying to figure before spending time to try and reproduce the issue. |
Apologies, that completely went over my head.
So for me this is basically what I see: Turn off uBlock for YT Refresh YT (notice the blue icon in the refresh button in sources search, those results are in cache despite refreshing YT) Search for the scriplets again (no longer cached search results) and they are still present |
Thanks. So if I can't reproduce the first time, which steps do I repeat to try to reproduce it again? 1 to 10? Or a subset of these steps? |
Usually just enabling uBlock, refreshing YT, disabling uBlock, refreshing YT was sufficient for most cases. |
Are you refreshing your search after you reload the page? If I reload the page after I disable uBO without refreshing the search term (I delete the last |
Yes, that is what I meant by the blue icon in the images, when that icon is showing then those results are cached from a previous load, the search must be done again in order to confirm the scriplets are there or not after refreshing the page. |
I tried tens of times and still can't reproduce. Maybe it's a timing issue and my PC is not as fast/slow as yours? What's the rough specs of your PC? If scriptlets are still injected after disabling, I would think the issue is in the content-script registering code. This is where content scripts are unregistered when uBO is disabled for a site: https://github.com/gorhill/uBlock/blob/1.55.0/src/js/scriptlet-filtering.js#L103-L109 |
8gb ram
Any chance a specific condition might not be ironclad when it comes to injecting while checking if it is turned off for a specific website? Timing issue or a disallowed list that might not have time to populate beforehand, etc. |
This comment was marked as abuse.
This comment was marked as abuse.
Sounds very reasonable. It does feel like the setting is being ignored for some odd reason, hopefully that will help in figuring something out, thanks. |
If more people can try to reproduce as per repro steps in #3083 (comment), this will help maybe identify what else is needed to reproduce. |
#2896 is unrelated, it was caused by not having a listener for changes to reset registered content scripts. It's there now and I verified that it is called immediately upon disabling uBO, @ParticleCore you can verify this by putting a breakpoint at this line and verfying that it executes through |
When I follow the steps at this comment, signed in (which is only how I could reproduce them), I cannot reproduce with 1.55.1b11 -- so back to being unable to reproduce. There has already been a lot of wrong information regarding the steps to reproduce, until it was identified that being signed in was important. So for now I consider the issue correctly mitigated, except the know edge cases I know this could happen, which the repro steps are not. |
@gorhill Is there any way to check which hosts might be causing the rules to be applied in the current tab? For example, you found out Edit: Adding |
@ParticleCore What exact "issue" you're referring? Injecting scriptlet rules into |
Because of that situation it affects ads on the page which it was suppose to be disabled on, and as a result it causes adblock detection as well. It means that despite appearing to be turned off for YouTube, it is infact still enabled. |
I have a Firefox profile having real anti-adb with rules to deliberately trigger detection, and can not reproduce. The current rules in uBlock filters have
Most parts of their script has been the same, they mostly change only function names. We have been monitoring their script for more than 6 months now. |
No, when disabling uBO on I can only see Scriptlets injected into |
Coincidence AdguardTeam/AdguardFilters#170786 (comment)
|
All I know is it affects YouTube even after turning it off for YouTube, and I've already shown it multiple times and when it happens the issue stops after I disable uBlock entirely. I think the recordings above are self explanatory. Anything else beyond that is outside my ability to explain better, and unfortunately that already made the good folks here go back and forth wasting some time because I couldn't explain things better from start. |
These recordings were using 1.55.0, which didn't get the fix here. |
@stephenhawk8054 By the way, shouldn't we exclude with |
I agree. I'll adjust it. |
Sorry, at the time yes, I will record it when it happens again with the beta version when I am home. |
I was able to record the issue happening again with 1.55.1b11 1.mp4Steps done in the video:
I hope I was able to make things cleared this time, let me know if I can help clarify anything further. I am still unsure of what is causing this to happen because all the time now I have uBlock turned off (using the power button in uBlock) for YouTube and, for a while, the issue never occurs. Eventually it starts happening again, and I never turned it on once for YouTube. |
Can you turn off Stylus and test again? |
@ParticleCore Did you visit webpages with Youtube video instances embedded in them? That is one of the edge cases I am talking about when I say this cannot be completely fixed. Ideally, the contentScripts.register() would need a way to tell to not inject if the root frame is a specific hostname, i.e. |
Another way to mitigate the known edge cases in the current instance would be to be explicit in the filters about which exact subdomains of |
I am 99% certain you are correct. Just opening And when I check YT before that happens: no issues |
An update; in order to correct the issue in YT there is no need to manually disable uBlock via addons manager, simply turning it on and off again works, it is way easier and faster, and seems to be enough to deregister any rogue scriplets. |
@gorhill Unsure if this suggestion is even feasible, but since toggling uBlock seems enough to resolve the issue (at least from my perspective), maybe a similar logic could be implemented whenever a website is opened? It would always ensure the correct deregistration of scriplets for websites in which uBlock is turned off. This way, even if, for example, a YT iframe from an unrelated website were to introduce the issue again, it would be mitigated by enforcing deregistration whenever YT is opened. |
Maybe another case: https://www.reddit.com/r/uBlockOrigin/comments/19fg0h8/ublock_origin_qwant/ |
No way to tell without the troubleshooting information. I won't further make changes here, it's a mitigation for the sake of not undermining people who keep uBO enabled, which I assume is the vast majority. |
Another update surrounding this topic. I noticed today that this situation (in my case at least) depends on having opened YouTube before navigation on any other pages in order for it to surface. Last night I opened the browser fresh and navigated to multiple websites, across different pages (google, github, news combinator, dev documents, etc.) and after a while I opened YouTube to play some music and the issue was not there at all. However, after having YouTube opened (remember, uBlock is enabled for everything else except in YouTube) and navigating again to other websites (on different tabs), eventually the issue returned on YouTube. So it seems to me that this issue depends on having opened YouTube (keep it open) before navigating on other tabs in order to trigger the issue, which leads me to think that perhaps there might be some sort of global listener/dispatcher that is causing the disabled uBlock extension on YouTube tab(s) to inject or schedule injection of scriplets in them which is being triggered by other opened tabs on different websites. Basically, a tab with google search results containing a youtube iframe causes the disabled uBlock on the youtube tab to inject scriplets, if that makes sense. I might be completely wrong tho, but that is what I can deduce from my pov. |
Again I don't know what Issue you mean, as currently uBO can't be detected by YT. |
Sorry, I am referring to the uBlock scriplets being present in a page where uBlock is supposedly turned off, see #3083 (comment) and #3083 (comment) |
@gorhill I see you closed the issue after 2 months. Was this fixed or wontfix as per #3083 (comment) ?
If the latter, is #3083 (comment) an issue only with detection (e.g. opening a site with a |
Prerequisites
I tried to reproduce the issue when...
Description
This issue is in keep with recent user reports on social media stating that even after turning off uBlock for a specific website it is still being detected, very likely as a direct result of this bug that is causing the extension to still apply blocking rules for websites it was turned off.
Currently using uBlock 1.55.0 with default settings and rules on Firefox 121.0.1 and 123.0a1
I have it turned off for youtube.com, for example
![image](https://private-user-images.githubusercontent.com/9222661/297751803-2ddbd35b-c476-4752-b4ea-e1ad2b787dd7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mzc5NTAsIm5iZiI6MTczODkzNzY1MCwicGF0aCI6Ii85MjIyNjYxLzI5Nzc1MTgwMy0yZGRiZDM1Yi1jNDc2LTQ3NTItYjRlYS1lMWFkMmI3ODdkZDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTQxNDEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmM2NGViNWE5NzgzNzNlYmU0YzQzNzY2NDAyYzgwYTc3ZTQ5NWIzMjEzY2ZjZTU1OTk1ZjNhNjRkNjgwYjlkNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ._xcXKjf5HGC8BkoAUPIvNANoXTJxE77TzAmWuryIAT0)
I have created a brand new profile with the only extension installed being uBlock
With uBlock turned off for youtube.com the ads are still being blocked
Debugging the page confirms that it is still injecting blocking rules:
![image](https://private-user-images.githubusercontent.com/9222661/297751502-e3444d1c-9317-4f31-ae74-b1ff93cc4785.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5Mzc5NTAsIm5iZiI6MTczODkzNzY1MCwicGF0aCI6Ii85MjIyNjYxLzI5Nzc1MTUwMi1lMzQ0NGQxYy05MzE3LTRmMzEtYWU3NC1iMWZmOTNjYzQ3ODUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTQxNDEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTRlMGRmOGEyZDJjOWNhNjIxYjZhMmFiNDc2NjUxNmJkZWNmOTFjMDZhZTE2ZTU3ZTYwNDkzYTJmMmMwODI2MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.dtFOT4d0qniWMQVC--g8GKQ0bzDSP7Nk0KeNEPyt4gU)
Disabling the extension in the browser addon manager and refreshing youtube resolves the problem, no more blocking rules appear in the website.
A specific URL where the issue occurs.
https://www.youtube.com/watch?v=oACoGd4AZwk
Steps to Reproduce
Install uBlock on a fresh profile
Open any url video
Open the debugger and look for the scriplet blocking rules
Expected behavior
When uBlock is turned of for a specific website no blocking rules should be applied
Actual behavior
When uBlock is turned of for a specific website, blocking rules are still being applied
uBO version
1.55.0
Browser name and version
Firefox 121.0.1 and 123.0a1
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: