diumenge, desembre 25, 2011

Tabbar under main content in Firefox 4+

Starting with Firefox 4 the trick to get the tabbar under the main content:

#content > tabbox { -moz-box-direction: reverse; }


ceased to work. The reason is a fundamental change in the XUL container
hierarchy that builds up the browser user interface. This is explained in
detail in this posting. Alternatively it can be directly observed by examining
chrome://browser/content/browser.xul with the
aid of the DOM Inspector extension.

In effect, prior to version 4 the tabbar and the content container were both
children nodes of a common parent. This allowed the use of an CSS directive
to change the order in which they were displayed.

In Firefox 4 and following versions this is no longer the case and CSS is no
thus sufficient to tweak the order in which both nodes are rendered. A
change of the DOM structure is needed, which can only be accomplished by
means of Javascript in chrome space. In other words, an extension is
necessary, a style alone won't do.

Luckily the guys of Tab Mix Plus already hit the problem and provided for a
solution. Being no fan of swiss-army-knife-style extensions like TMP I just
took advantage of open-sourceness and extracted the three or four lines that
do the magic and put them into a userchrome.js script. Note that I'm referring
to Satyr's version of UC, since Zeniko's original work seems to be no longer
maintained. The script can be found here .

0 comentaris: