Archive for the 'Prism' Category

HowTo: Change Locations in Prism

You may or may not know this, but you can use the Error Console in Prism to open new windows to any site you want. Just use the following javascript in the Code Evaluation box:

window.open('http://website.url','','');

This will open a new window to the address “http://website.url”, pretty basic stuff. Now, what happens if you want to change the location of the Prism window from your default webapp’s location. Well, you can still use the Error Console, but there’s a couple of layers of javascript reference you need to go through. If you try using this:

parent.location='http://website.url'

You redirect the Error Console to “http://website.url”, interesting (very, actually :), but not what we’re after. If you haven’t already done so, open the error console:
menu

Next, in the Code Evaluation text box, type the following:

parent.opener.content.location='about:config'

shot1shot2shot3

That’s about it, hit return or press “Evaluate” and you’re done. By using parent.opener.content.whatever you should be able to access all of Prism’s components. What? You don’t know what the other compents are?? Well, check out the webrunner.xul located in Prism’s install directory, in the chrome directory inside the webrunner.jar (copy, rename to .zip from .jar and extract).

Another thing you’ll learn from this file is a complete list of the navigation keys (look for the keyset directives) currently used by Prism:

Back=Alt+Left Arrow
Forward=Alt+Right Arrow
Home=Alt+Home (that’s the Home Key on your keyboard’s number pad BTW)
Reload Page=F5
Close=Accelerator Key (Ctrl Key)+w
Quit=Accelerator Key (Ctrl Key)+q
Print=Accelerator Key (Ctrl Key)+p

Prism as a TV

capture_02252009_194641I know I said that the next Prism related post I would be doing was one on manually installing an addon, but it’s taking me more time to get to than I had hoped. However, I do have another use for Prism that I’d like to share right now. I’ve been using Prism as a tool for creating TV show specific browsers for video sites. Veoh specifically, but I’m pretty sure you can do this for other video sharing sites as well.

Basically what I’ve done is used Prism to create a new webapp that points to the search URL of Veoh with a single program as the search term. For instance, right now I’m following the anime Toradora.

capture_02252009_194818To create the webapp, I’ve chosen to place a link on my desktop, used the search link above, and enabled the navigation keys for Prism:

Alt+Back Arrow = Back in History
Alt+Forward Arrow = Forward in History
Alt+Home = Home Page for webappX
etc.

Veoh Search Link:

http://www.veoh.com/search/videos/q/your+search+here

Prism automatically pulls the site’s favicon as the desktop icon (has anyone else experienced problems with Prism not correctly installing the icon from pre-bundled webapps?).

Other places where this could be useful (other than setting up your own custom television station on your desktop with play-on-demand access)? The instructors for the courses I’m taking right now at ECU via the web often put class lectures on both YouTube and ECU’s own servers (depending on the class and the web-savvy-ness of the instructor). This would be a perfect way to distribute these movies to students, simply by placing the right URL into Prism and bundling the webapp, you can create a feed specific video channel for student consumption.

Other thoughts on this process:

  • The ability to uninstall webapps would be useful. Manual uninstalls, while not difficult, are a pain.
  • An addon or webapp script for Prism to load into the sidebar with links or buttons corresponding to pre-configured feeds/pages to change the currently viewed page so that you can “change channels.”
  • Along those same lines, an addon with FF3’s built-in feed reader which would load into the sidebar would be a nifty means of navigating a number of pre-configured links… yes that would be nifty indeed…

Prism Information – In Depth

[[UPDATED - 08/11/22 to include Linux paths]]
A lot of people have been having problems getting extensions to work with Prism. This is kind of an expected situation considering that the extensions that are being targeted are designed for use under Firefox, which has a different UI than Prism. This can cause a lot of headaches trying to figure out what’s wrong. There are ways around some of these problems, especially if the extension includes a xul overlay that is compatible with the browser xul for Prism. Or if you can load the chrome url to the main xul overlay in Prism’s input url (which of course requires that you already have the extension installed). Other extensions however, have no hope of working with Prism unless changes are made to the overlays.

I’ve also been running into a problem described by commenter Marcel, here. I’ve been getting a similar error under Windows for different extensions when I try to install them. Don’t know why, and what makes it worse is that these errors crop up in extensions that I’ve had no problems installing before on other computers (maybe I need to have Webrunner installed along side Prism?). I’ve also had problems with version 0.9 not installing and using the included icons for webapp files. I’m going to have to look into that one a bit further before I can comment more on it though.

