Prism/Bundle

From MozillaWiki
< Prism(Redirected from WebRunner:Bundle)
Jump to: navigation, search

WebApp Bundle

In addition to passing simple command line parameters, Prism can use a zipped bundle package to install a webapp. The bundle can hold additional resources currently limited to:

  • Application INI settings
  • Application icon
  • Script for the application chrome, not the web content

Installing a Bundle

When Prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder in your Prism profile. The web application may save other data into this folder. Prism will not overwrite or delete any extra data added to the folder. In fact, Prism saves some extra data itself - a file that holds some persistent UI data called localstore.json.

The webapp must have an ID in order to be installed.

When Prism is launched with a "-webapp [bundle]" command line, the bundle must first be unpacked before the web application is launched. This can slow the overall launch time and the unpacking is redundant if the bundle has been launched previously. This is why the preferred method of launching is to use the "-webapp [webapp-id]" command line, which looks for the previously installed (unpacked) web application in the Prism webapps/{webapp-id} folder. The web application is then launched without the unpacking overhead.

HowTo

Here is a simple way to build a basic web application bundle:

  • Create file called webapp.ini that contains something like:
[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
  • Zip the file to [whatever].webapp
  • Double-click the webapp bundle or use prism -webapp [path-to-webapp]

Structure

A bundle can contain the following files. Any other files in the .webapp file will be ignored. After the .webapp file is executed the first time, these files will be unzipped and "cached" to a local directory structure.

/
webapp.ini
webapp.js
webapp.css
winnt
webapp.css
darwin
webapp.css
linux
webapp.css
[icon].ico
[icon].xpm
[icon].icns