92
4 Types of Add-Ons Themes

Firefox Add-Ons

Embed Size (px)

DESCRIPTION

These are the slides for my fine minute overview of Firefox add-ons.

Citation preview

Page 1: Firefox Add-Ons

4 Types of Add-Ons

Themes

StylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI ElementsNew or modified behaviors

Page 2: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheets

ImagesLocales

Translated stringsPlug-ins

Native codeExtensions

New or modified UI ElementsNew or modified behaviors

Page 3: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI ElementsNew or modified behaviors

Page 4: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

Locales

Translated stringsPlug-ins

Native codeExtensions

New or modified UI ElementsNew or modified behaviors

Page 5: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI ElementsNew or modified behaviors

Page 6: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-ins

Native codeExtensions

New or modified UI ElementsNew or modified behaviors

Page 7: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI ElementsNew or modified behaviors

Page 8: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

Extensions

New or modified UI ElementsNew or modified behaviors

Page 9: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI Elements

New or modified behaviors

Page 10: Firefox Add-Ons

4 Types of Add-Ons

ThemesStylesheetsImages

LocalesTranslated strings

Plug-insNative code

ExtensionsNew or modified UI ElementsNew or modified behaviors

Page 11: Firefox Add-Ons

Add-ons Consist Of...

ZIP file

with .xpi extension

Page 12: Firefox Add-Ons

Add-ons Consist Of...

ZIP filewith .xpi extension

Page 13: Firefox Add-Ons

install.rdf

Identifier

<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 14: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id>

<em:id>[email protected]</em:id>Products can be installed in

<em:targetApplication><Description><em:id>...Min and Max Versions

<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 15: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 16: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in

<em:targetApplication><Description><em:id>...Min and Max Versions

<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 17: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 18: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions

<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 19: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 20: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

Type

Other metadata

Page 21: Firefox Add-Ons

install.rdf

Identifier<em:id>e4a8a97b-f2ed-450b-b12d-ee082ba24781</em:id><em:id>[email protected]</em:id>

Products can be installed in<em:targetApplication><Description><em:id>...

Min and Max Versions<em:minVersion>2.0</em:minVersion><em:maxVersion>2.0.*</em:maxVersion>

TypeOther metadata

Page 22: Firefox Add-Ons

chrome.manifest

Paths

chrome/contentTo chrome URLs

chrome:///superduper/content

Page 23: Firefox Add-Ons

chrome.manifest

Pathschrome/content

To chrome URLschrome:///superduper/content

Page 24: Firefox Add-Ons

chrome.manifest

Pathschrome/content

To chrome URLs

chrome:///superduper/content

Page 25: Firefox Add-Ons

chrome.manifest

Pathschrome/content

To chrome URLschrome:///superduper/content

Page 26: Firefox Add-Ons

Three Types of Chrome

Content

.xul

.jsSkin

.css

.pngLocale

.properties

.dtd

Page 27: Firefox Add-Ons

Three Types of Chrome

Content.xul

.jsSkin

.css

.pngLocale

.properties

.dtd

Page 28: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css.png

Locale.properties.dtd

Page 29: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin

.css

.pngLocale

.properties

.dtd

Page 30: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css

.pngLocale

.properties

.dtd

Page 31: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css.png

Locale.properties.dtd

Page 32: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css.png

Locale

.properties

.dtd

Page 33: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css.png

Locale.properties

.dtd

Page 34: Firefox Add-Ons

Three Types of Chrome

Content.xul.js

Skin.css.png

Locale.properties.dtd

Page 35: Firefox Add-Ons

For Skin...

chrome.manifest can have multiple entries

skin superduper default chrome/skin/default/skin superduper somepretty chrome/skin/somepretty/

maps one to...chrome://superduper/theme

Page 36: Firefox Add-Ons

For Skin...

chrome.manifest can have multiple entriesskin superduper default chrome/skin/default/

skin superduper somepretty chrome/skin/somepretty/maps one to...

chrome://superduper/theme

Page 37: Firefox Add-Ons

For Skin...

chrome.manifest can have multiple entriesskin superduper default chrome/skin/default/skin superduper somepretty chrome/skin/somepretty/

maps one to...chrome://superduper/theme

Page 38: Firefox Add-Ons

For Skin...

chrome.manifest can have multiple entriesskin superduper default chrome/skin/default/skin superduper somepretty chrome/skin/somepretty/

maps one to...

chrome://superduper/theme

Page 39: Firefox Add-Ons

For Skin...

chrome.manifest can have multiple entriesskin superduper default chrome/skin/default/skin superduper somepretty chrome/skin/somepretty/

maps one to...chrome://superduper/theme

Page 40: Firefox Add-Ons

For Locale...

chrome.manifest can have multiple entries

locale superduper en-US chrome/locale/en-US/locale superduper en-UK chrome/locale/en-UK/

maps one to...chrome://superduper/locale

Page 41: Firefox Add-Ons

For Locale...

chrome.manifest can have multiple entrieslocale superduper en-US chrome/locale/en-US/

locale superduper en-UK chrome/locale/en-UK/maps one to...

chrome://superduper/locale

Page 42: Firefox Add-Ons

For Locale...

chrome.manifest can have multiple entrieslocale superduper en-US chrome/locale/en-US/locale superduper en-UK chrome/locale/en-UK/

maps one to...chrome://superduper/locale

Page 43: Firefox Add-Ons

For Locale...

chrome.manifest can have multiple entrieslocale superduper en-US chrome/locale/en-US/locale superduper en-UK chrome/locale/en-UK/

maps one to...

chrome://superduper/locale

Page 44: Firefox Add-Ons

For Locale...

chrome.manifest can have multiple entrieslocale superduper en-US chrome/locale/en-US/locale superduper en-UK chrome/locale/en-UK/

maps one to...chrome://superduper/locale

Page 45: Firefox Add-Ons

.properties and .dtd

Both are key-value

.propertiesgreetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 46: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 47: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!

used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 48: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JS

bundle.getString("greetz").dtd

<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 49: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 50: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd

<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 51: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">

used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 52: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)

&manage.label.grpIncluded;

Page 53: Firefox Add-Ons

.properties and .dtd

Both are key-value.properties

greetz.0=Huzzah!used by JSbundle.getString("greetz")

.dtd<!ENTITY manage.label.grpIncluded "Included Pages">used by XML-things (HTML, XUL, etc.)&manage.label.grpIncluded;

Page 54: Firefox Add-Ons

XUL

XML for UIs

<hbox><button label="push me" /></hbox>

Page 55: Firefox Add-Ons

XUL

XML for UIs<hbox><button label="push me" /></hbox>

Page 56: Firefox Add-Ons

3 Types of XUL Documents

Window

DialogOverlay

Page 57: Firefox Add-Ons

3 Types of XUL Documents

WindowDialog

Overlay

Page 58: Firefox Add-Ons

3 Types of XUL Documents

WindowDialogOverlay

Page 59: Firefox Add-Ons

Overlays

Use id Attribute

<window>...<menu id="foo"><menuitem label="Hey" /><overlay>...<menu id="foo"><menuitem label="whoa" /><window>...<menu id="foo"><menuitem label="Hey"/><menuitem label="whoa" />

Page 60: Firefox Add-Ons

Overlays

Use id Attribute<window>...<menu id="foo"><menuitem label="Hey" />

<overlay>...<menu id="foo"><menuitem label="whoa" /><window>...<menu id="foo"><menuitem label="Hey"/><menuitem label="whoa" />

Page 61: Firefox Add-Ons

Overlays

Use id Attribute<window>...<menu id="foo"><menuitem label="Hey" /><overlay>...<menu id="foo"><menuitem label="whoa" />

<window>...<menu id="foo"><menuitem label="Hey"/><menuitem label="whoa" />

Page 62: Firefox Add-Ons

Overlays

Use id Attribute<window>...<menu id="foo"><menuitem label="Hey" /><overlay>...<menu id="foo"><menuitem label="whoa" /><window>...<menu id="foo"><menuitem label="Hey"/><menuitem label="whoa" />

Page 63: Firefox Add-Ons

What to Overlay?

chrome.manifest maps

overlay chrome://browser/content/browser.xulchrome://superduper/content/browser.xul

Page 64: Firefox Add-Ons

What to Overlay?

chrome.manifest mapsoverlay chrome://browser/content/browser.xulchrome://superduper/content/browser.xul

Page 65: Firefox Add-Ons

XPCOM

Inter-language

C++JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 66: Firefox Add-Ons

XPCOM

Inter-languageC++

JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 67: Firefox Add-Ons

XPCOM

Inter-languageC++JS

PythonCross-Platform

Windows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 68: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 69: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-Platform

Windows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 70: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-PlatformWindows 9x to 7

OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 71: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6

Linux, etc.

Object and Exception System

Page 72: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 73: Firefox Add-Ons

XPCOM

Inter-languageC++JSPython

Cross-PlatformWindows 9x to 7OS 10.0 to 10.6Linux, etc.

Object and Exception System

Page 74: Firefox Add-Ons

Components.classes

Classes

@mozilla.org/process/util;1.createInstance(interf)

[email protected]/network/io-service;1.getService()

Page 75: Firefox Add-Ons

Components.classes

[email protected]/process/util;1

.createInstance(interf)Services

@mozilla.org/network/io-service;1.getService()

Page 76: Firefox Add-Ons

Components.classes

[email protected]/process/util;1.createInstance(interf)

[email protected]/network/io-service;1.getService()

Page 77: Firefox Add-Ons

Components.classes

[email protected]/process/util;1.createInstance(interf)

Services

@mozilla.org/network/io-service;1.getService()

Page 78: Firefox Add-Ons

Components.classes

[email protected]/process/util;1.createInstance(interf)

[email protected]/network/io-service;1

.getService()

Page 79: Firefox Add-Ons

Components.classes

[email protected]/process/util;1.createInstance(interf)

[email protected]/network/io-service;1.getService()

Page 80: Firefox Add-Ons

Components.interfaces

Interface definitions

attributesmethods

nsIFileleafNameisDirectory()

Page 81: Firefox Add-Ons

Components.interfaces

Interface definitionsattributes

methodsnsIFile

leafNameisDirectory()

Page 82: Firefox Add-Ons

Components.interfaces

Interface definitionsattributesmethods

nsIFileleafNameisDirectory()

Page 83: Firefox Add-Ons

Components.interfaces

Interface definitionsattributesmethods

nsIFile

leafNameisDirectory()

Page 84: Firefox Add-Ons

Components.interfaces

Interface definitionsattributesmethods

nsIFileleafName

isDirectory()

Page 85: Firefox Add-Ons

Components.interfaces

Interface definitionsattributesmethods

nsIFileleafNameisDirectory()

Page 86: Firefox Add-Ons

Where to Start?

Inspect

DOM InspectorChromebugChrome ListXPCOM Viewer

Read CodeMXR

Page 87: Firefox Add-Ons

Where to Start?

InspectDOM Inspector

ChromebugChrome ListXPCOM Viewer

Read CodeMXR

Page 88: Firefox Add-Ons

Where to Start?

InspectDOM InspectorChromebug

Chrome ListXPCOM Viewer

Read CodeMXR

Page 89: Firefox Add-Ons

Where to Start?

InspectDOM InspectorChromebugChrome List

XPCOM ViewerRead Code

MXR

Page 90: Firefox Add-Ons

Where to Start?

InspectDOM InspectorChromebugChrome ListXPCOM Viewer

Read CodeMXR

Page 91: Firefox Add-Ons

Where to Start?

InspectDOM InspectorChromebugChrome ListXPCOM Viewer

Read Code

MXR

Page 92: Firefox Add-Ons

Where to Start?

InspectDOM InspectorChromebugChrome ListXPCOM Viewer

Read CodeMXR