How can one make Firefox ignore my GTK theme entirely?

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.

  1. Navigate to about:config in your Firefox browser
  2. Right click and select new->string
  3. Enter widget.content.gtk-theme-override as the name
  4. Enter a light GTK theme that you have installed on your system for the value. e.g. Arc
  5. Restart firefox.

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:

  • GTK3 Firefox 46+: env GTK_THEME=Adwaita:light firefox
  • GTK2 Firefox <46: 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

Before

After

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

input:not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']):not([type='radio']), textarea, select {
    -moz-appearance: none !important;
    background-color: #eee;
    color: #111;
}

Original answer

I found a solution to make Firefox completely ignore your GTK theme.

Edit /usr/share/applications/firefox.desktop and change

Exec=firefox %u

to

Exec=bash -c 'GTK_THEME=" " firefox %u'

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:

  1. Copy the Firefox desktop file to your home directory.

    mkdir -p "/home/$USER/.local/share/applications/"
    cp -v "/usr/share/applications/firefox.desktop" \
      "/home/$USER/.local/share/applications/"
    
  2. In the Exec line, replace the value after = with a command using the instructions provided by the mentioned @lovinglinux:

    bash -c 'GTK2_RC_FILES=/usr/share/themes/Redmond/gtk-2.0/gtkrc firefox %u'
    

Kate editing firefox.desktop

And the result is this:

Firefox with Redmond theme and all other applications with a dark theme