-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add FXIOS-11179 [Dark Mode] Use darkreader for webviews #24327
Conversation
Client.app: Coverage: 32.3
WebEngine: Coverage: 71.09
Generated by 🚫 Danger Swift against d95d709 |
firefox-ios/Client/Frontend/UserContent/UserScripts/MainFrame/AtDocumentEnd/DarkReader.js
Outdated
Show resolved
Hide resolved
...ios/Client/Frontend/UserContent/UserScripts/MainFrame/AtDocumentEnd/LegacyNightModeHelper.js
Outdated
Show resolved
Hide resolved
Nit; could you fix the tasks link in the PR description? 😄 I wanted to have a look at them since I was curious about the work! |
Sure. I was too lazy to do it last Friday 😂 Done now. I added a link to the spec doc in the jira ticket. |
52a7f00
to
d95d709
Compare
// If a script already exists on the page, skip adding this duplicate. | ||
guard scripts[name] == nil else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
This looks great! Is this a candidate to add to the feature flags toggle panel in the secret settings menu for testing purposes? I noticed while testing that there was this weirdness with Twitter/X Google button but I'm guessing that's just them having a bad asset? (This is with Night Mode enabled) I don't really feel qualified to hit approve on this because I'm not a JS dev at alllll, so I'll let @nbhasin2 do it, but the swift looks good to me! TIL what |
That google button is odd but I doubt we can do anything with it. My understanding is it can be fixed by DarkReader when they update their scripts. |
Ok I prematurely bumped the package version yesterday 🙈 . I downgraded it now and it behaves as expected for x.com. I tried the build from source and it also behaves correctly. It seems to be a bad version in between. Will update to the latest version once that's published to npm. Thanks for flagging @dataports 😄
Exactly, this is the goal. They merge a few PRs a day fixing things so we should benefit from those fixes. Once we finish up phase 3, we should be updating this more regularly. |
Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com>
96902ad
to
056dccf
Compare
Ok BR is failing. Will check back tomorrow what's happening. Seems unrelated... |
@Mergifyio backport release/v135 |
✅ Backports have been created
|
* chore: add darkreader lib * feat: add nimbus flag * feat: pass down flag to JS * feat: move old code to LegacyNightModeHelper and add logic to pick treatment * fix: lint * fix: wrong flag value * fix: cleanup flag check * fix: typo Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> * fix: remove vim modeline Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> * chore: add license * chore: move night mode to separate dir * feat: isolate nightmode into its own content world * fix: update mocks * fix: downgrade darkreader to previous version --------- Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> (cherry picked from commit 3fbead0) # Conflicts: # firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift
) (#24453) * Add FXIOS-11179 [Dark Mode] Use darkreader for webviews (#24327) * chore: add darkreader lib * feat: add nimbus flag * feat: pass down flag to JS * feat: move old code to LegacyNightModeHelper and add logic to pick treatment * fix: lint * fix: wrong flag value * fix: cleanup flag check * fix: typo Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> * fix: remove vim modeline Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> * chore: add license * chore: move night mode to separate dir * feat: isolate nightmode into its own content world * fix: update mocks * fix: downgrade darkreader to previous version --------- Co-authored-by: Nishant Bhasin <nish.bhasin@gmail.com> (cherry picked from commit 3fbead0) # Conflicts: # firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift * fix: merge conflict --------- Co-authored-by: Issam Mani <issamouu69@gmail.com>
📜 Tickets
Jira ticket
Github issue
💡 Description
This PR:
📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)