Mozilla, money, microformats and more

Post navigation

Reimagining Personas (Background Themes)

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.

Website Integration

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.

Core functionality

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

With Firefox 3.6, some great new CSS features were introduced like multiple background images and resizing of images. Personas is still implemented as one giant image pinned to the upper right of the browser. This causes significant performance issues. If Personas could be multiple images, they could do a lot more interesting things with a lot less. Personas should be updated to support all of the various background CSS attributes. They should be defined the same as their JavaScript CSS counterpart: backgroundImage, backgroundSize, backgroundRepeat.

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.

Remove footerURL

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.

Extensibility

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.

6 thoughts on “Reimagining Personas (Background Themes)”

> Firefox may not have the status bar any more, but other applications support Personas too, you know!

True, but I would still argue that the footerURL is the wrong way to solve this. A nice complementary color would be the way to go, with a way to specify the text color of the footer separate from the color of the overall image.

The footer image is 3000 pixels wide by 100 pixels high. That’s an awful lot of work to put into an image that is in practice about 20 pixels high. (Yes, I know you can see more if you put up the find bar at the bottom.)

How about enabling Full Themes together with Background Themes?
This used to be possible (and still is with some workaround and 3 restarts), but has been blocked out a long time ago, with a promise to enable it back again.

I’m not sure I’m comfortable with letting any website set the background theme. It could be very disconcerting to have the theme change when the user has done nothing to change it, especially if someone gets the idea of using my browser’s background as advertising space. It could also be used maliciously (especially without enforced contrast) to make the browser look ‘broken’ when it’s not — I expect that would make social engineering attacks much easier.

This is not to say that XPInstall privileges should be required to change the background theme. I just want to have to explicitly allow a web site to do it.