Firefox Extension Development: Bundle

16
Bundle 1 of 16 02/05/08 00:50 Bundle [email protected]

description

by thinker http://heaven.branda.to/~thinker/GinGin_CGI.py Please attributing this work as \"(C) Thinker, this work is license under CC:BY 2.5 TW\"

Transcript of Firefox Extension Development: Bundle

Page 1: Firefox Extension Development: Bundle

Bundle

1 of 16 02/05/08 00:50

Bundle

[email protected]

Page 2: Firefox Extension Development: Bundle

Bundle

2 of 16 02/05/08 00:50

What

Are collections of files of

extensions or

applications of XULRunner.

Add-ons

Can be distributed

in ZIP files

with .xpi file extension.

Page 3: Firefox Extension Development: Bundle

Bundle

3 of 16 02/05/08 00:50

install.rdf

Install Manifest

A bundle at least contains

an install.rdf or

an install.js file.

Page 4: Firefox Extension Development: Bundle

Bundle

4 of 16 02/05/08 00:50

Required

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:em="http://www.mozilla.org/2004/em-rdf#">

<Description about="urn:mozilla:install-manifest">

<!-- required properties -->

<em:id>[email protected]</em:id>

<em:version>1.0.0</em:version>

<em:type>2</em:type>

<em:targetApplication>

<Description>

<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

<em:minVersion>1.5</em:minVersion>

<em:maxVersion>2.0.0.*</em:maxVersion>

</Description>

</em:targetApplication>

<em:name>Test Program</em:name>

</Description>

</RDF>

Page 5: Firefox Extension Development: Bundle

Bundle

5 of 16 02/05/08 00:50

Types

2

Extensions

4

Themes

8

Locale

32

Multiple Item Package

Page 6: Firefox Extension Development: Bundle

Bundle

6 of 16 02/05/08 00:50

Install

~/.mozilla/firefox/<profile>/extensions contains

Text file with ID as name ([email protected]) contains

/path/to/your/bundle/

XPI

cd /path/to/your/bundle/

zip ../test.xpi *

open XPI with Firefox

Page 7: Firefox Extension Development: Bundle

Bundle

7 of 16 02/05/08 00:50

Install Result

An empty add-on

Page 8: Firefox Extension Development: Bundle

Bundle

8 of 16 02/05/08 00:50

Optional

Optional properties

description

creator

developer

......

see http://0rz.tw/b13CS

Page 9: Firefox Extension Development: Bundle

Bundle

9 of 16 02/05/08 00:50

chrome.manifest

Map chrome URIs to bundle directories

content

locale

skin

Chrome

is a collection of UI elements of an applicaiton,

except content area.

Page 10: Firefox Extension Development: Bundle

Bundle

10 of 16 02/05/08 00:50

Instructions

Frequently used

content packagename uri/to/files/ [flags]

locale packagename localename uri/to/files/ [flags]

skin packagename skinname uri/to/files/ [flags]

overlay chrome://URI-to-be-overlaid chrome://overlay-URI [flags]

Comment (# ......)

see http://0rz.tw/ef3F3

Page 11: Firefox Extension Development: Bundle

Bundle

11 of 16 02/05/08 00:50

ex2

Overlay a panel on status bar

ex2/

install.rdf

chrome.manifest

mychrome/

test.xul

see ex2/chrome.manifest

see ex2/mychrome/test.xul

Page 12: Firefox Extension Development: Bundle

Bundle

12 of 16 02/05/08 00:50

ex2 result

Page 13: Firefox Extension Development: Bundle

Bundle

13 of 16 02/05/08 00:50

Convention

chrome/

content/

locale/

skin/

Not forced

Page 14: Firefox Extension Development: Bundle

Bundle

14 of 16 02/05/08 00:50

Components

components/ in bundle directory

*.so or *.dll

*.xpt

Registered automatically

Page 15: Firefox Extension Development: Bundle

Bundle

15 of 16 02/05/08 00:50

ex3

in bundle

install.rdf

chrome.manifest

mychrome/

test.xul

components/

Makefile

hello.cpp

hello.idl

Page 16: Firefox Extension Development: Bundle

Bundle

16 of 16 02/05/08 00:50

ex3 result

chrome://test/content/test.xul