Modify "unread tabs" with userChrome

Discussion about official Mozilla Firefox builds
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Modify "unread tabs" with userChrome

Post by Diorser »

Hi,
I am looking for a solution to modify unread tabs without any extension (= tabs loaded in background).

The code below works fine in userChrome.css for current and others tabs.

Code: Select all

/* selected tab */
.tabbrowser-tab[visuallyselected="true"] {
    color:#00e !important; font-weight: bold !important;
}

/* not selected tab */
.tabbrowser-tab:not([visuallyselected="true"]) {
    font-style: italic !important; 
}
I did not find the relevant class Id in chrome://browser/content/browser.xul .
Any idea to modify specifically unread tabs ?
Thanks.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Modify "unread tabs" with userChrome

Post by Brummelchen »

you should have a look into this collection - will help you out
https://github.com/aris-t2/customcssforfx

i am currently examining code for my needs.
the magic number is 51 and you are probably part of it :p
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Modify "unread tabs" with userChrome

Post by Diorser »

Already investigated before posting my 1st message.
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: Modify "unread tabs" with userChrome

Post by Gingerbread Man »

Hello,

Here's an example:

Code: Select all

.tabbrowser-tab[unread="true"] {
  color: crimson !important;
  font-weight: bold !important;
}
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Modify "unread tabs" with userChrome

Post by Brummelchen »

without any extension
only without extension, extensions are not allowed to screw this.
Already investigated before posting my 1st message.
you should write that down next time - i dont have a magic bullet nor am i a mentalist.
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Modify "unread tabs" with userChrome

Post by Diorser »

Gingerbread Man wrote:Here's an example
Great ! Tested / this works fine,on Firefox 57 but two solutions....:
1 - either you are really very very lucky because I spent hours on this issue investigating browser.xul component, gogoling all I could, investigating some proposed Firefox 57 themes, and considering solutions which worked before and I have used in the past do not automatically work for Firefox 57.
... see similar question even raised 15 years ago: https://bugzilla.mozilla.org/show_bug.cgi?id=133053

2 - or you are not lucky at all, but found a methodology to point out the solution.

Can you explain a bit more where you found any "unread" reference in Firefox 57 code, or how you found it ?
Thanks.
User avatar
Aris
Posts: 3248
Joined: February 27th, 2011, 10:14 am

Re: Modify "unread tabs" with userChrome

Post by Aris »

Firefox 57 or Firefox in general does not refer to unread or unloaded tabs in its css files, but it sets the attributes for tabs the same way it did years ago. You can inspect many things using DOM Inspector in Firefox 56 to get general results. You also can use the new inbuilt inspector of Firefox 57, but it is not as handy as before.

Long story short, unread/unloaded tab attributes were known from older Firefox builds (via DOMI) or TabMixPlus/TabUtilitities/CTR code.
/* unloaded tab */
.tabbrowser-tab[pending] { //your code}
/* unread tab */
.tabbrowser-tab[unread] { //your code}
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Modify "unread tabs" with userChrome

Post by Diorser »

Aris wrote:You can inspect many things using DOM Inspector in Firefox 56 to get general results.
I precisely used the incorporated inspector tool, but did not help at all, may be too focused on browser.xul component.

These kind of tricks should be grouped somewhere per version, avoiding loosing time finding out why something working fine before does not work anymore.

You will find for example this code in some Firefox themes, which does not work on Firefox 57:

from chrome_fx57r52_v1.0.1/css/tabs/classic_squared_tabs.css @ https://github.com/aris-t2/customcssforfx/releases

Code: Select all

/* unread tab */
#TabsToolbar:not(:-moz-lwtheme) .tabbrowser-tab[unread] .tab-content {
  background: purple !important;
}
In summary, nothing obvious at all.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Modify "unread tabs" with userChrome

Post by Brummelchen »

current is 1.0.3

but i am with you - that code my not work as stand alone, maybe only with combination of another tab style in the collection.

btw i moved the tabs-bar to the left to avoid the empty annoying upper left corner which seems not to have any functionality.

Code: Select all

/*AGENT_SHEET*/
	
#main-window[sizemode="normal"] #TabsToolbar
{
  margin-left:  -39px !important;
}
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: Modify "unread tabs" with userChrome

Post by Gingerbread Man »

Diorser wrote:Can you explain a bit more where you found any "unread" reference in Firefox 57 code, or how you found it ?
Thanks.
You're welcome. I used the Browser Toolbox to inspect a tab I opened in the background. Read the article for usage directions and see the screenshot below for an illustration:
Image
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Modify "unread tabs" with userChrome

Post by Diorser »

Ok thank you but I'm afraid this is not for me, and probably more for developers, although I've spent hours analyzing chrome://browser/content/browser.xul with this tool.
It has been much faster for me on older releases of Firefox to modify unread tabs, because userChrome tricks easily available on many Firefox support sites.
If not wrong, I understood it's going to become harder and harder to customize Firefox if userChrome is removed in coming releases.
Hope "normal" users will easily find your post to not loose hours trying to customize.
User avatar
Frank Lion
Posts: 21177
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Modify "unread tabs" with userChrome

Post by Frank Lion »

Diorser wrote:Ok thank you but I'm afraid this is not for me, and probably more for developers, although I've spent hours analyzing chrome://browser/content/browser.xul with this tool.
If it helps, I can't understand the damn thing either and I've been playing the DOM Inspector like a fiddle for over 10 years.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
Aris
Posts: 3248
Joined: February 27th, 2011, 10:14 am

Re: Modify "unread tabs" with userChrome

Post by Aris »

Diorser wrote:..
If not wrong, I understood it's going to become harder and harder to customize Firefox if userChrome is removed in coming releases.
Hope "normal" users will easily find your post to not loose hours trying to customize.
Once/if userChromes.css is gone, the very last option of modifying ui would be inserting custom code into browsers default files by unpacking omni.ja, modifying necessary files and repacking the file. I doubt anyone would modify Firefox that way for every update.
But that will only work, if "devs" won't repeat the stupid idea of using obfuscated compression methods (no common and uncommon software can handle) for omni.ja file (like happened a while ago with an own version of brotli compression) to literally save a few KBs of files size.


@Brummelchen

They only wanted to reduce omni.ja's file size: https://bugzilla.mozilla.org/show_bug.cgi?id=1352595
Last edited by Aris on October 12th, 2017, 1:06 am, edited 1 time in total.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Modify "unread tabs" with userChrome

Post by Brummelchen »

// not sure if size matters - i thought more about security - packing/unpacking malware //
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: Modify "unread tabs" with userChrome

Post by Diorser »

I wondered why "unread tabs" modification was broken in recent Fx releases.
The reason is that someone decided to break it and declare it as a "bug".
Amazing to decide to remove one feature because a developer doesn't use it.

Bug 1453957 - Stop setting the "unread" attribute on tabs
https://bugzilla.mozilla.org/show_bug.c ... id=1453957

EDIT: this one seems to still work, then not yet 100% broken.

Code: Select all

.tabbrowser-tab[notselectedsinceload="true"] {  color: crimson !important;  }
Post Reply