MozillaZine

User:Dickvl/TabVisited

From MozillaZine Knowledge Base

In Firefox 3.6 and above it is no longer possible to use the selected attribute to style unvisited and visited tabs with code in userChrome.css and only the selected tab gets a selected="true" attribute. In previous Firefox 3 and 3.5 versions visited tabs get a selected="false" attribute, but that attribute was removed to fix buggy behavior [1], [2].

Contents

TabVisited

I have attached an extension TabVisited to bug 487242 to add a visited attribute to tabs that have been visited that can be used until bug 487242 gets fixed.
Tabs that haven't been visited do not have that attribute. The currently selected tab has a selected and a visited attribute.
See comment #c0 [3] (Description) for some coding examples.
You can drop the extensions XPI file in the %AppData%\Mozilla\extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384} folder (Linux: ~/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}) to install the extension for all profiles, including nightly Minefield and Namoroka builds. The extension will be installed on the next start of Firefox [4]

Here are some versions of TabVisited that you can try out. Version 1.1 only adds the visited attribute, so you need to add code to userChrome.css to see visited tabs different. Versions 2.0 and 2.5 have CSS code embedded and work without adding code to userChrome.css. Version 2.5 only sets the text color and not the background color. All three versions work in Firefox 3 and SeaMonkey 2, only tested with the default theme and without other extensions that modify the tab bar.

TabVisited 1.1

Copy and paste the full DATA code in the location bar and save the file as tabvisited-1.1-fx-sm.xpi (Apr 13 2011)
You can install the extension via File > Open File or by dragging the file in a Firefox window.
The maxVersion for Firefox is set to 4.*. This version works in SeaMonkey 2 as well.

data:application/octet-stream;base64,
UEsDBBQAAAAIAAoZPDwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAOU8WBLlPFg
S1V4BADoA2QAlc0xCoAwDIXhuQUP4QWa3dvEGrSiDcRY9fYKSuvg4pjHxx/PUSmqUWxTWIJSZ0aU
xg/CM0FZ3bXW4G8Nla0sJ5IJD3PTBqAV3haSjJ7b7etUUClm93py0Y9wxBR6VC7pvPyOn1BLAwQU
AAAACADGCo4+6ANs9bABAADqAwAACwAcAGluc3RhbGwucmRmVVQJAAMkMKZN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AAPKKaZNdXgLAAEE
6QMAAARkAAAAUEsFBgAAAAAEAAQAOAEAAPEFAAAAAA==

TabVisited 2.0 with CSS code

This version has the CSS code from [5] embedded (chrome://tabvisited/content/tabvisited.css).
Works with Nightly 6.0 (minVersion 3.0;maxVersion 6.*) and SeaMonkey 2 (maxVersion 2.*).
Copy and paste the full DATA code in the location bar and press the Enter key. Save as tabvisited-2.0-fx-sm.xpi (Apr 13 2011)

data:application/octet-stream;base64,
UEsDBBQAAAAIANmaPzwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAN6ymVLZspl
S1V4BADoA2QAlc0xCoAwDIXhuQUP4QWa3dvEGrSiDcRY9fYKSuvg4pjHxx/PUSmqUWxTWIJSZ0aU
xg/CM0FZ3bXW4G8Nla0sJ5IJD3PTBqAV3haSjJ7b7etUUClm93py0Y9wxBR6VC7pvPyOn1BLAwQU
AAAACAB2DY4+zkp8LcMBAADjAwAACwAcAGluc3RhbGwucmRmVVQJAAMvNaZNLzWmTXV4CwABBOkD
AAAEZAAAAI2TX2+bMBTF3yv1O7j0bZKBGI8EROimRX3aXpq17wYuiRUwyHZC0mnfffwxC0k7dW/4
3nOuz+9aRA/HskAHkIpXYmnNbNd6iG9vbm+ip9UjantCLa2t1nXoOE3T2I1nV3LjzIIgcFziEIJl
lmN1EpodsVD31uAJobywldUrLwrWe4nrUgfKznhvtXdFK1Cp5LVuEyCWVHu9tPZShMYTcqE0Kwpc
MsFzULrzoAjKkGexZsmBK64h+2Lkr1xAd03kDAqjFayE+CdLXgZ13+1rpm82EBPb7Xvj2bSzc8TJ
FNRwvUXf1muEkQJAyX6D6GJOKOlnTE1mTiqB6UrGGU93h6JXjSWj2FYl1GwDz0/fY7PAXWJfwTnP
CmS4Og+ZuswgfaohHoL0n/2j3mGMHrmEvDoijP9KmdyA/lrXBU/ZGBdN36UvjEv/BenC9dx8jlPi
Mkx9muMgcQHPPOaxAIK5t6C/Jw8wOEsuXsxWPbPlSeksY8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AAIAHYNjj7OSnwtwwEA
AOMDAAALABgAAAAAAAEAAADtgaYAAABpbnN0YWxsLnJkZlVUBQADLzWmTXV4CwABBOkDAAAEZAAA
AFBLAQIXAwoAAAAAAM20djsAAAAAAAAAAAAAAAAHAA0AAAAAAAAAEADtQa4CAABjaHJvbWUvVVQF
AANRrwlLVXgAAFBLAQIeAxQAAAAIAFwEjj6vJQizFwUAAJwFAAAVABgAAAAAAAAAAACkgegCAABj
aHJvbWUvdGFidmlzaXRlZC5qYXJVVAUAAxAlpk11eAsAAQTpAwAABGQAAABQSwUGAAAAAAQABAA4
AQAATggAAAAA

TabVisited 2.6 with CSS code

This version also has CSS code embedded (chrome://tabvisited/content/tabvisited.css).
Works with Nightly 6.0 (minVersion: 3.*; maxVersion 6.*) and SeaMonkey 2 (maxVersion 2.*).

/* Change text color of not visited tabs  - RED */
 .tabbrowser-tab:not([visited]) .tab-text {color:#c00!important;font-style:italic!important}

/* Change text color of normal tabs  - BLACK */
.tabbrowser-tab[visited="true"] .tab-text {color:#000!important}

/* Change text color of active tab  - BLACK */
.tabbrowser-tab[selected="true"] .tab-text {color:#000!important;font-weight:bold}

/* Change text color of loading tab - BLUE */
.tabbrowser-tab[busy] .tab-text {color:#00c!important;font-weight:bold}

Copy and paste the full DATA code in the location bar and press the Enter key. Save as tabvisited-2.6-fx-sm.xpi (Apr 13 2011)

data:application/octet-stream;base64,
UEsDBBQAAAAIANmaPzwjY3igZAAAAPAAAAAPABUAY2hyb21lLm1hbmlmZXN0VVQJAAN6ymVLZspl
S1V4BADoA2QAlc0xCoAwDIXhuQUP4QWa3dvEGrSiDcRY9fYKSuvg4pjHxx/PUSmqUWxTWIJSZ0aU
xg/CM0FZ3bXW4G8Nla0sJ5IJD3PTBqAV3haSjJ7b7etUUClm93py0Y9wxBR6VC7pvPyOn1BLAwQU
AAAACAB4C44+P+inP8QBAADjAwAACwAcAGluc3RhbGwucmRmVVQJAAN0MaZNdDGmTXV4CwABBOkD
AAAEZAAAAI2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