Make "View Source" page follow system dark theme
Categories
(Toolkit :: View Source, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | verified |
People
(Reporter: wjmacfarland, Assigned: aminomancer, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
3.45 KB,
patch
|
Details | Diff | Splinter Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
Developed dark theme option for the "View Source" page. This allows the user to toggle between the default (light) and new (dark) theme style sheets. The option is serialized on exit and restored in the same manner as the existing options and the last used setting is used when creating a new tab. For performance reasons, I modified the C++ code to remove the default link (stylesheet) element from being attached to the head of the View Source page. Javascript is then employed to add the correct stylesheet upon creation of the page. Similar to the word wrapping and syntax highlighting, a class is added to the body for the dark theme setting which the JS code then uses to affix the proper stylesheet to the head.
Actual results:
Reporter | ||
Comment 1•5 years ago
|
||
no test code yet, waiting on approval.
Comment 2•5 years ago
|
||
I wil set a component for this enhancement. We wait for a response from dev's team side if the option "Use Dark Theme" should be added below the "Syntax Highlighting".
Regards,
Liviu
Updated•5 years ago
|
Comment 4•4 years ago
|
||
Thanks for reporting! I don't think the patch that's attached in the right one. Do you have the right one by any chance ?
This is something we'd approve, but making it follow the system setting (@media (prefers-color-scheme: dark)
rather than a separate setting).
Comment 5•4 years ago
|
||
Also, making it use @media (prefers-color-scheme: dark)
means that this would be purely CSS, and wouldn't require writing tests.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Basing it only on prefers-color-scheme
(without any setting/override) incurs the disadvantages of robbing the user of control (bug 565512) in cases where they desire a different color scheme in view-source
and of making this feature currently (and for the foreseeable future?) broken and unusable if privacy.resistFingerprinting
is on (bug 1535189, bug 1588548, bug 1401440, ...).
Comment 8•4 years ago
|
||
(In reply to vagmer from comment #7)
Basing it only on
prefers-color-scheme
(without any setting/override) incurs the disadvantages of robbing the user of control (bug 565512) in cases where they desire a different color scheme inview-source
and of making this feature currently (and for the foreseeable future?) broken and unusable ifprivacy.resistFingerprinting
is on (bug 1535189, bug 1588548, bug 1401440, ...).
That seems okay. The resistFingerprinting issue should be addressed more broadly. We're not going to add UI to work around this only for view-source.
Comment 9•4 years ago
|
||
Just dropping a patch I had. This works well for the view-source page, but breaks the XML prettyprinting one...
Assignee | ||
Comment 14•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 17•2 years ago
|
||
Yeah I don't have any further changes. Thanks
Comment 18•2 years ago
|
||
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/14d0c71acebc Make viewsource and XMLPrettyPrint adapt to preferred color scheme. r=dao
Comment 19•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Comment 20•2 years ago
|
||
This enhancement seems to be implemented on Firefox 98.0b3(20220210185745) as well as Nightly 99.0a1(20220210213101). Toggling between light and dark theme works as expected. Checked on macOS Big Sur 11, Linux(Ubuntu 20.04) and Win10.
Description
•