At any rate, I’m going to list as much information in this post as I can find on Prism to refer back to, then I’m going to create a new post on how to install an extension for Prism manually. I’d also like to post a how-to on getting POW to work under Prism as well, but I don’t know whether or not I’ll get to that (maybe over Thanksgiving break). So, first some links.

LINKS:
Mozilla Labs’ Prism Page – A broad overview of the goals of the Mozilla Prism Project
Mozilla Developer Center’s Prism Page
MDC’s Prism Page on Extensions
Mozilla Labs’ Prism Forum
Mozilla Wiki Prism Page – Along with the Dev Center’s page, a good source for documentation on  Prism
Mark Finkle’s Blog (one of Prism’s developers – BTW – THANK YOU MARK!!!)
SVN for Prism’s source code
List of Prism Contributors on ohloh.net
Douglas Meyer’s Blog post on getting Google Gears to work with Prism
Commenter Manlo’s blog post on getting RTM working with Prism (does not appear to be working)
Wikipedia Entry

Next, here’s a list of all the files that Prism makes use of in the user’s profile directory on Windows and Mac OS X – Linux to come (I don’t have access to my Linux box at the moment).

Default Prisim Folders in User’s Home directory (Windows as of Prism v0.9):

Under C:\Documents and Settings\{user name}\Application Data\

Prism\
Prism\profiles.ini
Prism\Profiles\
Prism\Profiles\{random string}.default\
Prism\Profiles\{random string}.default\cert8.db
Prism\Profiles\{random string}.default\compatibility.ini
Prism\Profiles\{random string}.default\compreg.dat
Prism\Profiles\{random string}.default\cookies.sqlite
Prism\Profiles\{random string}.default\extensions
Prism\Profiles\{random string}.default\extensions.cache
Prism\Profiles\{random string}.default\extensions.ini
Prism\Profiles\{random string}.default\key3.db
Prism\Profiles\{random string}.default\localstore.rdf
Prism\Profiles\{random string}.default\mimeTypes.rdf
Prism\Profiles\{random string}.default\permissions.sqlite
Prism\Profiles\{random string}.default\places.sqlite
Prism\Profiles\{random string}.default\prefs.js
Prism\Profiles\{random string}.default\secmod.db
Prism\Profiles\{random string}.default\xpti.dat
Prism\Profiles\{random string}.default\extensions\

Under C:\Documents and Settings\{user name}\Local Settings\Application Data\

Prism\Prism\
Prism\Prism\updates\
Prism\Prism\updates\0\

For Each WebApp Prism creates (Windows as of Prism v0.9):

Under C:\Documents and Settings\{user name}\Application Data\Prism\

{webapp name}\
{webapp name}\profiles.ini
{webapp name}\Profiles\
{webapp name}\Profiles\{random string}.default\
{webapp name}\Profiles\{random string}.default\cert8.db
{webapp name}\Profiles\{random string}.default\compatibility.ini
{webapp name}\Profiles\{random string}.default\compreg.dat
{webapp name}\Profiles\{random string}.default\cookies.sqlite
{webapp name}\Profiles\{random string}.default\extensions
{webapp name}\Profiles\{random string}.default\extensions.cache
{webapp name}\Profiles\{random string}.default\extensions.ini
{webapp name}\Profiles\{random string}.default\extensions.rdf
{webapp name}\Profiles\{random string}.default\key3.db
{webapp name}\Profiles\{random string}.default\localstore.rdf
{webapp name}\Profiles\{random string}.default\mimeTypes.rdf
{webapp name}\Profiles\{random string}.default\permissions.sqlite
{webapp name}\Profiles\{random string}.default\places.sqlite
{webapp name}\Profiles\{random string}.default\pluginreg.dat
{webapp name}\Profiles\{random string}.default\prefs.js
{webapp name}\Profiles\{random string}.default\secmod.db
{webapp name}\Profiles\{random string}.default\signons3.txt
{webapp name}\Profiles\{random string}.default\xpti.dat
{webapp name}\Profiles\{random string}.default\extensions\

Under C:\Documents and Settings\{user name}\Application Data\WebApps\

{webapp name}@{webappaddr}\
{webapp name}@{webappaddr}\localstore.json
{webapp name}@{webappaddr}\override.ini
{webapp name}@{webappaddr}\webapp.ini
{webapp name}@{webappaddr}\webapp.js
{webapp name}@{webappaddr}\icons\
{webapp name}@{webappaddr}\icons\default\
{webapp name}@{webappaddr}\icons\default\{icons included in webapp bundle}

Under C:\Documents and Settings\{user name}\Local Settings\Application Data\Prism\

{webapp name}\
{webapp name}\Prism\
{webapp name}\Prism\updates\
{webapp name}\Prism\updates\0\
{webapp name}\Profiles\
{webapp name}\Profiles\l05apnbh.default\
{webapp name}\Profiles\l05apnbh.default\XPC.mfl
{webapp name}\Profiles\l05apnbh.default\XUL.mfl
{webapp name}\Profiles\l05apnbh.default\Cache\
{webapp name}\Profiles\l05apnbh.default\Cache\_CACHE_001_
{webapp name}\Profiles\l05apnbh.default\Cache\_CACHE_002_
{webapp name}\Profiles\l05apnbh.default\Cache\_CACHE_003_
{webapp name}\Profiles\l05apnbh.default\Cache\_CACHE_MAP_
{webapp name}\Profiles\l05apnbh.default\Cache\{other cache files}

Default Prisim Folders in User’s Home directory (Mac OS X as of Prism v0.9):
Under /Users/{user name}/Library/Application Support/Prism/

Profiles/
Profiles/profiles.ini
Profiles/{random string}.default/
Profiles/{random string}.default/cert8.db
Profiles/{random string}.default/compatibility.ini
Profiles/{random string}.default/compreg.dat
Profiles/{random string}.default/cookies.sqlite
Profiles/{random string}.default/extensions.cache
Profiles/{random string}.default/extensions.ini
Profiles/{random string}.default/key3.db
Profiles/{random string}.default/localstore.rdf
Profiles/{random string}.default/mimeTypes.rdf
Profiles/{random string}.default/permissions.sqlite
Profiles/{random string}.default/places.sqlite
Profiles/{random string}.default/pluginreg.dat
Profiles/{random string}.default/prefs.js
Profiles/{random string}.default/secmod.db
Profiles/{random string}.default/xpti.dat
Profiles/{random string}.default/extensions/

For Each WebApp Prism creates (Mac OS X as of Prism v0.9):

Under /Users/{user name}/Library/Application Support/{webapp name}/

Profiles/
Profiles/profiles.ini
Profiles/{random string}.default/
Profiles/{random string}.default/cert8.db
Profiles/{random string}.default/compatibility.ini
Profiles/{random string}.default/compreg.dat
Profiles/{random string}.default/cookies.sqlite
Profiles/{random string}.default/extensions.cache
Profiles/{random string}.default/extensions.ini
Profiles/{random string}.default/key3.db
Profiles/{random string}.default/localstore.rdf
Profiles/{random string}.default/mimeTypes.rdf
Profiles/{random string}.default/permissions.sqlite
Profiles/{random string}.default/places.sqlite
Profiles/{random string}.default/pluginreg.dat
Profiles/{random string}.default/prefs.js
Profiles/{random string}.default/secmod.db
Profiles/{random string}.default/xpti.dat
Profiles/{random string}.default/extensions/

Under /Users/{user name}/Library/WebApps/{webapp name}@{webappaddr}/

{webapp name}@{webappaddr}/localstore.json
{webapp name}@{webappaddr}/override.ini
{webapp name}@{webappaddr}/webapp.ini
{webapp name}@{webappaddr}/webapp.js
{webapp name}@{webappaddr}/icons/
{webapp name}@{webappaddr}/icons/default/
{webapp name}@{webappaddr}/icons/default/{icons included in webapp bundle}

Default Prisim Folders in User’s Home directory (Linux as of Prism v0.9):

Under /home/{user name}/

