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


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

  • 1
    Lucky Disasters » WebRunner now Prism, Whatever - Here’s How To Make An Extension Compatible With At Least One…
    June 11th, 2008 22:46

    [...] UPDATE AGAIN! 080611 I’ve made a new post on this subject cause it’s easier to update by adding new posts ins… [...]

  • 2
    Sid
    June 28th, 2008 21:19

    Hi,

    I am glad i found your blog, as I’m trying to install the Meebo extension in prism and so far have been unable to. In the comments about that firefox add on (Meebo) on mozilla.org someone mentions it works fine with prism, so I’m hoping I can get it to work.

    Unfortunately, when i go to C:\Program Files\Prism\extensions there is nothing in that directory. Any chance you could tell me how to get the DOM Inspector install? I attempted to install the actual DOM Inspector Add-on from (https://addons.mozilla.org/en-US/firefox/downloads/file/14870/dom_inspector-1.8.1.2-tb.xpi) but had no luck installing it in prism (says it is incompatible). I’ve tried googling for “Prism DOM Inspector” with similiarly no luck. Any guidance?

    This is Vista Home Basic, FF 3 Installed, Prism .9 Win32. I know you’re not tech support, but I thought I might ask =)

    Thanks,

    Sid

  • 3
    Kris
    June 29th, 2008 22:33

    Thanks for the comments Sid, as it turns out, I had the same problem when I started working with Prism on Vista Business. I’ve also done some new builds recently and after installation, the extensions weren’t there, so they may be hold outs from the older installs I have on my other system. Any-who, I’ve uploaded the install.rdf for the inspector extension on my system as well as another with a different implementation of the target browser.

    I’ve used these methods for creating several standalone webapps based on Firefox extensions (which I hope to have instructions for up soon).

  • 4
    Sid
    June 30th, 2008 04:12

    Thanks for the help Kris. So I was able to install the meebo plugin in Prism, but now nothing happens - I see it in my add ons list, but the add on itself appears to not do anything.

    Perhaps it is *really* not compatible with prism since it requires a sidebar, and perhaps prism doesn’t support that. Or maybe I just need to research this further. Either way, I am a step closer!

    Thanks for your help and replying. I’ll try out some more add ons later now that I was finally able to get one install to work!

    Sid

  • 5
    ian
    July 16th, 2008 14:24

    easygestures did not work for - i could get it to show up in the add ons by modifying install.rdf, but it would not copy the files, so I manually extracted and copied under extensions/ - still no luck though

    it would seem that Prism does not play nice with extensions, I will stick with plain ol FireFox->’new window’ for now…

  • 6
    Ryan
    August 1st, 2008 00:05

    I’ve been trying to get Better Gmail working through the Prism addon for Firefox 3 and am still unable to. In the Better Gmail addon, I changed and added the code so that it looks like:

    Did I at least get this part right? And do I need to edit the Prism addon before I install it in Firefox?

    Thanks for the help,
    Ryan

  • 7
    Ryan
    August 1st, 2008 00:08

    Sorry, I’ll try again:
    “… that it looks like:”

  • 8
    Kris
    August 4th, 2008 08:21

    Hey Ryan,
    Sorry WordPress doesn’t like HTML in comments, but I think from now on if you use:

    <pre lang="HTML">
    code
    < /pre>

    (without that space before the “/” in the closing pre)

    It should recognize it. Better Gmail did give me fits for a while as well, but I haven’t worked with the latest version. I’ll take a look and see what I can find, but if you’d like to email me the file, I’d be happy to look at what you’ve got as a starting point as well…

  • 9
    Manolo
    August 16th, 2008 14:58

    ok i add the extensions remember the milk for gmail and i see it on the addons page, but nothing happend, also i edit the js file of the extensions and put alert(”hello”); but the alert never comes up.

    After the extensions is installed where Prism put the files?

    i look into (my pc is spanish):

    C:\Documents and Settings\Administrator\Configuración local\Datos de programa\Prism\

    and:

    c:\program files\Prism\components

    and dont see any files of the XPI

  • 10
    Manolo
    August 17th, 2008 00:30

    Well, after a LOT of testing i finally get the RTM extension to work in Prism, but unfortunally there was a couple of “hard things” i must to do before have success. Is possible that must of this things must to be done in order to get other extensions to work. Im interested in this, so if someone need help can write me a mail.

    i dont remember all but:

    1) after you do the steps on this post the extension is loaded aparently ok but nothing happens, thats cause in the chrome.manifest the XUL file is loading like:

    overlay chrome://browser/content/browser.xul chrome://rtmgmail/content/script-compiler-overlay.xul

    But browser.xul dont exists in Prism!! thats the default browser schema for firefox!.

    so i must change to:

    overlay chrome://webrunner/content/webrunner.xul chrome://rtmgmail/content/script-compiler-overlay.xul

    webrunner.xul is the schema for prism.

    2) this:

    var appcontent=window.document.getElementById(”appcontent”);

    dont works in Prism, appcontent is a element where the tabbed browser is (The JS on the extensions runs from the chrome perspective, not from the document), but only exist on firefox, not in prism so i must change it to:

    var appcontent=window.document.getElementById(”browser_content”); //browser content is the document container for Prism

    3)

    The RTM extension load a couple of JS from they server, but i need to download that JS and put inside the extension for a lot of reasons, for example, when you are not logged in there is a messege with a link “login to view your task”. if you click on “login” your default browser is launched…

    I need to modified the extension to look like:

    http://www.evernote.com/shard/s1/res/504b185c-4a3e-4cec-a71c-4cac6083f8b8

    and make the login proceduro on gmail.

    Well, after that the extension is working like a charm… i will package it and upload to my server… if anyone is interested…

Leave a Reply