MozillaZine

Modify "unread tabs" with userChrome

Discussion about official Mozilla Firefox builds
Diorser

User avatar
 
Posts: 934
Joined: June 22nd, 2005, 6:57 am

Post Posted October 9th, 2017, 4:21 am

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: 2732
Joined: March 19th, 2005, 10:51 am

Post Posted October 9th, 2017, 6:57 am

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.
users who problaby never will get an answer from me: f*x, f*n, j*n, k*s, k*x, l*y, m*o, m*d, m*x, o*l, p*y, s*e, d*h, l*t, d*e, j*k, f*u*a, h*2

Diorser

User avatar
 
Posts: 934
Joined: June 22nd, 2005, 6:57 am

Post Posted October 9th, 2017, 7:17 am

Already investigated before posting my 1st message.

Gingerbread Man

User avatar
 
Posts: 7640
Joined: January 30th, 2007, 10:55 am

Post Posted October 9th, 2017, 7:28 am

Hello,

Here's an example:
Code: Select all
.tabbrowser-tab[unread="true"] {
  color: crimson !important;
  font-weight: bold !important;
}

Brummelchen
 
Posts: 2732
Joined: March 19th, 2005, 10:51 am

Post Posted October 9th, 2017, 7:43 am

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.

Diorser

User avatar
 
Posts: 934
Joined: June 22nd, 2005, 6:57 am

Post Posted October 9th, 2017, 9:05 am

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.

Aris

User avatar
 
Posts: 3070
Joined: February 27th, 2011, 10:14 am

Post Posted October 9th, 2017, 10:02 am

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}
Customize Firefox 57+ UI || Classic Theme Restorer (Fx 29-56) || Classic Toolbar Buttons || CustomizeMyBird

How to use legacy add-ons after Firefox 57 release? Switch to Firefox 52 ESR or move to Waterfox browser or Basilisk browser.

Diorser

User avatar
 
Posts: 934
Joined: June 22nd, 2005, 6:57 am

Post Posted October 9th, 2017, 10:14 am

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: 2732
Joined: March 19th, 2005, 10:51 am

Post Posted October 9th, 2017, 3:02 pm

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;
}

Gingerbread Man

User avatar
 
Posts: 7640
Joined: January 30th, 2007, 10:55 am

Post Posted October 10th, 2017, 8:38 am

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

Diorser

User avatar
 
Posts: 934
Joined: June 22nd, 2005, 6:57 am

Post Posted October 11th, 2017, 2:58 pm

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.

Frank Lion

User avatar
 
Posts: 19515
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom

Post Posted October 11th, 2017, 5:59 pm

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.
Metal Lion latest SeaMonkey & Thunderbird Themes - Sea Monkey and Silver Sea Monkey
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)

Aris

User avatar
 
Posts: 3070
Joined: February 27th, 2011, 10:14 am

Post Posted October 12th, 2017, 12:49 am

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.
Customize Firefox 57+ UI || Classic Theme Restorer (Fx 29-56) || Classic Toolbar Buttons || CustomizeMyBird

How to use legacy add-ons after Firefox 57 release? Switch to Firefox 52 ESR or move to Waterfox browser or Basilisk browser.

Brummelchen
 
Posts: 2732
Joined: March 19th, 2005, 10:51 am

Post Posted October 12th, 2017, 12:51 am

// not sure if size matters - i thought more about security - packing/unpacking malware //

Return to Firefox Builds


Who is online

Users browsing this forum: No registered users and 2 guests