开发者

Managing theme from firefox extension

Is there a way to change themes dynamically from an add-on based on some criteria? Or at least cha开发者_如何学运维nge the header picture.

Thanks in advance,


For Firefox before version 4:

If the extensions.dss.enabled preference is set, set the general.skins.selectedSkin preference to the theme's internal name. Otherwise set the extensions.lastSelectedSkin preference to the theme's internal name and restart Firefox. Note: This is for standard themes, I don't know whether this applies to Personas.

For Firefox 4 and later:

Obtain a reference to the theme object from the Add-on Manager and set its userDisabled property to false. If it is a Persona, then it will apply instantly, and its isActive property will become true. Otherwise you will need to restart Firefox.


I know preferences. Anyway I managed to solve the issue using:

$toolbar=document.getElementById('navigator-toolbox'); $statusbar=document.getElementById('status-bar');     
$toolbar.style.setProperty('background-image',%img%, 'important'); $statusbar.style.setProperty('background-image', %img%, 'important');

THANKS

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