Here’s How To Make An Extension Compatible With Prism (Two-ish)

I know it’s been a while since I’ve posted. There’s been a lot going on - school, work, home, you get the point. Anyway, I’ve been trying to keep my last post on how to make extensions compatible with Prism up-to-date, but this is turning out to be a difficult task. So I’m just going to post new instructions as needed. Basically, everything remains the same but the version string changes. The DOM inspector is the key to figuring out the correct target to put into your extension’s install.rdf. Clear as mud yet? Well, let me lay out the steps for you again here.

Step 1
Navigate to the Prism installation directory, in Windows this is:
C:\Program Files\Prism\

Open up the extensions folder, then the DOM inspector extension folder:
C:\Program Files\Prism\extensions\inspector@mozilla.org

Now open the “install.rdf” file and find this section of code which can be used (usually) as-is in most extensions pasted in the right place (just use the extension’s preconfigured targets as your guide on where to place it):


<em:targetApplication>
<!– Prism –>
<Description>
<em:id>prism@developer.mozilla.org</em:id>
<em:minVersion>0.4</em:minVersion>
<em:maxVersion>1.0.0.*</em:maxVersion>
</Description>
</em:targetApplication>

Step 2
Open up your extension’s xpi file using 7zip or your favorite archiving tool and extract the install.rdf file.

Open that install.rdf file with a text editor (other than notepad which doesn’t understand the line breaks used by other editors) and find the area where it lists the installation targets and insert your copied text into that or modify one of the install targets with the appropriate information from the DOM inspector extension install.rdf file.

Step 3
Install the extension. This will get tricky due to the way Prism’s developers have modified the profiles and what not. Well, I say that, but it really only gets that tricky if you’re manually installing the extension. Prism developers have seen fit to include the Addons menu item from the Prism menu in the lower right of Prism’s window to help things go more smoothly.

One of the ways to use this new install feature for an extension is globally, which means all webapps will be able to use the extension. This is the least preferred manner due to the fact that you won’t want all extensions available for all webapps in most cases. An example would be having the Better Gmail extension available for Bloglines - don’t think that’s real necessary, do you? So plan accordingly.

Using the second, and more preferred method, you just open your webapp. Open your webapp’s Addons panel, then install by either dragging and dropping the extension onto it, or by clicking the “Install…” button and navigating to the extension and selecting it for installation.

Conclusion
That should be about it. My next Prism post will be about how to make one of two stand alone Firefox/Prism exention webapps - POW local server or Scribefire standalone webapp. Stay tuned, we get to play with chrome!!

Links:

Prism

Running Multiple Instances/Versions of Mozilla Firefox

I wanted to check out the latest nightly build of Mozilla’s Firefox browser (currently version 3 alpha), but I didn’t want to uninstall my current version or overwrite, or screw up my profile and all those extensions I have installed. So how do you run two builds of Firefox at once? Pretty easily actually (while the following instructions are for Windows, similar actions can be used with Linux or Mac)!

First create a new profile

This is actually really simple, you just need to do one of two things:

Select Case

Case 1

From a command prompt or Start menu > Run type:

“[path_to_firefox]\firefox.exe” -CreateProfile [profile_name]

For most of us running Windows this will look like:

“C:\Program Files\Mozilla Firefox\firefox.exe” -CreateProfile test

(”test” would be the profile name in this case)

Case 2properties_01

You can create a copy your Mozilla Firefox shortcut on your desktop, right click and select properties, then add the -CreateProfile [profile_name] in the “Target” field on the “Shortcut” tab of the properties dialog. Then click OK and double click the shortcut.

End Select

In either case, Firefox will create the new profile and not open any windows.

Now that you have a new profile you need to be able to open your new browser with the new profile (I’m assuming that you’ve downloaded a new browser and have extracted or installed it to your liking).

Create a new shortcut to you’re new browserproperties_02

You can either copy your shortcut (if you’ve installed it) or create a new shortcut to the new version of firefox.exe, then (just like in Case 2 above) right click on the shortcut and in the “Target” text box, add -P test (or whatever you’ve used as your new profile’s name) to the end of the quoted firefox.exe path. The click OK.

Now, if you simply double click this icon you’ll open a new instance of your new browser build and you can start to play.

Just in case you want to use both your old browser and your new browser side-by-side

properties_03So, you say you’re curious if that website looks the same in your old browser as it does in your new browser, and you need them both open to tell? Well that’s no problem either. Open up the shortcut properties to your new browser just like you did above and after the “-P test” add in “-no-remote”. Now you can open multiple profiles, which should allow you to open your old browser and new browser side-by-side.

Have fun!

Reference Links from mozillaZine knowledge base:
Profile Manager

Command line arguments

Two Unrelated Things I Can’t Seem To Remember

Ok, I’ll admit it. Alcoholic beverages have killed a fair number of my brain cells. As a result I’m continually forgetting things (that’s my story and I’m sticking to it!). Any way, here are two completely unrelated things I’ve forgotten and have had to look up today. So I don’t forget them again, and so you, dear reader, don’t have to go looking too far for them, I’m putting them here:

How To: Redirect Errors From Standard Out to Nowhere (*nux)

Here’s how to get rid of those annoying error messages you really don’t care about when running a script (everybody’s got their own excuse for not wanting to see this type of thing, even though it can be handy now and again):

user@computer:~$ [command] [options] 2&gt;&amp;1

Stick “2>&1” at the end of your command string, that about covers it!!

How To: Launch Firefox With a Specific Chrome Interface (Windows)

Ever install a nifty little Mozilla Firefox extension and want to run it as a standalone program? Here’s how:

C:\Program Files\Mozilla Firefox&gt;firefox.exe -chrome [chrome path]

Add the “-chrome” option to the firefox command, then add the chrome path after that. Here’s an example of how to launch the bookmarks manager as a standalone program:

C:\Program Files\Mozilla Firefox&gt;firefox.exe <strong>-chrome chrome://browser/content/bookmarks/bookmarksManager.xul</strong>

Enjoy!!