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

[🐛 Bug]: Apply color change to background-color, not background. #24

Open
2 tasks done
wiseaidev opened this issue Mar 15, 2023 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@wiseaidev
Copy link
Collaborator

👶 Getting Started
Please search the history to see if an issue already exists for the same problem.

  • I have searched the existing issues.
  • I have tested the latest version.

📝 Describe the bug
While testing this extension on twitter, I noticed that it overrides background pictures.

🕹 Steps to reproduce
Steps:

  1. Go to a Twitter page.
  2. Change the background color.
  3. Notice how it overrides all pictures because Twitter displays pics as background images for divs, not using the img tag.

😯 Current behavior
Overrides all background images

🤔 Expected behavior
Change only the background color.

📸 Screenshots

Screenshot from 2023-03-15 18-15-12

🔦 Additional context
All you need is to change the following line to use background-color instead of background:

https://github.com/wiseaidev/flexify/blob/5e728a750d7b972e77ff2637ac59c57c215afe79/scripts/popup.js#L2837

@wiseaidev wiseaidev added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels Mar 15, 2023
@mud1tx
Copy link
Contributor

mud1tx commented Mar 29, 2023

Can you please describe what we have to do in this issue, please?

@wiseaidev
Copy link
Collaborator Author

wiseaidev commented Mar 29, 2023

As mentioned, the current implementation overrides all background images when changing the background color for a given web page. One way to fix it is by replacing background: ${color}!important; with background-color: ${color}!important; in this line:

style.innerHTML = `body.set-background-colors *, body.set-background-colors h1, body.set-background-colors h1 span, body.set-background-colors h2, body.set-background-colors h2 span, body.set-background-colors h3, body.set-background-colors h3 span, body.set-background-colors h4, body.set-background-colors h4 span, body.set-background-colors h5, body.set-background-colors h5 span, body.set-background-colors h6, body.set-background-colors h6 span, body.set-background-colors p, body.set-background-colors a, body.set-background-colors li, body.set-background-colors label, body.set-background-colors input, body.set-background-colors select, body.set-background-colors textarea, body.set-background-colors legend, body.set-background-colors code, body.set-background-colors pre, body.set-background-colors dd, body.set-background-colors dt, body.set-background-colors span, body.set-background-colors blockquote {background: ${color}!important;}`;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants