Prism/Bundle: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==WebApp Bundle==
==WebApp Bundle==
In addition to passing simple command line parameters, WebRunner can use a zipped bundle package to install a webapp. The bundle can hold additional resources currently limited to:
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 INI settings
* Application icon
* Application icon
Line 6: Line 6:


==Installing a Bundle==
==Installing a Bundle==
When WebRunner opens a webapp bundle it will unpack it into the '''webapps/{webapp-id}''' folder in your WebRunner profile. The web application may save other data into this folder. WebRunner will not overwrite or delete any extra data added to the folder. In fact, WebRunner saves some extra data itself - a file that holds some persistent UI data called ''localstore.json''.
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''.


<div class="note">The webapp must have an ID in order to be installed.</div>
<div class="note">The webapp must have an ID in order to be installed.</div>


When WebRunner 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]" which looks for the previously installed (unpacked) web application in the WebRunner '''webapps/{webapp-id}''' folder. The web application is then launched without the unpacking overhead.
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:
<pre>
[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
</pre>
* Zip the file to [whatever].webapp
* Double-click the webapp bundle or use <code>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

Latest revision as of 16:19, 12 March 2011

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