I have a dark GTK theme installed in my Ubuntu 10.10 install and a persona installed for Firefox that I also like.
The problem is that Firefox is using my dark GTK theme for items like buttons and text fields on common web pages, and this commonly creates unreadable menus, text areas, and buttons. (white text on white backgrounds, or black text on black buttons).
I don't want to change either theme, because they look great in every other application, and I don't want to have to do something crazy to my Firefox install like use custom user scripts or CSS overrides.
All I want to do is tell Firefox to stop using my GTK theme completely. This appears to be what Google's Chrome browser does and it makes the most sense by far.
How can web developers possibly work around all the possible GTK themes out there?
Permanent solution:
You can specify a light GTK theme to use for rendering webpages in about:config. This is great because your system theme will still apply for menus etc. but the webpages will be rendered as they are with light themes.
about:config
in your Firefox browserwidget.content.gtk-theme-override
as the nameArc
Source: https://www.reddit.com/r/firefox/comments/6rbvvw/photon_rectangular_tabs_have_landed_in_nightly/dl4318f/
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1283086
Start Firefox with one of the following command:
env GTK_THEME=Adwaita:light firefox
env GTK2_RC_FILES=/usr/share/themes/Simple/gtk-2.0/gtkrc firefox
This will launch Firefox using the Simple/Adwaita:light theme, which is pretty basic and should blend with your Persona. You can try other themes, by replacing Simple with the theme name, but this doesn't work with all themes.
So far I have successfully tested with Simple and Redmond themes...
Before
After
UPDATE: My original answer actually gets overwritten when Firefox updates.
My current (permanent) solution
Edit
~/.mozilla/firefox/abcdef.default/chrome/userContent.css
(where abcdef is a random string)
Add
Original answer
I found a solution to make Firefox completely ignore your GTK theme.
Edit
/usr/share/applications/firefox.desktop
and changeto
When you (re)start FF it will only use the FF theme.
I would like to add to the great answer of @lovinglinux a way to make Firefox to load the theme when opened from a launcher in the taskbar instead of command line:
Copy the Firefox desktop file to your home directory.
In the
Exec
line, replace the value after=
with a command using the instructions provided by the mentioned @lovinglinux:And the result is this:
The best solution to tell Firefox that it should use the light theme instead of the dark is by specifying the GTK_THEME variable prior to launching.
So, 4 ways you get for doing this..
1- from terminal you can do:
2- if you hate the terminal and wanna close it once firefox works:
3- from firefox about:config you can set the following setting to false:
WON'T WORK FOR localhost SITES! so if you are a web developer/designer it won't work out that well for you.
4- if you want this to be the defualt behavior:
Just add two lines to the Firefox launcher script located at /usr/lib/firefox/firefox.sh
in the terminal type down:
look at the beginning of the script for this:
and change it to this:
Finally, restart Firefox.
Hope this helps.
Please help me by voting this up.
Thank you :)
This add-on (suggested by koushik) works well for me.
I'm using Firefox 57 on Ubuntu MATE 17.10
There is a very simple way to get the default color scheme back for web pages while still keeping your GTK theme for Firefox elements. I know it's not exactly what was asked, but it may help people coming here from a Google search.
about:config
in your address bar.browser.display.foreground_color
browser.diaplay.background_color
reset
.That should be it, no restart necessary. This works with Firefox Quantum.
Settings in about:config
I'm using the
Adwaita dark theme
withUbuntu 18
. I'm using the default theme infirefox 63.0
. The best solution in my case, with no side effects at all, was to force firefox to use a light theme (Adwaita
in my case) for web content rendering only :about:config
in the address bar.widget.content.gtk-theme-override
( right click > New > String ).Adwaita
in my case ).Change the GTK theme for content process only
You could start Firefox with a different user and the same profile. Copy your current profile (~/.mozilla/firefox/profile) to that different user's folder, chown it to the user, and then on your console run:
This sounds a bit overkill, but you can put it into a script. Firefox will use the theme on the profile, but keep the unthemed GTK from the new user.
Also, this is the kind of stuff that makes it fun to use Firefox and Ubuntu :P
You can add another theme to Firefox that you like from Tools -> Addons -> Themes. Then just use that theme instead of the default one.