Here’s a nifty trick forwarded to me from Eric Jung of Foxyproxy fame. Like many of the Top 40 developers, he’s building in Songbird support into the same XPI that also supports Firefox, Flock, etc.
He wanted to not only bind chrome and styles to specific applications, but to also be able to support multiple versions of multiple applications. Specifically, due to the deprecation of mainScriptsOverlay.xul in favour of layoutWithBrowser.xul & layoutWithoutBrowser.xul in 0.5, he wanted to target the right overlay for the right version.
(Yes, we kept mainScriptsOverlay.xul backwards compatibility, but Eric is being a conscientious developer and removing obsolete/deprecated dependencies as soon as he finds out about them. Yay Eric!)
What he ended up doing was using the application and appVersion modifiers for chrome/skin/styles lines and doing something like:
overlay chrome://songbird/content/xul/mainScriptsOverlay.xul
chrome://foxyproxy/content/firefoxOverlay.xul application=songbird@songbirdnest.com
appversion=0.4
overlay chrome://songbird/content/xul/layoutBaseOverlay.xul
chrome://foxyproxy/content/firefoxOverlay.xul application=songbird@songbirdnest.com
appversion>=0.5pre
(those should all be on two separate “overlay” lines - but I let them wrap for the sake of readability)
Cool, no?











2 Comments
SubscribeI dont know that much about the whole coding mumbo jumbo, but what I found pretty cool, nifty and extremely helpful about this post is the fact, that the original maintainer of the Addon is building all this into one .xpi, so the user can always rely on that. Thats MORE then awesome in a user sense. You have multiple Programs, but many of those can handle one and the same extension. Thats just beautiful. So lets get the word out to extension developers all around the mozilla code. Open Source ftw!
Tyler out!
Cool! Thanks!