Change scrollbars Tor Browser 8 (Fx 60.2.0ESR) _userChrome still work?
Tor Browser 8.0_Linux x64 (uses Firefox 60.2.0esr) made a lot of changes to scrollbars & a few other UI objects. TBB 8.0 doesn't pick up the active Linux theme elements. I'm not sure if it ever did, but some things in v8.0 don't suit my needs. I'm wondering why it doesn't pick up the system theme.
Regular Linux Firefox 60.1.0ESR uses the system theme - either native ones from the distro, or custom themes. So it appears it's NOT just because the theme(s) contain code that Fx Quantum can't use. Right off, I don't see anything that regular Fx 60.1 ESR isn't using from the active system theme.
AFAIK, there is no change for namespace lines in CSS files from before and after Fx 57. I made no changes to the system theme after installing Fx 60.1ESR, to make it work. Apparently, no one on the official Tor mailing list has any ideas why TBB wouldn't use the system theme.
TBB 8 / Fx 60.2.0 ESR has a /Browser/gtk2/libmozgtk.so file, that appears to control some of the UI, but so does regular Fx 60.1 ESR, and it doesn't ignore the system theme. The TBB libmozgtk.so file is larger than the version in regular Fx.
Nothing jumped out for differences in about:config, searching "theme" between the TBB version vs. the version from Mozilla.
2) Besides TBB 8.0 ignoring the system theme & so far not using code from userChrome that worked in Linux in all regular Fx versions < 57, Frank Lion says most of old UI css code for pre Firefox 57 will still work for Fx 57+, but some may not. Again, Firefox 60.1esr (linux) just uses the system theme - including customized scrollbars & sliders. The(clean) profile for Fx 60.1esr has no userChrome.css file.
But Fx 60.1esr DOES have a /gtk2/libmozgtk.so file and still uses the system theme. If I wanted to further customize objects in regular Fx 57+, I COULD add a userChrome.css, as I did pre-v57. Generally, I didn't have problems customizing say, scrollbars, using userChrome.css, even though the system theme also had custom code for scrollbars.
Geändert am
Alle Antworten (5)
As far as I know, scrollbars could never be overridden restyled by userChrome.css, at least on Windows. A legacy extension was required. How did you do it before?
Geändert am
Only an AGENT_SHEET can customize the scroll bars. UserChrome.css is processed as an USER_SHEET and scripts from websites are AUTHOR_SHEET.
- https://dxr.mozilla.org/mozilla-central/source/layout/base/nsIStyleSheetService.idl
- AGENT_SHEET:0; USER_SHEET:1; AUTHOR_SHEET:2;
"Only an AGENT_SHEET can customize the scroll bars."
Yep, that's how I did it, and using Stylish. I'd forgotten that. You can change colors & such for scrollbars in Linux, through a custom theme. Unless you use something like Stylish, it'll be the same colors as all other apps, but they're "customized."
I'm not sure if it'd work copying the Agent Sheet code into a userChrome file? It didn't seem to work, just now. That may be due to changes in Fx 57+.
The only thing different (to my eye) of the "agent sheet" code vs. what a css file, was the words, "Agent Sheet."
I copied it from UserStyles & did some mods, but it all looks like a normal CSS file. Started out:
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/********************************/ /* iBaked V for Firefox Scrollbar {DarkState} */ /********************************/
/* By DarkMorpher; heavily edited by Mr. */ /********************************/
/* AGENT_SHEET */
slider [orient="vertical"] {
-moz-appearance: none !important; background: -moz-linear-gradient(right, rgba(251,252,170,.6), rgba(234,234,230,1)) !important; min-width: 16px !important; max-width: 16px !important;
}
scrollbar {
-moz-appearance: none !important; background: LightYellow !important; border-left: 1px solid #161616 !important; max-width: 16px;
} NOTE: I found if "-moz-appearance: none !important;" wasn't used on the slider, Mozilla added a default 2px border outside the slider.
There was much more, but not bad. I started using it in Windows. Then switched to Linux. I installed Stylish under Linux & copied the Stylish database over. To my surprise, most of it worked w/o modifying code.
The only thing I really see different are the magic words, Agent Sheet. I don't know if it'll work in Fx 57+. Unless the agent sheet HAS to have Stylish to work. I don't see why, but...
NOTE: The code in Linux gtk3/gtk-widgets.css that controls GUI of most Linux apps using gtk3, was much different than the code in the so called Agent Sheet, that also worked in Linux (spaces, periods before & separating selectors, etc.).
Now I understand that "they" have changed some CSS syntax for Firefox 57+ and possibly for CSS3 in general? I'm not quite clear on that.
So short of installing Stylish (the older, pre-spy version) that probably won't work in Fx web ext versions, is there another way to style Fx scrollbars?
That still doesn't explain why Tor Browser won't pick up basic colors from the Linux theme (even custom colored scrollbars) , while regular Fx does use the system theme.
The magic words AGENT_SHEET were a signal to Stylish 2.x to use a legacy API* to load the rules as an agent sheet instead of user sheet. That API still exists and could theoretically be called through a script submitted in the Browser Console (by hand), but I don't recall seeing instructions for that.
* By legacy API, I mean an API that legacy extensions can use, but current extensions cannot.
Geändert am
Thanks for clearing up Agent Sheets.
I gave the wrong impression that the only issue in Tor Browser was the scrollbars / sliders. It doesn't use any of the system theme colors or styling that Firefox does.
Unless Tor Browser devs coded it not to use System themes or something's interfering, the only other difference I can think of for it not using the system theme like regular Fx does is, that Tor devs recommend extracting TBB to the Linux user's Home directory, NOT to a root owned directory. I can try extracting it to /opt to see if it changes its UI..
All of my gtk2 & gtk3 apps use the custom theme colors, even gradients, etc.. You can add gradients, highlights, etc., on gtk2 apps' scrollbars, toolbars, buttons, etc, using gtk2 "theming engines. "
I just realized that Firefox scrollbars & sliders use code in the gtk3/gtk.css file of the system (custom) theme, but it doesn't use much, if any of the fancier styling that other gtk2 / 3 apps do on objects besides the scrollbars.
Firefox may use the basic colors the other gtk3 apps use, but not much else. Maybe the mozilla's syntax for adding a gradient, etc., is different than standard CSS3 or what Linux uses. Maybe you meant scrollbars can't be styled using CSS in userChrome.css, w/o using Agent Sheet? And Tor Browser uses none of it!
Other than the extraordinarily complex theme I selected, sometimes it was a little easier to find object names and the correct syntax in Linux to style or change all gtk2 or gtk3 apps than for Firefox & Thunderbird in Windows. EasiER, not easY.
I don't know what special powers are given to gtk3/gtk.css files in some Linux desktop environment themes. The detailed Linux full themes are big, complex documents.
Even though Fx appears to use some gtk2 (has a gtk2 directory), Fx isn't using the gtk2/gtkrc file, AFAIK..