I found this post I wrote a year ago that I never published. With the renaming of Personas, it seems more relevant than ever. It's time for Background Themes to get some love.
Personas Interactive (PI) from Brand Thunder integrates tightly with the Personas support in Firefox. Because the overhaul of the Add-ons Manager in Firefox 4 caused some major changes to the Personas code in Firefox (LightweightThemeManager.jsm), I had to revisit how PI integrates with Firefox. As I was working through those changes, I realized that many of the changes I'm making should not be a part of an add-on - they should be core functionality in Firefox 4. So what I'd like to do with this post is talk about three areas where Personas support in Firefox could be greatly improved. Those areas are Website Integration, Core Functionality and Extensibility.
The Personas support in Firefox 4 is designed to work with Mozilla properties like getpersonas.com and addons.mozilla.org. There are two things that can be done to fix this.
Give Personas their own permisson
The permission to install or preview a persona is the same as the permission to install an extension. If you go into your preferences, you'll see that getpersonas.com and addons.mozilla.org are allowed to install XPIs. In order for another site to install and preview personas, you have to manually add them to this list. There is no programmatic way for a site to request this permission. This means that no site will really every be able to provide a personas gallery like Mozilla does.
Updates to a persona are currently required to be https. While this makes sense for add-ons, for personas it doesn't. Personas are JSON files that contain no executable code. The worst that could happen with a man in the middle persona attack is to display an inappropriate image. By forcing persona updates to be https, you limit the websites that can create their own personas galleries.
Personas was designed for Firefox 3.5 and the core functionality hasn't changed since then. There are few things that can be done to bring the function up to modern browser.
Support multiple background images, as well as positioning, repeating and resizing images
Allow for customization or removal of text shadows
The Personas support in Firefox 4 forced a computed text shadow on every Persona. While this worked for some Personas, it made other Personas unusable. Persona authors should be able to choose to remove the text shadow if it makes their Persona look better.
footerURL makes no sense in Firefox 4. Firefox 4 has no status bar and the add-ons bar is not themed.
Remove the preview timer
This one is probably a little controversial, but here me out. Currently personas had a built in timer so that previews only stay up for 30 seconds. This is so a site can't leave a preview up. But since a site has an API to display a preview, if it wanted to preview for more than 30 seconds, it could simply call the preview API every few seconds. The preview function can be used for a lot more than just preview because it allows an add-on to display a persona without changing the users installed persona. There are many uses for this and it would be great if it were opened up for that.
In creating Personas Interactive, I learned a lot about what it takes to extend the personas functionality in Firefox 4. With just a couple changes, it would be much easier for add-ons to integrate with personas.
Currently when a lightweight theme is read into Firefox 4, all the data in the persona is "sanitized." That means that only known attributes are allowed in the JSON. This even affects Personas Plus which uses an additional attributes called
detailURL. The JSON should simply be left alone so that an add-on can put additional data into the JSON file.
For an add-on to do additional interesting things when personas are displayed and removed, it needs to be notified when the persona is changed in any way. There are currently notifications for everything except when a preview is removed. This makes it very difficulty to augment the existing personas functionality.
So what can you do if you want this functionality today? All of the functionality I've described above is available in Personas Interactive from Brand Thunder. You can create your own personas gallery on your website. You can create enhanced personas with multiple background images positioned and sized however you want.
You can have the future of
Personas Background Themes today.