Firefox Features
From Mugshot Developer Wiki
This page lists some of the integration points we have between Internet Explorer and the Mugshot client on windows, and discusses how similar functionality might be achieved with Firefox, both on Windows and Linux
Contents |
Link Swarm Toolbar button
Feature: A button is shown on the toolbar that shares the current web page
This should be extremely easy to implement with only XUL and Javascript, since all the button needs to do is to open a new browser window with an URL derived from the URL of the currently active tab.
Mugshot Bar
Feature: When the user visits a link shared through Mugshot, an extra pane is showed with a chat preview, a link to join the chat, and other context.
Internet Explorer has standard support for both sidebars and bars at the bottom of the window. We use a bar at the bottom of the window for the Mugshot bar, however the simplest thing to do for Firefox might be to try and create an alternate layout of the Mugshot bar that can be shown in the standard Firefox sidebar. Using the standard Firefox sidebar has clear advantages for simplicity.
One disadvantage of the sidebar is that it is tied to the browser rather than to an individual tab, so it doesn't represent presence at a web page very well. The alternate would be to try and figure out how to insert a pane at the bottom of the relevant tab. I don't know of any existing Firefox extensions that do something similar to this.
Adding the Mugshot Bar when sharing a page
Feature: When the user shares a page, the Mugshot bar is instantly activated for that page, so they can see other people viewing their share and can easily join the chat.
On Windows, the framing of the shared web page is driven from the share link window: on success, it calls a window.external method that hunts for an existing window on the shared URL and points it to the new share. But as long as the share link window is a normal browser window for Firefox, this is going to be hard.
Probably the easiest way to do this is to change things so that when the client receives a a new share shared by the current user, we look around for a browser window open on that page, and frame it.
How do we do this? We need some way of communicating from the client to open Firefox windows. On Linux, probably the easy thing to do is to make our Firefox extension listen for a D-BUS signal. We could do something similar on Windows by using a globally broadcast message and a hidden window, or we could copy what we do for IE and register ourselves with the HippoUI object via COM. (For IE, we register each browser window separately, but we might just want to register the Firefox app once.)
Live updates to the Mugshot Bar
Feature: The chat preview in the Mugshot Bar updates instantly. We also provide a list of people currently at the page
On Windows, the standard chat window is actually an Internet Explorer window showing a web page served from our web server. This page connects to events on an embedded Active X control to show the current chat activity. The Mugshot bar chat preview uses the same chat control with different formatting and a restricted number of messages.
This setup could be replicated pretty much literally by using a scriptable plugin. "Events" would be done by passing a Javascript callback object to the scripting interface of the plugin. One major disadvantage is that the plugin would be activatable from any web page, and not just the Mugshot site. So, someone could create a web page that made you spam a Mugshot chatroom without your knowledge. Unless there is a way for a Firefox plugin to reliably find the URL of the embedding web page, this approach is thus unworkable.
If the Mugshot bar was done as chrome rather than a web page served from our server, then there is no need for a plugin. The Javascript code for the Mugshot bar can simply create a XPCOM object directly. The main disadvantage here is that we can no longer use the JSP infrastructure to create the contents of the Mugshot bar, but have to provide all information to the client via XMPP and/or AJAX methods, and then build the bar from Javascript. Updates to the bar would also require a new version of the client.
It might be possible to use a remote XUL URL served from our server running with chrome privileges for the Mugshot bar content, but that seems somewhat dangerous.
Or we could try to do a live updating chat window in a web only fashion, by polling frequently or by using a blocking GET hack.
Browser window reuse
Feature: If there is an existing window on on mugshot.org when the user does something in the client to open another page on mugshot.org, reuse it.
Priority: Low
For IE this was pretty easy to do since we track all open browser windows from the client anyways. We might be able to use the same techniques discussed above in "Adding the Mugshot Bar when sharing a page" to achieve this for Firefox.