.prism/prismdir.lin.txt
.prism/profiles.ini
.prism/{randomstring}.default/
.prism/{randomstring}.default/Cache/
.prism/{randomstring}.default/cert8.db
.prism/{randomstring}.default/compatibility.ini
.prism/{randomstring}.default/compreg.dat
.prism/{randomstring}.default/cookies.sqlite
.prism/{randomstring}.default/extensions/
.prism/{randomstring}.default/extensions.cache
.prism/{randomstring}.default/extensions.ini
.prism/{randomstring}.default/key3.db
.prism/{randomstring}.default/localstore.rdf
.prism/{randomstring}.default/mimeTypes.rdf
.prism/{randomstring}.default/.parentlock
.prism/{randomstring}.default/permissions.sqlite
.prism/{randomstring}.default/places.sqlite
.prism/{randomstring}.default/prefs.js
.prism/{randomstring}.default/secmod.db
.prism/{randomstring}.default/XPC.mfasl
.prism/{randomstring}.default/xpti.dat
.prism/{randomstring}.default/XUL.mfasl
.prism/{randomstring}.default/Cache/
.prism/{randomstring}.default/Cache/_CACHE_001_
.prism/{randomstring}.default/Cache/_CACHE_002_
.prism/{randomstring}.default/Cache/_CACHE_003_
.prism/{randomstring}.default/Cache/_CACHE_MAP_

For Each WebApp Prism creates (Linux as of Prism v0.9):

Under /home/{user name}/.prism/

{webapp name}/
{webapp name}/{randomstring}.default/
{webapp name}/{randomstring}.default/Cache/
{webapp name}/{randomstring}.default/Cache/_CACHE_001_
{webapp name}/{randomstring}.default/Cache/_CACHE_002_
{webapp name}/{randomstring}.default/Cache/_CACHE_003_
{webapp name}/{randomstring}.default/Cache/_CACHE_MAP_
{webapp name}/{randomstring}.default/cert8.db
{webapp name}/{randomstring}.default/compatibility.ini
{webapp name}/{randomstring}.default/compreg.dat
{webapp name}/{randomstring}.default/cookies.sqlite
{webapp name}/{randomstring}.default/extensions/
{webapp name}/{randomstring}.default/extensions.cache
{webapp name}/{randomstring}.default/extensions.ini
{webapp name}/{randomstring}.default/key3.db
{webapp name}/{randomstring}.default/localstore.rdf
{webapp name}/{randomstring}.default/mimeTypes.rdf
{webapp name}/{randomstring}.default/.parentlock
{webapp name}/{randomstring}.default/permissions.sqlite
{webapp name}/{randomstring}.default/places.sqlite
{webapp name}/{randomstring}.default/prefs.js
{webapp name}/{randomstring}.default/secmod.db
{webapp name}/{randomstring}.default/XPC.mfasl
{webapp name}/{randomstring}.default/xpti.dat
{webapp name}/{randomstring}.default/XUL.mfasl
{webapp name}/profiles.ini

From the above lists of file locations, it should be apparent (okay, if you really really look, hard) that there are two ways to go about installing an extension for Prism. The first is install that extension “globally”, which is to say that you install that extension for every webapp. For this method the extension gets installed into Prism’s extension directory. The second method is to install the extension “locally”, or on a per-webapp basis. In this case each extension is installed in the individual webapp’s extension directory.

The first method is more difficult because by default, installing an extension will be done when you have a webapp loaded, so it will install the extension into that webapp’s extension folder. In order to install a webapp globally, you’ll need to perform a manual installation or open a new webapp that loads the addon’s xul (chrome://global/content/config.xul). I should mention that this worked on Prism/Webrunner 0.8, but I have yet to test this on Prism 0.9, so this may no longer work.

So, why they heck would I list all the files and directories here? Well, I want a reference to point at when I start explaining which files to make changes to in order to install an extension manually.

Code Snippit for Prism Extensions’ install.rdf

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

Code Snippit for Prism Extensions’ extension.rdf (information is required from the **install.rdf**)

<RDF:Description
    RDF:about="urn:mozilla:item:{**extension id from install.rdf**}"
    NS1:installLocation="app-profile"
    NS1:version="**from install.rdf**"
    NS1:optionsURL="**from install.rdf**"
    NS1:iconURL="**from install.rdf**"
    NS1:name="**from install.rdf**"
    NS1:description="**from install.rdf**"
    NS1:creator="**from install.rdf**"
    NS1:homepageURL="http://**from install.rdf**"
    NS1:contributor="**from install.rdf**">

More to come…