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

Experimental procedural cosmetic operator :others() prevents Firefox Screenshots #2099

Closed
5 tasks done
ghost opened this issue Apr 28, 2022 · 7 comments
Closed
5 tasks done
Labels
Firefox specific to Firefox wontfix won't be addressed

Comments

@ghost
Copy link

ghost commented Apr 28, 2022

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
  • The issue is not present after wholly disabling uBlock Origin ("uBO") in the browser
  • I checked the documentation to understand that the issue I report is not a normal behavior

I tried to reproduce the issue when...

  • uBO is the only extension
  • using a new, unmodified browser profile

Description

Cosmetic filters using:others() introduced by gorhill/uBlock@152120b crafted without the countermeasures interfere with Firefox Screenshots.
It may be by design, and the workaround is easy for the filter authors. However, Firefox Screenshots is a built-in add-on enabled by default, so it might be more user-friendly to handle Firefox Screenshots iframes by uBlock Origin itself in advance.

A specific URL where the issue occurs

https://www.nature.com/articles/d41586-022-00567-9

Steps to Reproduce

  1. Add nature.com##:matches-path(/^/articles//) :is(.c-breadcrumbs,.c-article-main-column):others() to My filters
  2. Open https://www.nature.com/articles/d41586-022-00567-9
  3. Right-click and select Take Screenshot

Expected behavior

Firefox Screenshot starts.

Actual behavior

Nothing happens.

Configuration

uBlock Origin: 1.42.5b2
Firefox: 99
filterset (summary): 
  network: 80946
  cosmetic: 42180
  scriptlet: 16440
  html: 631
listset (total-discarded, last updated): 
  default: 
    user-filters: 1-0, never
    ublock-filters: 31060-40, never
    ublock-badware: 3993-3, never
    ublock-privacy: 210-0, never
    ublock-abuse: 72-0, never
    ublock-unbreak: 1753-0, never
    ublock-quick-fixes: 138-4, never
    easylist: 65018-585, never
    easyprivacy: 26734-577, never
    urlhaus-1: 8896-0, never
    plowe-0: 3690-2, never
filterset (user): [array of 1 redacted]
modifiedUserSettings: [none]
modifiedHiddenSettings: [none]
supportStats: 
  allReadyAfter: 1179 ms
  maxAssetCacheWait: 129 ms
@ghost
Copy link
Author

ghost commented Apr 28, 2022

There is possibly related a Mozilla Bugzilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=1696573, but according to https://bugzilla.mozilla.org/show_bug.cgi?id=1763548#c4

That is making progress but we don't have any roadmap for shipping it and deprecating the extension yet.

@krystian3w
Copy link

krystian3w commented Apr 28, 2022

You forgot about selection and preview iframes.

Also I don't recommend repair this by :style() - Firefox uses JavaScript to change display between 3 frames (preview iframe: if is too fast visible so is saved on screen with dark/dense fog - screen no have useful functionality).

@gwarser gwarser added the Firefox specific to Firefox label Apr 28, 2022
@ghost
Copy link
Author

ghost commented Apr 28, 2022

You forgot about selection and preview iframes.

Thanks.

Also I don't recommend repair this by :style()

My intended workaround is the following filter.
nature.com##:matches-path(/^/articles//) :is(.c-breadcrumbs,.c-article-main-column,iframe[id^="firefox-screenshots-"]):others()

@gorhill
Copy link
Member

gorhill commented Apr 28, 2022

The only way to "fix" this is by removing the operator. Is this what people want?

@ghost
Copy link
Author

ghost commented Apr 28, 2022

Is this what people want?

At least I don't want that since I use it on Twitter.
This issue was intended to ask if some sort of workaround could be incorporated into uBlock Origin itself.

@ghost ghost closed this as completed Apr 28, 2022
@gorhill
Copy link
Member

gorhill commented Apr 28, 2022

some sort of workaround could be incorporated into uBlock Origin itself

Not possible, the DOM is shared by all: Firefox's own tools, other extensions, the site itself. It's just not possible for uBO to make hard-coded guesses about what should not be removed based only on DOM information. In the current case, adding iframe to the list of DOM nodes-to-not-hide works:

nature.com##:matches-path(/^/articles//) :is(.c-breadcrumbs,.c-article-main-column,iframe[id^="firefox-screenshots-"],iframe):others()

@garry-ut99

This comment was marked as abuse.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Firefox specific to Firefox wontfix won't be addressed
Projects
None yet
Development

No branches or pull requests

4 participants