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

[PM-10730] Override FireFox extension styles for text alignment #10528

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

nick-livefront
Copy link
Collaborator

@nick-livefront nick-livefront commented Aug 15, 2024

🎟️ Tracking

PM-10730

📔 Objective

This one is probably worth discussing as it is a global change.

Issue

FireFox applies default styles to extensions, one of which is text-align: start. This causes some elements to not inherit the text-align property from their parent, as they would in other browser implementations.

You can see the conflicting styles here and an explanation of the entire stylesheet here.

Fix

Rather than playing wack-a-mole with each implementation in the bug ticket, and any other future bug tickets for the same (like PM-8626). I applied a global style for the extension that will override the FF styles and force inheritance as the default behavior for the text-align property.
Edit: See Shane's comment below: #10528 (comment)

The comment within the file also states that these styles will be going way for MV3. PM-8317 is out there to do this work in the future.

Of course an option is to find each conflicting implementation and add tw-text-center but that isn't as future proof. I'm happy to do that, but wanted to start here first!

📸 Screenshots

Before After
Screenshot 2024-08-15 at 11 44 47 AM Screenshot 2024-08-15 at 11 44 22 AM

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@nick-livefront
Copy link
Collaborator Author

@shane-melton @Jingo88 There doesn't appear to be code owners, feel free to add who you see fit!

Copy link
Contributor

github-actions bot commented Aug 15, 2024

Logo
Checkmarx One – Scan Summary & Details37e46902-1b1f-4b7e-9d34-247c57b3be02

New Issues

Severity Issue Source File / Package Checkmarx Insight
LOW Client_DOM_Open_Redirect /apps/browser/src/tools/popup/send-v2/send-created/send-created.component.ts: 48 Attack Vector

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.78%. Comparing base (325d338) to head (4b7127c).
Report is 23 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10528   +/-   ##
=======================================
  Coverage   32.78%   32.78%           
=======================================
  Files        2669     2669           
  Lines       81514    81514           
  Branches    15355    15355           
=======================================
  Hits        26727    26727           
  Misses      52743    52743           
  Partials     2044     2044           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shane-melton
Copy link
Member

Nice find on this! After looking into some more myself, I think we be able to just set browser_styles: false for the sidebar_action in our manifest.json and, according to the docs, this will prevent extra style sheet from being applied. (this seemed to work as expected based on some quick testing of my own)

It already defaults to false for the popup (action), it seems that only sidebar_action is different and defaults to true.

I think this has the benefit of avoiding manually overriding the styles and having to track why its there (granted, your comment is very clear). It also moves us one small step closer to future MV3 defaults.

@nick-livefront
Copy link
Collaborator Author

Nice find on this! After looking into some more myself, I think we be able to just set browser_styles: false for the sidebar_action in our manifest.json and, according to the docs, this will prevent extra style sheet from being applied. (this seemed to work as expected based on some quick testing of my own)

@shane-melton Nice find! I remember reading through that but I have no idea why I ruled it out in my head. Either way, tested and functions as we'd expect! 👏

@shane-melton shane-melton requested review from a team and justindbaur August 15, 2024 18:44
@shane-melton shane-melton added the needs-qa Marks a PR as requiring QA approval label Aug 15, 2024
@nick-livefront nick-livefront removed the needs-qa Marks a PR as requiring QA approval label Aug 19, 2024
@nick-livefront
Copy link
Collaborator Author

QA Approval given on ticket 🥳

@nick-livefront nick-livefront merged commit deab1d1 into main Aug 19, 2024
29 of 30 checks passed
@nick-livefront nick-livefront deleted the vault/pm-10730/firefox-text-alignment branch August 19, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants