Archive for the 'XulApps' Category

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

I’ve Been HACKED! Well, LifeHacked Any Way…

Link to LifeHacker Post

LifeHacker’s linked to my post on how to install extensions in Prism/Webrunner. For anyone having trouble with some extensions, have a look at my comment dated today (080404), I’ve addressed Better GCal specifically, but this should also work for Better Gmail and a few others as well.

Prism/Webrunner extensions post

HowTo – Make Your Own WebApp

This is just a quick howto on making your own WebRunner/Prism webapp file. This is a very simple process and shouldn’t take more than a few minutes of your time. There are a couple of tools you need however, to get started.

  • a file archiver – my favorite is 7-zip, but you can just as easily use any archiving program that is compatible with zip files
  • a text plain text editor

For more advanced webapps, a more advanced context highlighting text editor can be helpful for coding custom style sheets or adding javascript customizations. And don’t forget icons! I use a combination of Paint.Net and @icon sushi (which covers everything but MacOS, which is because I can’t seem to find software for Linux or Windows to accommodate icons for it – recommendations anyone?).

The No “.webapp” WebApp

There are several ways to open webpages with Prism or WebRunner. The first and easiest is to install Prism, then create a link to it on your desktop. Then change that link adding the option “-uri” and the url of the page you want to open. Here are two examples:

Windows:
c:\your\path\to_prism\prism.exe -uri http://web_url_of_site c:\your\path\to_prism\prism.exe -uri c:\location\of\local_file

GNU/Linux:
/your/path/to_prism/prism -uri http://web_url_of_site /your/path/to_prism/prism -uri /location/of/local_file

This method does not require a webapp file, it just launches the website or file you specify. This means, no icons are required, but you also don’t get to add any custom themes or js files. This would be a really good method to use with applications like Wiki on a Stick (woas).

WebApp Bundles

The second method is also pretty straight forward (until you make it complex by adding more functionality). For the most basic webApp bundle you only need to create one file; the webapp.ini. Here’s the content from the example webapp.ini on the Prism wiki:

[Parameters] id=unique-app-id@unique-author-id.whatever uri=http://[the-url-what-you-want-to-connect-to]/ status=yes location=no sidebar=no navigation=no

The “id” parameter is required to be unique. I’ve been using my website’s url (as most others have done as well) preceded by the name of the site, but any unique identifier will work. The “uri” parameter is required and will accept both url of the target website as well as local file paths. Everything after that appears to be optional and the values show are the defaults. These remaining parameters are options to tell Prism whether or not to show certain GUI elements (“status” = status bar;”location” = address bar;”sidebar” = sidebar;”navigation” = well, quite frankly, I have no idea – maybe navigation buttons that haven’t been implemented yet?).

The next step after saving your changes to this document, is to use your archiving program to zip up this file creating, as an example, “your_webapp.zip”. Replace the “zip” extension with “webapp” and you’re ready to roll! Now either double click the webapp file or you can launch the webapp from the command line thusly:

Windows:
c:\your\path\to_prism\prism.exe -webapp your_webapp_bundle

GNU/Linux:
/your/path/to_prism/prism -webapp your_webapp_bundle

For more advanced webapps you can add icons, scripting and style sheet support (see the Prism page for more details).

Happy coding!

Prism
Prism/WebApp Bundle
Prism/Scripting
Prism/Styling
7-Zip
Paint.Net
@icon sushi
Wiki on a Stick