plugin for firefox cs297 – vijay rao. plugin for firefox firefox has a very stable framework to...

Post on 21-Dec-2015

225 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Plugin for Firefox

CS297 – Vijay Rao

Plugin for Firefox

Firefox has a very stable framework to create browser extensions.

It uses XUL to specify overlays which then render the UI

A combination of XUL and javascript allows the user to extend the browser

Steps to create a FF plugin Creating the right directory structure To create a plugin the following is the directory

structure that should be present Say the plugin is called Foo then following is

the dir structure Foo

-chrome-content

- foo.xul- foo.js

-chrome.manifest-install.rdf

Install.rdf The install.rdf provides details of unique id of the

application the application version etc. By also specifying the GUID of firefox we are telling it that this is an extension to Firefox.

<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> The first section describes the current plugin <em:id>tuttoolbar@borngeek</em:id> <em:name>Tutorial Toolbar</em:name> <em:version>1.0</em:version>

chrome.manifest

The chrome.manifest gives the location of the content including the location of the xul files.

content tuttoolbar chrome/content/

overlay chrome://browser/content/browser.xul chrome://tuttoolbar/content/tuttoolbar.xul

XUL and Javascript files

The XUL files are encompassed in the following root tag<overlay id="TutTB-Overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

Firefox Profiles

It is best to create a separate profile to prevent the plugin from disrupting the bookmarks etc

I created a test profile called dev

Integrating the plugin Integrating the plugin involves a simple

step Drop a file with the same name as the

application id in our case Foo in the extensions directory of the profile folder

The file just has the path to the root folder of the plugin.

On browser restart the plugin is picked up by FF and displayed.

SWEET!!!

References

http://www.borngeek.com/firefox/toolbar-tutorial/

top related