Skip to content
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 breaks "Open image in new tab" when there is a rule to block popups #3436

Open
9 tasks done
anonghuser opened this issue Oct 31, 2024 · 13 comments
Open
9 tasks done
Labels
Chromium specific to Chromium/Chrome

Comments

@anonghuser
Copy link

anonghuser commented Oct 31, 2024

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

uBlock Origin breaks "Open image in new tab" when there is a rule to block popups.

A manual "Open image in new tab" should not be considered the same as an automatic popup and should not be blocked, the same way as "Open link in new tab" is not.

A specific URL where the issue occurs.

https://bato.to/title/81559-skip-beat-official/2492793-ch_299
https://hentai2read.com/a_former_brave_resident_in_the_dungeon/ (nsfw)

Steps to Reproduce

  1. Go to one of the example urls
  2. Rightclick any image and chose "Open image in new tab"

Expected behavior

The image should open in new tab and stay open.

Actual behavior

In Edge a new tab briefly flashes and immediately disappears.
In Chrome, it doesn't even flash briefly, it just never opens.

uBO version

1.60.0

Browser name and version

Edge 130.0.2849.56
Chrome 130.0.6723.92

Operating system and version

Windows 11

@stephenhawk8054
Copy link
Member

https://bato.to/title/81559-skip-beat-official/2492793-ch_299

I can't reproduce

firefox_Rqi805gaCe.mp4

@anonghuser
Copy link
Author

idk why. i just reproduced it also in chrome.

@stephenhawk8054
Copy link
Member

Can you open new tab > reproduce the issue and on that page > click on uBO icon > 💬 Report button > scroll to the bottom > click on Troubleshooting Information and copy paste it here?

@anonghuser
Copy link
Author

anonghuser commented Oct 31, 2024

uBlock Origin: 1.60.0
Chromium: 130
filterset (summary):
 network: 140587
 cosmetic: 48803
 scriptlet: 22937
 html: 0
listset (total-discarded, last-updated):
 default:
  user-filters: 0-0, never
  ublock-filters: 40518-265, 5m
  ublock-badware: 11724-6, 5m
  ublock-privacy: 1391-22, 5m
  ublock-unbreak: 2493-0, 5m
  ublock-quick-fixes: 229-0, 5m
  easylist: 80404-586, 5m
  easyprivacy: 53214-648, 5m
  urlhaus-1: 20480-0, 5m
  plowe-0: 3542-0, 5m
filterset (user): [empty]
userSettings: [none]
hiddenSettings: [none]
supportStats:
 allReadyAfter: 5034 ms (selfie)
 maxAssetCacheWait: 271 ms
 cacheBackend: indexedDB
popupPanel:
 blocked: 2
 network:
  bookstore.pics: 1
  googletagmanager.com: 1

i guess the "bookstore.pics" is the image

@anonghuser
Copy link
Author

anonghuser commented Oct 31, 2024

do you have easylist filters enabled when trying to reproduce it? the rules that block popups on the example sites are part of easylist.
the "block all popups" button you highlight at the start of your video is not required for reproducing the issue (but should not hinder it either).

@stephenhawk8054
Copy link
Member

I'm using default settings.

@garry-ut99
Copy link

garry-ut99 commented Oct 31, 2024

stephenhawk8054: I can't reproduce "firefox_Rqi805gaCe.mp4"

OP said he reproduced on Chrome and Edge and you provided him a video on Firefox.

  • I can't reproduce on Firefox either: SCREENSHOOT (SITE 1).
  • But I can on Chrome & Edge: SCREENSHOOT (SITE 1), SCREENSHOOT (SITE 2).
  • Seems two different filters from EasyList.
  • As for the SITE 1: on Firefox the image not blocked:
    • because the context is n31.bookstore.pics, while on Chrome & Edge, the context is bato.to
    • or maybe because image request type is doc, while on Chrome & Edge it's popup

@gorhill
Copy link
Member

gorhill commented Oct 31, 2024

This EasyList filter is causing the new tab to close:

/^https?:\/\/.*\.(jpg|jpeg|gif|png|svg|ico|js|txt|css|srt|vtt|webp)/$popup,from=...

Unfortunately uBO doesn't know that the tab was opened using a context menu entry, that information is not available to uBO. Not something which can be fixed.

AdGuard and ABP also suffers this issue.

The issue does not exist on Firefox because the event listener onCreateNavigationTarget() is not called in Firefox.

@garry-ut99
Copy link

garry-ut99 commented Oct 31, 2024

So it seems what is mentioned in Wiki for no-popups switch applies for $popup filters as well:

https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-popups : Caveat: It's not always possible for uBO to determine for sure whether a new tab being opened is that of a popup, or is the result of a legitimate click on a link by the user. So if the no-popups switch is in use, you may not be able to open a link in a new tab through the context menu.

By the way, a duplicate of:

@anonghuser
Copy link
Author

anonghuser commented Oct 31, 2024

#932 talks about middle-click which i can not test, however it should be the same as ctrl+click or "open in new tab" for links instead of images, which works fine here. Either things have changed in the four years since, or maybe its just in that specific "Cent" chromium derivative.

And it was actually asking for an easy way to temporarily allow a popup, not to fix how the $popup filters work (if you say this is impossible). I think that's actually a reasonable idea/alternative. Perhaps something like the browser's built-in popup blocker which iirc showed an indication for the blocked popups in the address bar and you can click it to allow/open a specific popup that was blocked. Or, if uBlock Origin is able to see the modifier key state at the time the popup is opened, perhaps allow them if "Ctrl" is being held, or similar.

I'd go as far as to suggest uBlock can probably remove the built-in "Open image in new tab" if its code is such that its impossible to distinguish from automatic popups, and replace it with its own menu item with code that sets a flag or uses a way to open a tab which can be distinguished. Or are extension APIs so limited that even that is impossible now? (I know that was the trend things were going but I'm not aware how bad it's gotten yet)

@gorhill
Copy link
Member

gorhill commented Oct 31, 2024

Not something which can be fixed.

suggest uBlock can probably

Whoever thinks it's possible to fix can submit a PR. I prefer people prove me wrong with a PR than me having to spend a lot of time to explain why suggested ideas don't work.

@u-RraaLL u-RraaLL added the Chromium specific to Chromium/Chrome label Nov 1, 2024
@anonghuser
Copy link
Author

anonghuser commented Nov 1, 2024

@garry-ut99 all those are about opening normal links in new tab, which actually works now.
edit: I mean it works on the sample pages above which have $popup filters applied to them. IDK what "no-popup switch" is in comparison and if opening links in new tabs also works with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chromium specific to Chromium/Chrome
Projects
None yet
Development

No branches or pull requests

5 participants