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

Element picker normalize style attrib #551

Closed
4 of 8 tasks
krystian3w opened this issue Apr 30, 2019 · 3 comments
Closed
4 of 8 tasks

Element picker normalize style attrib #551

krystian3w opened this issue Apr 30, 2019 · 3 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@krystian3w
Copy link

krystian3w commented Apr 30, 2019

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

uBO change system colors on site form: style="background:#1e2a4b;"

to:

style="background: rgb(30, 42, 75) none repeat scroll 0% 0%;"

with preview mode.

A specific URL where the issue occurs

http://www.siemianowice.pl/

Steps to Reproduce

  1. Open site www.siemianowice.pl

  2. try block top dark blue banner by:

    ##div[style^="background:#1e2a4b;"]

  3. activate and deactivate preview mode

  4. close element picker

  5. again try block banner by:

    ##div[style^="background:#1e2a4b;"]

  6. filter no longer works without refresh page.

Expected behavior:

no longer reformate CSS color attrib style in tag.

Actual behavior:

still reformate CSS color attrib style in tag.

Your environment

  • uBlock Origin version: 1.16.8
  • Browser Name and version: Firefox 66.0.3
  • Operating System and version: Windows 10
@gwarser gwarser added the something to address something to address label Apr 30, 2019
@gorhill
Copy link
Member

gorhill commented Apr 30, 2019

uBO adds display: none !important; when previewing, and this causes Firefox to normalize the style attribute such that it no longer literally matches the original value.

A possible solution is for the picker to use a randomly generated attribute for preview purpose and avoid messing with the original style attribute.

@gwarser
Copy link

gwarser commented Apr 30, 2019

Picker preview on/off changes style attribute on previewed element from
style="background:#1e2a4b;height:96px;overflow:hidden;font-size:11px;line-height:1.3em;font-family:arial"
to
style="background: rgb(30, 42, 75) none repeat scroll 0% 0%; height: 96px; overflow: hidden; font-size: 11px; line-height: 1.3em; font-family: arial;"

@krystian3w
Copy link
Author

krystian3w commented Apr 30, 2019

Also I can use slower has / has-text (milliseconds jumping and blinking site in worse case).

@krystian3w krystian3w changed the title Element picker reformating style tag Element picker normalize style tag Apr 30, 2019
@krystian3w krystian3w changed the title Element picker normalize style tag Element picker normalize style attrib Apr 30, 2019
gorhill added a commit to gorhill/uBlock that referenced this issue May 17, 2019
Related issue:
- uBlockOrigin/uBlock-issues#551

The issue fixes previewing the hiding/unhiding of targeted
elements in the element picker.

However it does not address the case of previewing
`:style(...)` operators -- this would require a much
more complex fix, which I am not sure is worth the
amount of work and increased code complexity.
@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed and removed something to address something to address labels May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

4 participants