开发者

how to change the colour of tab in fireofx using addon?

开发者 https://www.devze.com 2023-03-08 23:25 出处:网络
i\'m developing a firef开发者_如何学JAVAox addon. I\'d like to change the colour of the current tab through my addon. How to do it??You can place a .js file in your chrome/content folder and write a f

i'm developing a firef开发者_如何学JAVAox addon. I'd like to change the colour of the current tab through my addon. How to do it??


You can place a .js file in your chrome/content folder and write a function like this:

// take a color and color the tab with it
setColor:function(tab, tabColor)
    {

    tab.style.setProperty('background-image','-moz-linear-gradient(rgba(255,255,255,.7),rgba('+tabColor+',.5),rgb('+tabColor+')),-moz-linear-gradient(rgb('+tabColor+'),rgb('+ tabColor+'))','important');

    }


I don't know anything about firefox plugin development but the color of the current tab is found at the browser.css (chrome://browser/skin/browser.css). There you will find this class .tabbrowser-tab[selected="true"]:-moz-lwtheme Changing the color property will change the color of the current tab. Changing the color property for .tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]), .tabs-newtab-button:-moz-lwtheme-darktext will change the color for all other tabs.

Hope the above information to be helpful.

0

精彩评论

暂无评论...
验证码 换一张
取 消