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

9
Plugin for Firefox CS297 – Vijay Rao

Post on 21-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 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

Plugin for Firefox

CS297 – Vijay Rao

Page 2: 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

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

Page 3: 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

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

Page 4: 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

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>

Page 5: 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

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

Page 6: 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

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">

Page 7: 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

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

Page 8: 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

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!!!

Page 9: 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

References

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