-
Notifications
You must be signed in to change notification settings - Fork 82
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 Origin blocks local files opening in a new window under certain conditions #2925
Comments
Seems to be Windows only. Or specific to Chrome build. Can repro in Win11 in VM, cannot in Manjaro with Windows: 118.0.5993.118 or 119.0.6045.106 |
So I won't be able to investigate. Unfortunate because I find this issue mind-binding. Where is that Also, I notice that the part of the URL which is selected is |
Yes, gorhill, I suspect that the issue reported earlier - #2882 - has the same underlying root cause as this one. There is no actual browser crash there; the reporter perceived it as a crash because the window appeared and immediately disappeared. |
When uBO launches, the network request listener is disabled until all filters are loaded, so that the filtering engines are not being used until fully loaded. However, looking at the selfie-loading code, which is asynchronous, I do not see any internal barrier to prevent evaluation until a fully loaded selfie. The code which checks popup filters does not go through the network request listener, so it could start to try to use the static network filtering engine while it is not yet fully loaded. It is difficult to predict what exactly would happen in this case, and maybe the issue here is such case. I need a barrier raised in |
uBlock Origin has been preventing me from opening local PDFs and PWAs (I utilize Outlook Webmail PWAs opened in Window mode) on multiple Windows 10 and Windows 11 machines, with fully up-to-date Windows and Edge. With Edge running, a msedge process starts and immediately exits (visible in task manager, but no visible window). With uBlock Origin uninstall in Edge, both local PDFs and my Outlook PWAs open. |
Looks fixed when using local build. |
Thanks for the fix, @gorhill! When will a new non-dev release get created with this fix and published to the Chrome and Edge Stores? |
We are discussing preparing the current dev build to be a release candidate given we want differential update capabilities to be out there asap, so maybe between 1-2 week if no big changes occurs to the code. |
The fix should be in 1.53.1b3, right? New window is still closed for me. This is a fresh installation of uBO dev build + wait for selfie. The local build is fine. |
The local build had access to file URLs allowed, I changed the setting few times in both - now on both window is closed, no matter the "file URL access" setting. Clean reinstall of the local build with few browser restarts in between, and it's again fine. |
If I could reproduce I would add |
Do you have instructions for how to log this? The uBlock log doesn’t seem to be capturing anything because the browser has to start closed and the bug obviously closes the browser right after opening it? |
In Edge this affects the first window opened, but in Chrome you can open the first one, keep it open, and the subsequent ones will close. You can then enable dev mode in |
Put |
I don't understand that part. Subsequent windows? Opened how? uBO is already fully loaded with the first one, this means if you open another windows and it closes, the logger would show what uBO did if it did close it. |
From OP
And you get this: (also from OP) In Looks like broken trie, because it only blocks the popup when all default filters are selected. |
Probably |
Can you look at the content of the "register" variables around line 250? I am guessing that I can re-create the symptom by disabling all filter lists and adding the filter This is where the trie is being tested: |
I think there might be a problem if ever the trie is unserialized and first tested with an empty hostname. The length of the last hostname tested is always stored at byte offset 255 in the trie. It's supposed to always match the length of cached |
Possible related issue: uBlockOrigin/uBlock-issues#2925
Right now, only in build from CWS. Was able to reproduce on 1.53.1rc0, will try master. Maybe it works, or maybe I cannot reproduce again. We'll see in next rc. |
If this was indeed the source of the issue (I am pretty sure it was), this means that for the issue to occurs, the last trie test right before serialization had to be a match, and the first trie test right after deserialization had to be an empty hostname. Might explain why it's difficult to reproduce. |
Found a reliable way to reproduce, as per my above comment:
Result: second window closes. Here I used Microsoft Edge in a virtual machine, but should work for any Chromium-based browser really, and probably for Firefox if I looked up how to do the same with it. |
Thanks for the deeper investigation and fix, @gorhill! I validated that the issue doesn’t occur on a fresh install of the release candidate version of the extension. But what will the behaviour be for users of the extension who are currently in the bad state (where file opens are getting blocked) and get an update with the fix? Will the fix start working immediately or will it apply only after the selfie is recreated on their browser? In other words, is the above fix applicable at the time of reading the selfie or writing to it? |
Selfie version number changed in this version, so it will be invalidated on startup after uBO update. |
Yes, this will be fixed immediately, the selfie itself was not bad, it's the proper initialization of a single byte that was missing after the selfie was loaded. |
@gwarser That will happen for 1.54.0 release. |
Err sorry, I must be tired. Of course the fix is in the current dev build, not in 1.53.2. I will create a stable release just for Microsoft Edge with the fix above. |
Fix is in 1.53.4 which is now live at https://microsoftedge.microsoft.com/addons/detail/ublock-origin/odfafepnkmbhccpbejgmiehpchacaeak |
Thanks for the hotfix release, @gorhill! Is the earlier commit - gorhill/uBlock@89b2727 - not necessary to resolve this issue in all cases? |
I am just guessing the byte one was the cause. The other commit has more changes and I would not be comfortable for a quick release. |
Dev build is stuck on 1.53.1rc0 and Edge add-ons store has 1.53.2. |
I saw 1.53.4 yesterday in MSFT store, don't know what happened. As for Chrome store, 1.53.1rc3 has been pending review since Nov. 8. |
@gorhill, the version on the Microsoft Edge Addons Store is still 1.53.2, and there doesn't seem to be a pending submission for the update to 1.53.4. Can you please double-check if the release got submitted to the store correctly? |
It's out of my control since I am not the owner of extension in MSFT store. I can tell however that I did see 1.53.4 in the store not too long after I created the release. So this was reversed somehow afterward. |
As of a few minutes ago, in the Microsoft Store, the version of UBO available is 1.53.4. |
On Edge, 1.53.4 is fine, 1.53.0 from CWS is broken. On Chrome, 1.53.1.103 is fine, 1.53.0 is broken. |
Opening MD and SVG files from Explorer (associated with Edge), the problem is now mostly resolved, but unfortunately still crops up again between 1/6 to 1/3 of attempts (again, when Edge is not already open to begin with). |
Hello All, I am Gurjeet from the Microsoft Edge Add-ons team. Thank you for reporting this issue. Our team was able to review this and has now resolved the reported issue, request you to please check and confirm in case you are still facing the same issue. Also, uBlock Origin has released a new Version 1.53.4 on November 14, 2023, for the extension to help resolve this issue. In case the issue persists, please let us know and our support team will investigate this further. Thank you. |
I'm not sure, but Edge can be a specific case, because it keeps a process open in the background. On the other hand, we have |
Despite you said
?? |
The bug is fixed - popup is no longer closed by invalid |
Isn't that user's own choice? We only fix issues by default lists, or at most built-in lists. |
Could also be the no-popup switch, |
I cannot reproduce with |
Prerequisites
I tried to reproduce the issue when...
Description
On Chromium-based browsers including Google Chrome and Microsoft Edge, when uBlock Origin has an active "selfie" of the filters, local files opening in a new window are blocked by uBlock Origin in certain scenarios where the selfie is not loaded correctly.
The logger message when the file open is blocked:
It seems that the selfie is not correctly loaded when the browser is launched without a web URL in general, because of which some default rule is probably kicking in and closing the new window. When the filters are correctly loaded, the blocking does not happen. If there is no selfie currently, the blocking does not happen. See repro steps below.
A specific URL where the issue occurs.
Any local file URL, such as file:///D:/Testing/StudyInDMinor.pdf
Steps to Reproduce
<path to browser executable> <path to local file> --new-window
. Example:"C:\Program Files\Google\Chrome\Application\chrome.exe" file:///D:/Testing/StudyInDMinor.pdf --new-window
.Expected behavior
The file opens in a new window and remains open.
Actual behavior
The file opens in a new window which gets closed immediately by uBlock Origin, with this call stack:
At this point, if you navigate to any website with potential ads in the first open window and then run the command again, the window does not get closed by uBlock Origin. But if you close all the browser processes again and repeat from step (4) in the repro steps above, the issue reoccurs.
Configuration
The text was updated successfully, but these errors were encountered: