667
edits
Changes
→Extension files and directory structure
chrome/
content/
Because this is a first extension, we will skip some [http://developer.mozilla.org/en/docs/Building_an_Extension#Setting_up_the_Development_Environment other directories and files] that more complete extensions would include (e.g., localization, skins).
====addtabbeside/====
Having added our script and overlay files, we now need to add a couple of meta data metadata files to help Firefox understand and install/load our extension.
# Chrome package '''addtabbeside''' has it's '''content''' in ./chrome/content
content addtabbeside chrome/content/
# Overlay the '''overlay.xul''' file with '''browser.xul'''
overlay chrome://browser/content/browser.xul chrome://addtabbeside/content/overlay.xul
The first line registers the location for our content (i.e., .xul, .js). The second line registers our overlay, and says that overlay.xul will be merged with browser.xul. Mozilla uses chrome:// URIs to refer to aspects of the interface, and chrome://browser/content/browser.xul ''is'' the browser (try typing it into the address bar).
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<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">
<em:id>addtabbeside@senecac.on.ca</em:id>
<em:creator>David Humphrey</em:creator>
<em:description>New tabs are created beside the current tab instead of at the end of the tab list.</em:description>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
</Description>
</em:targetApplication>
</Description>
</RDF>
</pre>
===Testing the extension===
Eventually we'll package our extension properly into a redistributable .xpi. However, while we're testing it's nice to be able to use it in an expanded state so we can make changes.
To this end, create a file named '''addtabbeside@senecac.on.ca''' and put it in your development profile's extensions directory (NOTE: replace ''Username'' with your username and ''dev-profile'' with your development profile name):
C:\Documents and Settings\''Username''\Application Data\Mozilla\Firefox\Profiles\''dev-profile''\extensions\addtabbeside@senecac.on.ca
C:\temp\addtabbeside
==First Attempt==