Commits

Mirocow  committed 210d30d

Обновлена версия на 0.7.0
1) Добавлено корректное определение header cookie и сделана корректная обработка заголовка
2) Изменены управляющие клавиши
3) Устранены баги http://modifyheaders.mozdev.org/bugs.html
Добавлен функционал Add Before и Add After

  • Participants
  • Parent commits fc5f8bf

Comments (0)

Files changed (58)

File .hgignore

Empty file removed.

File chrome.manifest

 # Firefox / Flock
 overlay	chrome://browser/content/browser.xul	chrome://modifyheaders/content/toolsOverlay.xul
 
-#content	modifyheaders	jar:chrome/modifyheaders.jar!/content/
-#locale	modifyheaders	en-US	jar:chrome/modifyheaders.jar!/locale/en-US/
+# Seamonkey
+overlay chrome://navigator/content/navigator.xul  chrome://modifyheaders/content/toolsOverlay.xul
 
 content	modifyheaders	chrome/content/
 locale	modifyheaders	en-US	chrome/locale/en-US/
 
 # The category registration is required for the Proxy service
 category profile-after-change ModifyHeadersProxy @modifyheaders.mozdev.org/proxy;1
+
+component {86e57f10-469a-11e0-9207-0800200c9a66} components/modifyheaders-autocomplete.js
+contract @mozilla.org/autocomplete/search;1?name=modifyheaders-autocomplete {86e57f10-469a-11e0-9207-0800200c9a66}

File chrome/content/about/about.css

-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-#modifyheaders-about-details
-{
-    background-color: #ffffff;
-    color: #000000;
-}
-
-#modifyheaders-about-dialog
-{
-    padding: 0;
-}
-
-#modifyheaders-about-separator
-{
-    margin-top: 0;
-}
-
-.name
-{
-    font-weight: bold;
-    font-size: x-large;
-}
-
-.title
-{
-    font-weight: bold;
-    margin-bottom: 0;
-    padding-bottom: 0;
-}
-
-.url
-{
-    color: #0000ff;
-    cursor: pointer;
-    text-decoration: underline;
-}
-.url:hover
-{
-    color: #ff0000;
-}

File chrome/content/about/about.js

-// Loads the extension home page in a new tab
-function modifyheaders_visitHomePage()
-{
-    const newTab = window.opener.getBrowser().addTab("http://www.garethhunt.com/");
-
-    window.opener.getBrowser().selectedTab = newTab;
-    window.close();
-}

File chrome/content/about/about.xul

-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://modifyheaders/content/about/about.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
-
-<dialog buttons="accept"
-        id="modifyheaders-about-dialog"
-        title="&modifyheaders.about.title;"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-    <script type="application/x-javascript" src="chrome://modifyheaders/content/about/about.js"/>
-
-    <vbox id="modifyheaders-about-details">
-        <hbox>
-            <vbox>
-                <hbox>
-                    <description value="&modifyheaders.extension.name;" class="name"/>
-                    <description value="&modifyheaders.extension.version;" class="name"/>
-                </hbox>
-                <description value="&modifyheaders.about.author.label;" class="title"/>
-                <description value="&modifyheaders.author.name;" class="name"/>
-            </vbox>
-            <spacer flex="1"/>
-            <vbox>
-                <!-- <image src="chrome://modifyheaders/content/logo.gif" width="48" height="48"/> -->
-                <spacer flex="1"/>
-            </vbox>
-        </hbox>
-        <description value="&modifyheaders.about.home.page;" class="title"/>
-        <description onclick="modifyheaders_visitHomePage()" value="&modifyheaders.about.url;" class="url"/>
-    </vbox>
-    <separator class="groove" id="modifyheaders-about-separator"/>
-</dialog>

File chrome/content/export.js

 				ModifyHeaders.ExportImport.init(this);
 				ModifyHeaders.ExportImport.wizard = document.getElementById("modifyheaders-export-wizard");
 				ModifyHeaders.ExportImport.wizard.canAdvance = false;
+				ModifyHeaders.ExportImport.ExportWizard.selectHeadersTreeView.data = JSON.parse(ModifyHeaders.ExportImport.modifyheadersService.getHeaders());
 				document.getElementById("select-headers-tree").view = ModifyHeaders.ExportImport.ExportWizard.selectHeadersTreeView;
 				this.initiated = true;
 			}
 		showConfirm: function () {
 			// TODO Modify the view to include the selected file path and list of selected headers
 			var count = 0;
-			for (var i = 0; i < ModifyHeaders.ExportImport.modifyheadersService.count; i++) {
+			for (var i = 0; i < this.selectHeadersTreeView.rowCount; i++) {
 				if (ModifyHeaders.ExportImport.ExportWizard.selectedRows[i]) {
 					count++;
 				}
 		},
 		
 		selectAllHeaders: function (checkBox) {
-			for (var i = 0; i < ModifyHeaders.ExportImport.modifyheadersService.count; i++) {
+			for (var i = 0; i < this.selectHeadersTreeView.rowCount; i++) {
 				ModifyHeaders.ExportImport.ExportWizard.selectedRows[i] = !checkBox.checked;
 			}
 			ModifyHeaders.ExportImport.wizard.canAdvance = !checkBox.checked;
 		headersSelected: function () {
 			var trueCount = 0;
 			
-			for (var i = 0; i < ModifyHeaders.ExportImport.modifyheadersService.count; i++) {
+			for (var i = 0; i < this.selectHeadersTreeView.rowCount; i++) {
 				if (ModifyHeaders.ExportImport.ExportWizard.selectedRows[i]) {
 					trueCount++;
 				}
 			}
 			ModifyHeaders.ExportImport.wizard.canAdvance = (trueCount > 0) ? true : false;
-			document.getElementById("select-all-headers").checked = (trueCount == ModifyHeaders.ExportImport.modifyheadersService.count) ? true : false;
+			document.getElementById("select-all-headers").checked = (trueCount == this.selectHeadersTreeView.rowCount) ? true : false;
 		},
 		
 		saveConfiguration: function () {
 			var exportHeaders = [],
 				exportHeadersJson = "";
 			
-			for (var i = 0; i < ModifyHeaders.ExportImport.modifyheadersService.count; i++) {
+			for (var i = 0; i < this.selectHeadersTreeView.rowCount; i++) {
 				// If selected, get the header from the service
 				if (ModifyHeaders.ExportImport.ExportWizard.selectedRows[i]) {
-					var header =  {
-						action:  ModifyHeaders.ExportImport.modifyheadersService.getHeaderAction(i),
-						name:    ModifyHeaders.ExportImport.modifyheadersService.getHeaderName(i),
-						value:   ModifyHeaders.ExportImport.modifyheadersService.getHeaderValue(i),
-						comment: ModifyHeaders.ExportImport.modifyheadersService.getHeaderComment(i)
-					};
+					var header = this.selectHeadersTreeView.data[i];
 					exportHeaders.push(header);
 				}
 			}
 		},
 		
 		selectHeadersTreeView: {
+			data: [],
 	        selection: null,
 	        get rowCount() {
-	        	return ModifyHeaders.ExportImport.modifyheadersService.count;
+	        	return this.data.length;
 	        },
 	        getCellText: function(row,column) {
 	        	if (column == "col-select" || column.id == "col-select") {
 	        		return "";
 	        	} else if (column == "col-action" || column.id == "col-action") {
-	                return ModifyHeaders.ExportImport.modifyheadersService.getHeaderAction(row);
+	                return this.data[row].action;
 	            } else if (column == "col-header-name" || column.id == "col-header-name") {
-	                return ModifyHeaders.ExportImport.modifyheadersService.getHeaderName(row);
+	            	return this.data[row].name;
 	            } else if (column == "col-header-value" || column.id == "col-header-value") {
-	                return ModifyHeaders.ExportImport.modifyheadersService.getHeaderValue(row);
+	            	return this.data[row].value;
 	            } else if (column == "col-comment" || column.id == "col-comment") {
-	                return ModifyHeaders.ExportImport.modifyheadersService.getHeaderComment(row);
+	            	return this.data[row].comment
 	            }
 	            return null;
 	        },

File chrome/content/exportimport.js

 /**
- * @author gareth
+ * @author Gareth Hunt
  */
-
 var ModifyHeaders = {};
 
 ModifyHeaders.ExportImport = (function () {
 		
 		init: function (action) {
 			this.modifyheadersService = Components.classes["@modifyheaders.mozdev.org/service;1"].getService(Components.interfaces.nsIModifyheaders);
-			for (var i = 0; i < this.modifyheadersService.count; i++) {
+			
+			var headers = JSON.parse(this.modifyheadersService.getHeaders());
+			
+			for (var i = 0; i < headers.length; i++) {
 				action.selectedRows[i] = false;
 			}
 		}

File chrome/content/exportwizard.xul

 <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
 <?xml-stylesheet href="chrome://modifyheaders/content/modifyheaders.css" type="text/css"?>
 
+<!DOCTYPE window SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
+
 <wizard id="modifyheaders-export-wizard"
-    title="Modify Headers Export Wizard"
+    title="&modifyheaders.title.export;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     buttons="accept,cancel"
     height="500"
     <script type="application/x-javascript" src="chrome://modifyheaders/content/exportimport.js"/>
     <script type="application/x-javascript" src="chrome://modifyheaders/content/export.js"/>
 
-    <wizardpage pageid="select-export-file" label="Select location to save export">
-        <description>Step 1: Select the location to save the exported configuration:</description>
-        <description id="error" hidden="true">There was an error: details to be added.</description>
+    <wizardpage pageid="select-export-file" label="&modifyheaders.label.export.file;">
+        <description>&modifyheaders.description.export.selectfile;</description>
+        <description id="error" hidden="true">&modifyheaders.error.export.selectfile;</description>
         
         <hbox>
             <textbox id="file-path" readonly="true" flex="1"/>
-            <button id="browse-file-btn" oncommand="ModifyHeaders.ExportImport.ExportWizard.openFileBrowser()" label="Browse..."/>
+            <button id="browse-file-btn" oncommand="ModifyHeaders.ExportImport.ExportWizard.openFileBrowser()" label="&modifyheaders.button.browse;"/>
         </hbox>
     </wizardpage>
 
-    <wizardpage pageid="select-headers" onpageshow="ModifyHeaders.ExportImport.ExportWizard.showSelectHeaders()">
-      <description>Step 2: Select headers to include in the export</description>
-      <checkbox id="select-all-headers" label="Select All" onclick="ModifyHeaders.ExportImport.ExportWizard.selectAllHeaders(this)"/>
+    <wizardpage pageid="select-headers" label="&modifyheaders.label.export.selectheaders;" onpageshow="ModifyHeaders.ExportImport.ExportWizard.showSelectHeaders()">
+      <description>&modifyheaders.description.export.selectheaders;</description>
+      <checkbox id="select-all-headers" label="&modifyheaders.checkbox.selectall;" onclick="ModifyHeaders.ExportImport.ExportWizard.selectAllHeaders(this)"/>
       <tree id="select-headers-tree" hidecolumnpicker="true" flex="1" rows="10" editable="true">
         <treecols>
           <treecol id="col-select" type="checkbox" editable="true" />
-          <treecol id="col-action" label="Action" flex="1"/>
-          <treecol id="col-header-name" label="Name" flex="1"/>
-          <treecol id="col-header-value" label="Value" flex="1"/>
-          <treecol id="col-comment" label="Comment" flex="1"/>
+          <treecol id="col-action" label="&modifyheaders.treecol.action;" flex="1"/>
+          <treecol id="col-header-name" label="&modifyheaders.treecol.name;" flex="1"/>
+          <treecol id="col-header-value" label="&modifyheaders.treecol.value;" flex="1"/>
+          <treecol id="col-comment" label="&modifyheaders.treecol.comment;" flex="1"/>
         </treecols>
         <treechildren />
       </tree>
     </wizardpage>
 
-    <wizardpage pageid="confirm-export" label="Confirm export selection" onpageshow="ModifyHeaders.ExportImport.ExportWizard.showConfirm()" onpageadvanced="ModifyHeaders.ExportImport.ExportWizard.saveConfiguration()">
-        <description>You will export <span id="confirm-header-count"></span> headers to <span id="confirm-file-path" style="font-weight: bold"></span>.</description>
+    <wizardpage pageid="confirm-export" label="&modifyheaders.label.export.confirm;" onpageshow="ModifyHeaders.ExportImport.ExportWizard.showConfirm()" onpageadvanced="ModifyHeaders.ExportImport.ExportWizard.saveConfiguration()">
+        <description>&modifyheaders.description.export.confirm1;<span id="confirm-header-count"></span>&modifyheaders.description.export.confirm2;<span id="confirm-file-path" style="font-weight: bold"></span>&modifyheaders.description.export.confirm3;</description>
         <description></description>
     </wizardpage>
 
     <wizardpage pageid="export-complete">
-        <description value="Your export of Modify Headers configuration is complete."/>
+        <description value="&modifyheaders.description.export.complete;"/>
     </wizardpage>
 </wizard>
 

File chrome/content/help/help.js

-const RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
-const NC = "http://home.netscape.com/NC-rdf#";
-const NC_LINK = RDF.GetResource(NC + "link");
-
-// The tree object is passed into the function
-function modifyheaders_help_loadURI(treeObj) {
-    var helpBrowser = document.getElementById("modifyheaders-help-content");
-
-	try {
-		var resource = treeObj.view.getResourceAtIndex(treeObj.currentIndex);
-		var link = treeObj.database.GetTarget(resource, NC_LINK, true);
-		if (link) {
-			link = link.QueryInterface(Components.interfaces.nsIRDFLiteral);
-			helpBrowser.webNavigation.loadURI(link.Value, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
-		}
-	} catch (e) {
-	}// when switching between tabs a spurious row number is returned.
-}
-	

File chrome/content/help/help.xul

-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://modifyheaders/content/modifyheaders.css" type="text/css"?>
-<?xml-stylesheet href="chrome://modifyheaders/content/help/modifyheadersHelp.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
-
-<page title="&modifyheaders.help.title;"
-  id="modifyheaders-help-window"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  
-	<script type="application/x-javascript" src="chrome://modifyheaders/content/help/help.js" />
-
-	<hbox flex="1">
-		<vbox id="modifyheaders-help-contents" flex="1">
-			<tree id="help-tree"
-				flex="1" hidecolumnpicker="true"
-				datasources="chrome://modifyheaders/locale/help/toc.rdf"
-				containment="http://home.netscape.com/NC-rdf#subheadings"
-				ref="urn:root"
-				onselect="modifyheaders_help_loadURI(this)"
-				flags="dont-build-content">
-
-				<template>
-					<rule>
-						<conditions>
-							<content uri="?uri"/>
-							<triple subject="?uri"
-								predicate="http://home.netscape.com/NC-rdf#subheadings"
-								object="?subheadings"/>
-							<member container="?subheadings"
-								child="?subheading"/>
-						</conditions>
-						<bindings>
-							<binding subject="?subheading"
-								predicate="http://home.netscape.com/NC-rdf#name"
-								object="?name"/>
-						</bindings>
-						<action>
-							<treechildren>
-								<treeitem uri="?subheading">
-									<treerow>
-										<treecell label="?name"/>
-									</treerow>
-								</treeitem>
-							</treechildren>
-						</action>
-					</rule>
-				</template>
-				<treecols>
-					<treecol id="ResultsColumn" flex="1"
-						hideheader="true" primary="true"
-						sortActive="false" sortDirection="natural"
-						sort="?name"/>
-				</treecols>
-			</tree>
-		</vbox>
-		<splitter id="modifyheaders-help-splitter"
-			collapse="before"
-			persist="state hidden"
-			autostretch="never"
-			state="open"/>
-		<vbox flex="4" class="helpBox">
-			<browser
-				type="content-primary"
-				id="modifyheaders-help-content"
-				src="chrome://modifyheaders/locale/help/index.xhtml"
-				flex="4"
-				style="overflow: auto;"/>
-		</vbox>
-	</hbox>
-
-</page>

File chrome/content/help/modifyheadersHelp.css

-@import url('chrome://help/content/platformClasses.css');
-
-body {
-    background-color: white;
-	font-family: arial;
-}
-
-.label {
-    font-weight: bold;
-    text-align: right;
-}

File chrome/content/icons/badge.png

Added
New image

File chrome/content/icons/bug.png

Added
New image

File chrome/content/icons/first-aid-kit.png

Added
New image

File chrome/content/icons/globe.png

Added
New image

File chrome/content/icons/info.png

Added
New image

File chrome/content/icons/star.png

Added
New image

File chrome/content/icons/thumbs-up.png

Added
New image

File chrome/content/icons/tools.png

Added
New image

File chrome/content/icons/twitter.png

Added
New image

File chrome/content/icons/user.png

Added
New image

File chrome/content/import.js

 				exportHeadersJson = "",
 				count = 0;
 			
+			var headers = JSON.parse(ModifyHeaders.ExportImport.modifyheadersService.getHeaders());
+			
 			for (var i = 0; i < ModifyHeaders.ExportImport.ImportWizard.importedConfig.length; i++) {
 				// If selected, get the header from the importedConfig
 				if (ModifyHeaders.ExportImport.ImportWizard.selectedRows[i]) {
-					var action  = ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].action,
-						name    = ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].name,
-						value   = ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].value,
-						comment = ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].comment;
-					
-					ModifyHeaders.ExportImport.modifyheadersService.addHeader(name, value, action, comment, false);
+					var header = {
+						action  : ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].action,
+						name    : ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].name,
+						value   : ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].value,
+						comment : ModifyHeaders.ExportImport.ImportWizard.importedConfig[i].comment
+					};
+					headers.push(header);
 					count++;
 				}
 			}
+			ModifyHeaders.ExportImport.modifyheadersService.saveHeaders(JSON.stringify(headers));
 			this.retVal.importedHeaderCount = count;
 		}
 	}

File chrome/content/importwizard.xul

 <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
 <?xml-stylesheet href="chrome://modifyheaders/content/modifyheaders.css" type="text/css"?>
 
+<!DOCTYPE window SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
+
 <wizard id="modifyheaders-import-wizard"
-    title="Modify Headers Import Wizard"
+    title="&modifyheaders.title.import;"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     buttons="accept,cancel"
     height="500"
     <script type="application/x-javascript" src="chrome://modifyheaders/content/exportimport.js"/>
     <script type="application/x-javascript" src="chrome://modifyheaders/content/import.js"/>
 
-    <wizardpage pageid="select-import-file" label="Select file to import" onpageadvanced="return ModifyHeaders.ExportImport.ImportWizard.loadHeaders()">
-        <description>Step 1: Select the location of the configuration file to import:</description>
-        <description id="error" hidden="true">There was an error importing the configuration.  Please check the file format before trying again.</description>
+    <wizardpage pageid="select-import-file" label="&modifyheaders.label.import.file;" onpageadvanced="return ModifyHeaders.ExportImport.ImportWizard.loadHeaders()">
+        <description>&modifyheaders.description.import.selectfile;</description>
+        <description id="error" hidden="true">&modifyheaders.error.import.selectfile;</description>
         
         <hbox>
             <textbox id="file-path" readonly="true" flex="1"/>
-            <button id="browse-file-btn" oncommand="ModifyHeaders.ExportImport.ImportWizard.openFileBrowser()" label="Browse..."/>
+            <button id="browse-file-btn" oncommand="ModifyHeaders.ExportImport.ImportWizard.openFileBrowser()" label="&modifyheaders.button.browse;"/>
         </hbox>
     </wizardpage>
 
-    <wizardpage pageid="select-headers" onpageshow="ModifyHeaders.ExportImport.ImportWizard.showSelectHeaders()">
-      <description>Step 2: Select headers to be imported</description>
-      <checkbox id="select-all-headers" label="Select All" onclick="ModifyHeaders.ExportImport.ImportWizard.selectAllHeaders(this)"/>
+    <wizardpage pageid="select-headers" label="&modifyheaders.label.import.selectheaders;" onpageshow="ModifyHeaders.ExportImport.ImportWizard.showSelectHeaders()">
+      <description>&modifyheaders.description.import.selectheaders;</description>
+      <checkbox id="select-all-headers" label="&modifyheaders.checkbox.selectall;" onclick="ModifyHeaders.ExportImport.ImportWizard.selectAllHeaders(this)"/>
       <tree id="select-headers-tree" hidecolumnpicker="true" flex="1" rows="10" editable="true">
         <treecols>
           <treecol id="col-select" type="checkbox" editable="true" />
-          <treecol id="col-action" label="Action" flex="1"/>
-          <treecol id="col-header-name" label="Name" flex="1"/>
-          <treecol id="col-header-value" label="Value" flex="1"/>
-          <treecol id="col-comment" label="Comment" flex="1"/>
+          <treecol id="col-action" label="modifyheaders.treecol.action" flex="1"/>
+          <treecol id="col-header-name" label="modifyheaders.treecol.name" flex="1"/>
+          <treecol id="col-header-value" label="modifyheaders.treecol.value" flex="1"/>
+          <treecol id="col-comment" label="modifyheaders.treecol.comment" flex="1"/>
         </treecols>
         <treechildren />
       </tree>
     </wizardpage>
 
-    <wizardpage pageid="confirm-import" label="Confirm import selection" onpageshow="ModifyHeaders.ExportImport.ImportWizard.showConfirm()" onpageadvanced="ModifyHeaders.ExportImport.ImportWizard.import()">
-        <description>You will import <span id="confirm-header-count"></span> headers from <span id="confirm-file-path" style="font-weight: bold"></span>.</description>
+    <wizardpage pageid="confirm-import" label="&modifyheaders.label.import.confirm;" onpageshow="ModifyHeaders.ExportImport.ImportWizard.showConfirm()" onpageadvanced="ModifyHeaders.ExportImport.ImportWizard.import()">
+        <description>&modifyheaders.description.import.confirm1;<span id="confirm-header-count"></span>&modifyheaders.description.import.confirm2;<span id="confirm-file-path" style="font-weight: bold"></span>&modifyheaders.description.import.confirm3;</description>
         <description></description>
     </wizardpage>
 
     <wizardpage pageid="import-complete">
-        <description value="Your import of Modify Headers configuration is complete."/>
+        <description value="&modifyheaders.description.import.complete;"/>
     </wizardpage>
 </wizard>
 

File chrome/content/modifyheaders.css

 prefwindow {
   -moz-binding: url("chrome://modifyheaders/content/bindings/bindings.xml#prefwindow");
 }
+
+radio[pane=paneHeaders] {
+  list-style-image:url("chrome://modifyheaders/content/icons/user.png");
+}
+radio[pane=paneOptions] {
+  list-style-image:url("chrome://modifyheaders/content/icons/tools.png");
+}
+radio[pane=paneAbout] {
+  list-style-image:url("chrome://modifyheaders/content/icons/info.png");
+}
+radio#modifyheaders-help-button {
+	text-align: end;
+	list-style-image:url("chrome://modifyheaders/content/icons/first-aid-kit.png");
+  -moz-binding: url(chrome://global/content/bindings/preferences.xml#panebutton);
+  -moz-box-orient: vertical;
+  -moz-box-align: center
+}
+
+treechildren::-moz-tree-drop-feedback(dropAfter) {
+  border-bottom: 2px solid black;
+}

File chrome/content/modifyheaders.js

       this.mhWindow = window.openDialog("chrome://modifyheaders/content/preferences.xul", "modifyheaders", "chrome,all,dialog=no");
     } else {
       // The window is open, so shift focus to it
-      this.mhWindow.focus()
+      this.mhWindow.focus();
     }
   },
-		
+    
   modifyheadersService: Components.classes["@modifyheaders.mozdev.org/service;1"].getService(Components.interfaces.nsIModifyheaders),
   initialized: false,
   mhWindow: null,
-
+  
+  preferences: null,
+  
   // Control constants
   headersTree: null,
   actionMenuList: null,
   commentTextbox: null,
   addButton: null,
   saveButton: null,
-
-  // nsITreeView interface properties
-  treeSelection: null, // nsiTreeSelection
-  treeBox: null, // The tree
-  editedRowID: null, // The row currently being edited
   
-  // Getters and Setters
-  set rowCount(i) { throw "rowCount is a readonly property"; },
-  get rowCount() { return this.modifyheadersService.count; },
-  
-  set selection(s) { this.treeSelection = s; },
-  get selection() { return this.treeSelection; },
-  
-  // START nsITreeView interface methods
-//  canDropBeforeAfter: function(index, before) { return false; },
-//  canDropOn : function(index) { return false; },
-//  cycleCell : function(row, columnID) { /* do nothing */ },
-  cycleHeader: function(columnID, element) {
-    /* do nothing */
-  },
-//  drop: function(row, orientation) { /* do nothing */ return false; },
-  getCellProperties: function(row, columnID, properties) { /* do nothing */ },
-  getCellText: function(row, column) {
-    if (column == "actioncol" || column.id == "actioncol") {
-      return this.modifyheadersService.getHeaderAction(row);
-    } else if (column == "namecol" || column.id == "namecol") {
-      return this.modifyheadersService.getHeaderName(row);
-    } else if (column == "valuecol" || column.id == "valuecol") {
-      return this.modifyheadersService.getHeaderValue(row);
-    } else if (column == "commentcol" || column.id == "commentcol") {
-      return this.modifyheadersService.getHeaderComment(row);
-    }
-    return null;
-	},
-//  getCellValue: function(row, columnID) { /* return null; */ },
-  getColumnProperties: function(columnID, element, properties) { /* do nothing */ },
-  getImageSrc: function(rowIndex, column) {
-  	if (column == "enabledcol" || column.id == "enabledcol") {
-  		if (this.modifyheadersService.isHeaderEnabled(rowIndex)) {
-  			return "chrome://modifyheaders/content/enabled.gif";
-  		} else {
-  			return "chrome://modifyheaders/content/disabled.gif";
-  		}
-  	}
-  	return null;
-  },
-//  getLevel: function(index) { return 0; },
-//  getParentIndex: function(rowIndex) { return 0; },
-//  getProgressMode: function(rowIndex, columnID) { /* return 0; */ },
-  getRowProperties: function(rowIndex, properties) { /* do nothing */ },
-//  hasNextSibling: function(rowIndex, afterIndex) { return false; },
-  isContainer: function(index) { return false; },
-//  isContainerEmpty: function(index) { return false; },
-//  isContainerOpen: function(index) { /* return false; */ },
-//  isEditable: function(rowIndex, columnID) { return false; },
-  isSeparator: function(index) { return false; },
-  isSorted: function(index) { /* return false; */ },
-//  performAction: function(action) { /* do nothing */ },
-//  performActionOnCell: function(action, rowIndex, columnID) { /* do nothing */ },
-//  performActionOnRow: function(action, rowIndex) { /* do nothing */ },
-//  selectionChanged: function() { /* do nothing */ },
-//  setCellText: function(rowIndex, columnID, value) { /* do nothing */ },
-  setTree: function(tree) { this.treeBox=tree; },
-//  toggleOpenState: function(index) { /* do nothing */ },
-  // END nsITreeView interface methods
+  // nsITreeView
+  headerListTreeView: {
+    data: null,        // Tree data
+    treeBox: null,     // The tree
+    editedRowID: null, // The row currently being edited
+    selection: null,   // nsITreeSelection
+    
+    // Getters and Setters
+    set rowCount(i) { throw "rowCount is a readonly property"; },
+    get rowCount() { return this.data.length; },
+    
+    // START nsITreeView interface methods
+    canDrop: function (index, orientation) {
+      return true;
+    },
+    // cycleCell : function(row, columnID) { /* do nothing */ },
+    cycleHeader: function(columnID, element) {
+      /* do nothing */
+    },
+    
+    dragStart: function (event) {
+      var index = ModifyHeaders.headerListTreeView.selection.currentIndex;
+      if (index > -1) { 
+        event.dataTransfer.setData("text/plain", index);
+      }
+      event.stopPropagation();
+    },
+    
+    drop: function(targetRowID, orientation, dataTransfer) {
+      var sourceRowID = dataTransfer.getData("text/plain");
+      ModifyHeaders.moveRow(sourceRowID, targetRowID, orientation)
+    },
+    
+    getCellProperties: function(row, columnID, properties) { /* do nothing */ },
+    getCellText: function(row, column) {
+      if (column == "actioncol" || column.id == "actioncol") {
+    	return this.data[row].action;
+      } else if (column == "namecol" || column.id == "namecol") {
+    	return this.data[row].name;
+      } else if (column == "valuecol" || column.id == "valuecol") {
+    	return this.data[row].value;
+      } else if (column == "commentcol" || column.id == "commentcol") {
+    	return this.data[row].comment;
+      }
+      return null;
+    },
+  //  getCellValue: function(row, columnID) { /* return null; */ },
+    getColumnProperties: function(columnID, element, properties) { /* do nothing */ },
+    getImageSrc: function(rowIndex, column) {
+      if (column == "enabledcol" || column.id == "enabledcol") {
+        if (this.data[rowIndex].enabled) {
+          return "chrome://modifyheaders/content/enabled.gif";
+        } else {
+          return "chrome://modifyheaders/content/disabled.gif";
+        }
+      }
+      return null;
+    },
+    getLevel: function (index) { return 0; },
+    getParentIndex: function (rowIndex) { return -1; },
+//    getProgressMode: function(rowIndex, columnID) { /* return 0; */ },
+    getRowProperties: function(rowIndex, properties) { /* do nothing */ },
+//    hasNextSibling: function(rowIndex, afterIndex) { return false; },
+    isContainer: function(index) { return false; },
+//    isContainerEmpty: function(index) { return false; },
+//    isContainerOpen: function(index) { /* return false; */ },
+//    isEditable: function(rowIndex, columnID) { return false; },
+    isSeparator: function(index) { return false; },
+    isSorted: function(index) { /* return false; */ },
+//    performAction: function(action) { /* do nothing */ },
+//    performActionOnCell: function(action, rowIndex, columnID) { /* do nothing */ },
+//    performActionOnRow: function(action, rowIndex) { /* do nothing */ },
+//    selectionChanged: function() { /* do nothing */ },
+//    setCellText: function(rowIndex, columnID, value) { /* do nothing */ },
+    setTree: function(tree) { this.treeBox=tree; }//,
+//    toggleOpenState: function(index) { /* do nothing */ },
+  },  // End headerListTreeView
     
   start: function() {
     // Initialize the form controls
     this.addButton = document.getElementById("add-header-button");
     this.saveButton = document.getElementById("save-header-button");
     
+    // Add help radio button to toolbar radiogroup
+    // TODO Use an overlay or XBL
+    var helpRadio = document.createElement("radio");
+    helpRadio.setAttribute("id", "modifyheaders-help-button");
+    helpRadio.setAttribute("label", document.getElementById("modifyheadersStringResources").getString("modifyheaders.button.help"));
+    helpRadio.setAttribute("oncommand", "ModifyHeaders.openHelp(); return false;");
+    
+    var helpSeparator = document.createElement("separator");
+    helpSeparator.setAttribute("class", "thin");
+    helpSeparator.setAttribute("orient", "vertical");
+    
+    document.documentElement._selector.appendChild(helpSeparator);
+    document.documentElement._selector.appendChild(helpRadio);
+    
+    // Set the data for the treeView
+    this.headerListTreeView.data = JSON.parse(this.modifyheadersService.getHeaders());
+    
     // Set this view for the treeBoxObject
-    this.headersTree.treeBoxObject.view = this;
+    this.headersTree.treeBoxObject.view = this.headerListTreeView;
+    
+    // Configure the preferences service
+    this.preferences = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("modifyheaders.");
+    this.preferences.QueryInterface(Components.interfaces.nsIPrefBranch2);
+    
+    // Prepare the Header Names Autocomplete
+    this.prepareHeaderNamesList();
+    
     this.initialized = true;
   },
   
   toggleWindow: function () {
-	document.getElementById("modifyheaders-window").lastSelected = "paneHeaders";
+  document.getElementById("modifyheaders-window").lastSelected = "paneHeaders";
     this.modifyheadersService.windowOpen = !this.modifyheadersService.windowOpen;
   },
   
   refresh: function(index, count) {
-    this.treeBox.rowCountChanged(index, count)
-    this.treeSelection.select(this.rowCount-1)
+    this.headerListTreeView.treeBox.rowCountChanged(index, count);
+    this.headerListTreeView.selection.select(this.rowCount-1);
   },
   
   addHeader: function() {
-    // Values
     // TODO Make the enabled default value a preference, true for now
-    var enabled = true;
-    var action = document.getElementById("action-menulist").selectedItem.label;
-    var name = document.getElementById("headername-text-box").value;
-   	var value = document.getElementById("headervalue-text-box").value;
-   	var comment = document.getElementById("headercomment-text-box").value;
-    	
-    this.modifyheadersService.addHeader(name, value, action, comment, enabled);
+    var header = {
+      "action" : document.getElementById("action-menulist").selectedItem.label,
+      "name"   : document.getElementById("headername-text-box").value,
+      "value"  : document.getElementById("headervalue-text-box").value,
+      "comment": document.getElementById("headercomment-text-box").value,
+      "enabled": true
+    }
+    this.headerListTreeView.data.push(header);
     
     // Notify the treeBoxObject that a row has been added,
     // Select the row
-    this.treeBox.rowCountChanged(this.rowCount-1, 1);
-    this.treeSelection.select(this.rowCount-1);
+    this.headerListTreeView.treeBox.rowCountChanged(this.headerListTreeView.rowCount-1, 1);
+    this.headerListTreeView.selection.select(this.headerListTreeView.rowCount-1);
     
     this.clearForm();
+    this.storeHeaders();
   },
   
   // Delete the header from the list
   deleteHeader: function() {
-    var deleteIndex = this.treeSelection.currentIndex;
+    var deleteIndex = this.headerListTreeView.selection.currentIndex;
     
-    this.modifyheadersService.removeHeader(deleteIndex);
+    this.headerListTreeView.data.splice(deleteIndex, 1);
     
     // Notify the treeBoxObject that a row has been deleted
     // Select the next row if there is one
-    this.treeBox.rowCountChanged(deleteIndex, -1);
-    this.treeSelection.select(deleteIndex);
+    this.headerListTreeView.treeBox.rowCountChanged(deleteIndex, -1);
+    this.headerListTreeView.selection.select(deleteIndex);
+    
+    this.storeHeaders();
   },
     
   editHeader: function() {
-    var selectedRowIndex = this.treeSelection.currentIndex
+    var selectedRowIndex = this.headerListTreeView.selection.currentIndex
     
     // Set the form values to the value of the selected item
     if (selectedRowIndex > -1) {
-      this.actionMenuList.value = this.modifyheadersService.getHeaderAction(selectedRowIndex)
-      this.nameTextbox.value = this.modifyheadersService.getHeaderName(selectedRowIndex)
-      if (this.modifyheadersService.getHeaderValue(selectedRowIndex) != "") {
-        this.valueTextbox.value = this.modifyheadersService.getHeaderValue(selectedRowIndex)
+      this.actionMenuList.value = this.headerListTreeView.data[selectedRowIndex].action;
+      this.nameTextbox.value = this.headerListTreeView.data[selectedRowIndex].name;
+      
+      if (this.headerListTreeView.data[selectedRowIndex].value != "") {
+        this.valueTextbox.value = this.headerListTreeView.data[selectedRowIndex].value;
       }
-      if (this.modifyheadersService.getHeaderComment(selectedRowIndex) != "") {
-        this.commentTextbox.value = this.modifyheadersService.getHeaderComment(selectedRowIndex)
+      if (this.headerListTreeView.data[selectedRowIndex].comment != "") {
+        this.commentTextbox.value = this.headerListTreeView.data[selectedRowIndex].comment;
       }
       
-      this.editedRowID = selectedRowIndex
+      this.headerListTreeView.editedRowID = selectedRowIndex;
       
       // Hide the add button and display the save button
-      this.addButton.setAttribute("hidden", "true")
-      this.saveButton.setAttribute("hidden", "false")
+      this.addButton.setAttribute("hidden", "true");
+      this.saveButton.setAttribute("hidden", "false");
       
-      this.nameTextbox.disabled = false
+      this.nameTextbox.disabled = false;
       if (this.valueTextbox.value.length > 0) {
-        this.valueTextbox.disabled = false
+        this.valueTextbox.disabled = false;
       }
-      this.commentTextbox.disabled = false
-      this.addButton.disabled = false
-      this.saveButton.disabled = false
+      this.commentTextbox.disabled = false;
+      this.addButton.disabled = false;
+      this.saveButton.disabled = false;
     }
   },
   
   saveHeader: function() {
-  
-    if (this.editedRowID != null) {
-      var index = this.editedRowID
-      var name = this.nameTextbox.value
-      var value = this.valueTextbox.value
-      var comment = this.commentTextbox.value
-      var action = this.actionMenuList.selectedItem.label
-      var enabled = this.modifyheadersService.isHeaderEnabled(index)
-      
-      this.modifyheadersService.setHeader(index, name, value, action, comment, enabled)
+    if (this.headerListTreeView.editedRowID != null) {
+    	
+      var header = {
+        "action" : this.actionMenuList.selectedItem.label,
+        "name"   : this.nameTextbox.value,
+        "value"  : this.valueTextbox.value,
+        "comment": this.commentTextbox.value,
+        "enabled": this.headerListTreeView.data[this.headerListTreeView.editedRowID].enabled
+      }
+      this.headerListTreeView.data[this.headerListTreeView.editedRowID] = header;
       
       // Notify the treeBoxObject that a row has been edited
-      this.treeBox.invalidateRow(this.editedRowID)
+      this.headerListTreeView.treeBox.invalidateRow(this.headerListTreeView.editedRowID);
       
       // Select the row
-      this.treeSelection.select(this.editedRowID)
+      this.headerListTreeView.selection.select(this.headerListTreeView.editedRowID);
       
       // Set the editedRow to null
-      this.editedRowID = null
+      this.headerListTreeView.editedRowID = null;
       
-      this.clearForm()
+      this.clearForm();
+      this.storeHeaders();
     }
   },
   
+  storeHeaders: function () {
+	var data = JSON.stringify(this.headerListTreeView.data);
+	this.modifyheadersService.saveHeaders(data);
+	this.prepareHeaderNamesList();
+  },
+  
   clearForm: function() {
     this.actionMenuList.value = "";
     this.nameTextbox.value = "";
     this.saveButton.setAttribute("hidden", "true");
     this.addButton.disabled = true;
     this.saveButton.disabled = true;
-    
-    // Ensure that the selected index is set back to null
-    var selectedRowIndex = null;
   },
   
   enableHeader: function() {
     // Change the enabled parameter to true
-    var enabled = this.modifyheadersService.isHeaderEnabled(this.treeSelection.currentIndex)
-    
-    this.modifyheadersService.setHeaderEnabled(this.treeSelection.currentIndex, !enabled)
+    var enabled = this.headerListTreeView.data[this.headerListTreeView.selection.currentIndex].enabled;
+    this.headerListTreeView.data[this.headerListTreeView.selection.currentIndex].enabled = !enabled;
       
     // Notify the treeBoxObject that a row has been edited
-    this.treeBox.invalidateRow(this.treeSelection.currentIndex)
+    this.headerListTreeView.treeBox.invalidateRow(this.headerListTreeView.selection.currentIndex);
+    this.storeHeaders();
   },
   
+  // TODO Combine enableAllHeaders and disableAllHeaders into a single method
   enableAllHeaders: function() {
-    var tempSelectedIndex = this.treeSelection.currentIndex
+    var selectedIndex = this.headerListTreeView.selection.currentIndex;
     
-    for (var i=0; i < this.modifyheadersService.count; i++) {
-      this.modifyheadersService.setHeaderEnabled(i, true)
+    for (var i=0; i < this.headerListTreeView.rowCount; i++) {
+      this.headerListTreeView.data[i].enabled = true;
       
       // Notify the treeBoxObject that a row has been edited
-      this.treeSelection.select(i)
-      this.treeBox.rowCountChanged(i, 0)
+      this.headerListTreeView.selection.select(i);
+      this.headerListTreeView.treeBox.rowCountChanged(i, 0);
     }
     
     // Revert to the previous selectedIndex
-    this.treeSelection.select(tempSelectedIndex)
+    this.headerListTreeView.selection.select(selectedIndex);
+    this.storeHeaders();
   },
   
   disableAllHeaders: function() {
-    var tempSelectedIndex = this.treeSelection.currentIndex
+    var tempSelectedIndex = this.headerListTreeView.selection.currentIndex;
     
-    for (var i=0; i < this.modifyheadersService.count; i++) {
-      this.modifyheadersService.setHeaderEnabled(i, false)
+    for (var i=0; i < this.headerListTreeView.rowCount; i++) {
+      this.headerListTreeView.data[i].enabled = false;
       
       // Notify the treeBoxObject that a row has been edited
-      this.treeSelection.select(i)
-      this.treeBox.rowCountChanged(i, 0)
+      this.headerListTreeView.selection.select(i);
+      this.headerListTreeView.treeBox.rowCountChanged(i, 0);
     }
     
     // Revert to the previous selectedIndex
-    this.treeSelection.select(tempSelectedIndex)
+    this.headerListTreeView.selection.select(tempSelectedIndex);
+    this.storeHeaders();
   },
   
-  moveRowDown: function() {
-    if (this.treeSelection && this.treeSelection.currentIndex != this.rowCount - 1) {
-      var selectedIndex = this.treeSelection.currentIndex
-      this.modifyheadersService.switchHeaders(selectedIndex, selectedIndex + 1)
-      
-      // Change the selection
-      this.treeSelection.select(this.treeSelection.currentIndex + 1)
-      this.treeBox.rowCountChanged(this.selection.currentIndex, 0)
+  // Orientation is for drag/drop functionality.
+  // Other Move commands can fake it using:
+  // * Components.interfaces.nsITreeView.DROP_AFTER
+  // * Components.interfaces.nsITreeView.DROP_BEFORE
+  moveRow: function (sourceRowID, targetRowID, orientation) {    
+    var sourceHeader;
+    var sourceHeaderRemoved = false;
+    
+    if (sourceRowID > targetRowID) {
+      var removedHeaders = this.headerListTreeView.data.splice(sourceRowID, 1);
+      sourceHeader = removedHeaders[0];
+      sourceHeaderRemoved = true;
+    } else {
+      sourceHeader = this.headerListTreeView.data[sourceRowID];
+    }
+    
+    if (orientation == Components.interfaces.nsITreeView.DROP_BEFORE) {
+      this.headerListTreeView.data.splice(targetRowID, 0, sourceHeader);
+    } else if (orientation == Components.interfaces.nsITreeView.DROP_AFTER) {
+      this.headerListTreeView.data.splice((targetRowID+1), 0, sourceHeader);
+    } else if (orientation == Components.interfaces.nsITreeView.DROP_ON) {
+      Components.utils.reportError("nsITreeView.DROP_ON not supported.");
+      // TODO Throw an error ? 
+    } else {
+      Components.utils.reportError("Incorrect orientation after drop: " + orientation);
+      // TODO Throw an error ? 
+    }
+  	
+    if (!sourceHeaderRemoved) {
+      this.headerListTreeView.data.splice(sourceRowID, 1);
+    }
+    
+    // Change the selection
+    this.headerListTreeView.selection.select(targetRowID);
+    this.headerListTreeView.treeBox.invalidate();// Redraw all rows in their new order
+    
+    // Store the new header arrangement
+    this.storeHeaders();
+  },
+  
+  moveRowBottom: function () {
+	  if (this.headerListTreeView.selection && this.headerListTreeView.selection.currentIndex != this.headerListTreeView.rowCount - 1) {
+        var sourceRowID = this.headerListTreeView.selection.currentIndex;
+        var targetRowID = (this.headerListTreeView.rowCount-1);
+        this.moveRow(sourceRowID, targetRowID, Components.interfaces.nsITreeView.DROP_AFTER);
+	  }
+  },
+  
+  moveRowTop: function () {
+    if (this.headerListTreeView.selection && this.headerListTreeView.selection.currentIndex != 0) {
+      var sourceRowID = this.headerListTreeView.selection.currentIndex;
+      var targetRowID = 0;
+      this.moveRow(sourceRowID, targetRowID, Components.interfaces.nsITreeView.DROP_BEFORE);
     }
   },
-  
-  moveRowUp: function() {
-    if (this.treeSelection && this.treeSelection.currentIndex != 0) {
     
-      var selectedIndex = this.treeSelection.currentIndex
-      this.modifyheadersService.switchHeaders(selectedIndex, selectedIndex - 1)
-      this.treeSelection.select(this.treeSelection.currentIndex - 1)
-      this.treeBox.rowCountChanged(this.selection.currentIndex-1, 0)
-    }
-  },
-  
   actionSelected: function() {
     switch(this.actionMenuList.selectedItem.value) {
       case "Add":
       case "Add before":
       case "Add after":
       case "Modify":
-        this.nameTextbox.disabled = false
-        this.valueTextbox.disabled = false
-        this.commentTextbox.disabled = false
-        this.addButton.disabled = false
-        this.saveButton.disabled = false
+        this.nameTextbox.disabled = false;
+        this.valueTextbox.disabled = false;
+        this.commentTextbox.disabled = false;
+        this.addButton.disabled = false;
+        this.saveButton.disabled = false;
         break
       case "Filter":
-        this.nameTextbox.disabled = false
-        this.valueTextbox.value = ""
-        this.valueTextbox.disabled = true
-        this.commentTextbox.disabled = false
-        this.addButton.disabled = false
-        this.saveButton.disabled = false
+        this.nameTextbox.disabled = false;
+        this.valueTextbox.value = "";
+        this.valueTextbox.disabled = true;
+        this.commentTextbox.disabled = false;
+        this.addButton.disabled = false;
+        this.saveButton.disabled = false;
         break
       default:
-        this.clearForm()
+        this.clearForm();
     }
   },
   
-  openHelp: function() {
-    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]. getService(Components.interfaces.nsIWindowMediator)
-    var window = wm.getMostRecentWindow("navigator:browser")
-    window.gBrowser.selectedTab = window.gBrowser.addTab("http://www.garethhunt.com/modifyheaders/help/")
+  prepareHeaderNamesList: function () {
+	var headerNames = JSON.parse(this.preferences.getCharPref("autocomplete.name.defaults"));
+	
+	this.headerListTreeView.data.forEach(function (element, index, array) {
+      var name = element.name;
+	  if (headerNames.indexOf(name) == -1 && headerNames.indexOf(name.toLowerCase()) == -1) {
+		headerNames.push(name);
+	  }
+	});
+	
+	// Sort the headers names into alphabetical order
+	headerNames.sort();
+	
+	var headerNamesList = headerNames.map(function (value) {
+		return {"value": value};
+	});
+	
+	this.nameTextbox.searchParam = JSON.stringify(headerNamesList);
   },
   
-  openConfig: function() {
-    var spl = document.getElementById("configSplitter")
-    if (spl.getAttribute("state") == "open" || spl.getAttribute("state") == "") {
-      spl.setAttribute("state", "collapsed")
-    } else {
-      spl.setAttribute("state", "open")
-    }
+  openHelp: function() {
+    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]. getService(Components.interfaces.nsIWindowMediator);
+    var mrw = wm.getMostRecentWindow("navigator:browser");
+    mrw.gBrowser.selectedTab = mrw.gBrowser.addTab(document.getElementById("modifyheadersStringResources").getString("modifyheaders.url.help"));
   }
 };

File chrome/content/preferences-tab.xul

     ondialoghelp="ModifyHeaders.openHelp()"
     onload="ModifyHeaders.toggleWindow()"
     onunload="ModifyHeaders.toggleWindow()">
+    
     <prefpane id="paneHeaders" label="Headers" selected="true" onpaneload="ModifyHeaders.start()"
         insertbefore="modifyheaders-window-sizetocontent"
         src="chrome://modifyheaders/content/prefs-headers.xul" flex="1"/>
     <prefpane id="paneOptions" label="Options"
         insertbefore="modifyheaders-window-sizetocontent"
         src="chrome://modifyheaders/content/prefs-options.xul" flex="1"/>
+    <prefpane id="paneAbout" label="About"
+        insertbefore="modifyheaders-window-sizetocontent"
+        src="chrome://modifyheaders/content/prefs-about.xul" flex="1"/>
     
+    <stringbundleset>
+      <stringbundle id="modifyheadersStringResources" src="chrome://modifyheaders/locale/modifyheaders.properties"/>
+    </stringbundleset>
     <command id="addHeader" oncommand="ModifyHeaders.addHeader();"/>
     <command id="editHeader" oncommand="ModifyHeaders.editHeader();"/>
     <command id="deleteHeader" oncommand="ModifyHeaders.deleteHeader();"/>
     <command id="saveHeader" oncommand="ModifyHeaders.saveHeader();"/>
     <command id="resetHeaderForm" oncommand="ModifyHeaders.clearForm();"/>
-    <command id="moveRowUp" oncommand="ModifyHeaders.moveRowUp();"/>
-    <command id="moveRowDown" oncommand="ModifyHeaders.moveRowDown();"/>
+    <command id="moveRowTop" oncommand="ModifyHeaders.moveRowTop();"/>
+    <command id="moveRowBottom" oncommand="ModifyHeaders.moveRowBottom();"/>
     <command id="enableHeader" oncommand="ModifyHeaders.enableHeader();"/>
     <command id="enableAllHeaders" oncommand="ModifyHeaders.enableAllHeaders();"/>
     <command id="disableAllHeaders" oncommand="ModifyHeaders.disableAllHeaders();"/>

File chrome/content/preferences.js

 				importedHeaderCount: 0
 			}
 			var importDialog = window.openDialog("chrome://modifyheaders/content/importwizard.xul", "modifyheadersImportWizard", "chrome,modal,titlebar,toolbar,resizeable,centerscreen,dialog=no", this, retVals);
-			ModifyHeaders.treeBox.rowCountChanged(0, retVals.importedHeaderCount);
-			ModifyHeaders.treeSelection.select(this.rowCount-1);
+			ModifyHeaders.headerListTreeView.data = JSON.parse(ModifyHeaders.modifyheadersService.getHeaders());
+			ModifyHeaders.headerListTreeView.treeBox.rowCountChanged(0, retVals.importedHeaderCount);
+			ModifyHeaders.headerListTreeView.selection.select(ModifyHeaders.headerListTreeView.rowCount-1);
 		}
 	}	
 })();

File chrome/content/preferences.xul

         src="chrome://modifyheaders/content/prefs-headers.xul" flex="1"/>
     <prefpane id="paneOptions" label="Options"
         src="chrome://modifyheaders/content/prefs-options.xul" flex="1"/>
+    <prefpane id="paneAbout" label="About"
+        src="chrome://modifyheaders/content/prefs-about.xul" flex="1"/>
     
+    <stringbundleset>
+      <stringbundle id="modifyheadersStringResources" src="chrome://modifyheaders/locale/modifyheaders.properties"/>
+    </stringbundleset>
     <command id="addHeader" oncommand="ModifyHeaders.addHeader();"/>
     <command id="editHeader" oncommand="ModifyHeaders.editHeader();"/>
     <command id="deleteHeader" oncommand="ModifyHeaders.deleteHeader();"/>
     <command id="saveHeader" oncommand="ModifyHeaders.saveHeader();"/>
     <command id="resetHeaderForm" oncommand="ModifyHeaders.clearForm();"/>
-    <command id="moveRowUp" oncommand="ModifyHeaders.moveRowUp();"/>
-    <command id="moveRowDown" oncommand="ModifyHeaders.moveRowDown();"/>
+    <command id="moveRowTop" oncommand="ModifyHeaders.moveRowTop();"/>
+    <command id="moveRowBottom" oncommand="ModifyHeaders.moveRowBottom();"/>
     <command id="enableHeader" oncommand="ModifyHeaders.enableHeader();"/>
     <command id="enableAllHeaders" oncommand="ModifyHeaders.enableAllHeaders();"/>
     <command id="disableAllHeaders" oncommand="ModifyHeaders.disableAllHeaders();"/>

File chrome/content/prefs-about.xul

+<?xml version="1.0"?>
+<!DOCTYPE page SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
+<overlay id="modifyheaders-about-overlay"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  
+  <prefpane id="paneAbout" label="About">
+    <preferences/>
+    
+    <groupbox>
+      <!-- <image src="chrome://modifyheaders/content/logo.gif" width="64" height="64"/> -->
+      <!-- <separator flex="1" orient="horizontal"/> -->
+      <caption>&modifyheaders.caption.about;</caption>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/star.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description class="title">&modifyheaders.label.version;: &modifyheaders.extension.version;</description>
+          <description class="title">&modifyheaders.label.author;: &modifyheaders.author.name;</description>
+        </vbox>
+      </hbox>
+      
+      <separator flex="1" orient="horizontal"/>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/globe.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description value="&modifyheaders.label.homepage;" class="title"/>
+          <label class="text-link" href="&modifyheaders.url.homepage.v;" value="&modifyheaders.url.homepage;"/>
+        </vbox>
+      </hbox>
+      
+      <separator flex="1" orient="horizontal"/>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/bug.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description class="title">&modifyheaders.label.defects.description;</description>
+          <label class="text-link" href="&modifyheaders.url.defects.v;" value="&modifyheaders.url.defects;"/>
+        </vbox>
+      </hbox>
+      
+      <separator flex="1" orient="horizontal"/>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/twitter.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description class="title">&modifyheaders.label.twitter.description;</description>
+          <label class="text-link" href="&modifyheaders.url.twitter;" value="&modifyheaders.url.twitter;"/>
+        </vbox>
+      </hbox>
+    </groupbox>
+    
+    <groupbox>
+      <caption>&modifyheaders.caption.contribute;</caption>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/thumbs-up.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description class="title">&modifyheaders.label.contribute.description;</description>
+          <label class="text-link" href="&modifyheaders.url.contribute;" value="&modifyheaders.label.contribute;"/>
+        </vbox>
+      </hbox>
+    </groupbox>
+
+    <groupbox>
+      <caption>&modifyheaders.caption.thankyou;</caption>
+      <hbox>
+        <vbox>
+          <image src="chrome://modifyheaders/content/icons/badge.png" />
+        </vbox>
+        <separator orient="vertical"/>
+        <vbox>
+          <description class="title">&modifyheaders.label.icons.description;</description>
+          <label class="text-link" href="&modifyheaders.url.icons1;" value="&modifyheaders.label.icons1;"/>
+          <label class="text-link" href="&modifyheaders.url.icons2;" value="&modifyheaders.label.icons2;"/>
+        </vbox>
+      </hbox>
+    </groupbox>
+  </prefpane>
+</overlay>

File chrome/content/prefs-headers.xul

 <!DOCTYPE window SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
 <overlay id="modifyheaders-headers-overlay"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <prefpane id="paneHeaders" label="Headers">
+  
+  <prefpane id="paneHeaders" label="&modifyheaders.label.headers;">
     <preferences/>
-    
-  <vbox flex="1">
-    <hbox>
-      <spacer flex="1"/>
-      <button label="&modifyheaders.help.button;" command="openHelp" flex="0"/>
-    </hbox>
+
     <vbox flex="1">
-      <groupbox>
-        <hbox>
-          <menulist id="action-menulist" tooltiptext="&modifyheaders.dialog.header.tooltip.action;">
-            <menupopup onpopuphidden="ModifyHeaders.actionSelected()">
-              <menuitem label="" value=""/>
-              <menuitem label="&modifyheaders.dialog.header.action.add;" value="&modifyheaders.dialog.header.action.add;"/>   
-              <menuitem label="&modifyheaders.dialog.header.action.addbefore;" value="&modifyheaders.dialog.header.action.addbefore;"/>
-              <menuitem label="&modifyheaders.dialog.header.action.addafter;" value="&modifyheaders.dialog.header.action.addafter;"/>
-              <menuitem label="&modifyheaders.dialog.header.action.modify;" value="&modifyheaders.dialog.header.action.modify;"/>	      
-              <menuitem label="&modifyheaders.dialog.header.action.filter;" value="&modifyheaders.dialog.header.action.filter;"/>            
-	        </menupopup>
-    	  </menulist>
-          <textbox id="headername-text-box" flex="1" disabled="true" tooltiptext="&modifyheaders.dialog.header.tooltip.name;"/>
-          <textbox id="headervalue-text-box" flex="1" disabled="true" tooltiptext="&modifyheaders.dialog.header.tooltip.value;"/>
-          <textbox id="headercomment-text-box" flex="1" disabled="true" tooltiptext="&modifyheaders.dialog.header.tooltip.comment;"/>
-          <button id="add-header-button" label="&modifyheaders.options.headers.add;" command="addHeader" flex="0" hidden="false" disabled="true"/>
-          <button id="save-header-button" label="&modifyheaders.options.headers.save;" command="saveHeader" flex="0" hidden="true"/>
-          <button id="reset-form-button" label="&modifyheaders.options.headers.reset;" command="resetHeaderForm" flex="0" hidden="false"/>
+      <vbox flex="1">
+        <groupbox>
+          <hbox>
+            <menulist id="action-menulist" tooltiptext="&modifyheaders.tooltip.action;">
+              <menupopup onpopuphidden="ModifyHeaders.actionSelected()">
+                <menuitem label="&modifyheaders.menuitem.action.select;" value="" />
+                <menuitem label="&modifyheaders.menuitem.action.addbefore;" value="&modifyheaders.menuitem.action.addbefore;"/>
+                <menuitem label="&modifyheaders.menuitem.action.addafter;" value="&modifyheaders.menuitem.action.addafter;"/>
+                <menuitem label="&modifyheaders.menuitem.action.add;" value="&modifyheaders.menuitem.action.add;" />
+                <menuitem label="&modifyheaders.menuitem.action.modify;" value="&modifyheaders.menuitem.action.modify;" />
+                <menuitem label="&modifyheaders.menuitem.action.filter;" value="&modifyheaders.menuitem.action.filter;" />
+              </menupopup>
+            </menulist>
+            <textbox id="headername-text-box" flex="1" disabled="true" placeholder="&modifyheaders.placeholder.name;" tooltiptext="&modifyheaders.tooltip.name;" type="autocomplete" autocompletesearch="modifyheaders-autocomplete" />
+            <textbox id="headervalue-text-box" flex="1" disabled="true" placeholder="&modifyheaders.placeholder.value;" tooltiptext="&modifyheaders.tooltip.value;" />
+            <textbox id="headercomment-text-box" flex="1" disabled="true" placeholder="&modifyheaders.placeholder.comment;" tooltiptext="&modifyheaders.tooltip.comment;" />
+            <button id="add-header-button" label="&modifyheaders.button.headers.add;" command="addHeader" flex="0" hidden="false" disabled="true" />
+            <button id="save-header-button" label="&modifyheaders.button.headers.save;" command="saveHeader" flex="0" hidden="true" />
+            <button id="reset-form-button" label="&modifyheaders.button.headers.reset;" command="resetHeaderForm" flex="0" hidden="false" />
+          </hbox>
+        </groupbox>
+
+        <!-- List of headers that can be enabled/disabled -->
+        <hbox flex="1" xxonkeypress="ModifyHeaders.listKeyControl(event);">
+          <vbox flex="1">
+            <tree id="modifyheaders-tree" seltype="single" hidecolumnpicker="true" flex="1"
+                ondblclick="ModifyHeaders.enableHeader();"
+                ondragstart="ModifyHeaders.headerListTreeView.dragStart(event)">
+              <treecols>
+                <treecol id="actioncol" label="&modifyheaders.treecol.action;" fixed="true" ignoreincolumnpicker="true" />
+                <treecol id="namecol" label="&modifyheaders.treecol.name;" flex="1" persist="width" ignoreincolumnpicker="true" />
+                <splitter class="tree-splitter" />
+                <treecol id="valuecol" label="&modifyheaders.treecol.value;" flex="1" persist="width" ignoreincolumnpicker="true" />
+                <splitter class="tree-splitter" />
+                <treecol id="commentcol" label="&modifyheaders.treecol.comment;" flex="1" persist="width" ignoreincolumnpicker="true" />
+                <splitter class="tree-splitter" />
+                <treecol id="enabledcol" width="20" fixed="true" ignoreincolumnpicker="true" />
+                <!-- sbcol provides space for a scrollbar if one appears -->
+                <treecol id="sbcol" width="14" fixed="true" ignoreincolumnpicker="true" />
+              </treecols>
+              <treechildren flex="1" />
+            </tree>
+          </vbox>
+
+          <vbox>
+            <button label="&modifyheaders.button.edit;" command="editHeader" flex="0" />
+            <button label="&modifyheaders.button.delete;" command="deleteHeader" flex="0" />
+            <separator orient="horizontal" />
+            <button label="&modifyheaders.button.movetop;" command="moveRowTop" />
+            <button label="&modifyheaders.button.movebottom;" command="moveRowBottom" />
+            <separator orient="horizontal" />
+            <button label="&modifyheaders.button.enable;" command="enableHeader" flex="0" />
+            <button label="&modifyheaders.button.enableall;" command="enableAllHeaders" flex="0" />
+            <button label="&modifyheaders.button.disableall;" command="disableAllHeaders" flex="0" />
+            <separator orient="horizontal" />
+            <hbox>
+              <vbox>
+                <image src="chrome://modifyheaders/content/enabled.gif" />
+              </vbox>
+              <description flex="1" value="Enabled" />
+            </hbox>
+            <hbox>
+              <vbox>
+                <image src="chrome://modifyheaders/content/disabled.gif" />
+              </vbox>
+              <description value="Disabled" />
+            </hbox>
+            <spacer flex="1" />
+          </vbox>
         </hbox>
-      </groupbox>
-      
-      <!-- List of headers that can be enabled/disabled -->
-      <hbox flex="1" xxonkeypress="ModifyHeaders.listKeyControl(event);">
-        <vbox flex="1">
-          <tree id="modifyheaders-tree" seltype="single" hidecolumnpicker="true" flex="1" ondblclick="ModifyHeaders.enableHeader();">
-            <treecols>
-              <treecol id="actioncol" label="&modifyheaders.options.headers.action.label;" ignoreincolumnpicker="true"/>
-              <treecol id="namecol" label="&modifyheaders.options.headers.headername.label;" flex="1" sortActive="true" ignoreincolumnpicker="true"/>
-              <treecol id="valuecol" label="&modifyheaders.options.headers.headervalue.label;" flex="1" ignoreincolumnpicker="true"/>
-              <treecol id="commentcol" label="&modifyheaders.options.headers.headercomment.label;" flex="1" ignoreincolumnpicker="true"/>
-              <treecol id="enabledcol" width="20" ignoreincolumnpicker="true"/>
-              <!-- sbcol provides space for a scrollbar if one appears -->
-              <treecol id="sbcol" width="14" ignoreincolumnpicker="true"/>
-            </treecols>
-            <treechildren flex="1"/>
-          </tree>
-        </vbox>
-        
-        <vbox>
-          <button label="&modifyheaders.options.headers.edit;" command="editHeader" flex="0"/>
-          <button label="&modifyheaders.options.headers.delete;" command="deleteHeader" flex="0"/>
-          <separator orient="horizontal"/>
-          <button label="&modifyheaders.options.headers.move.up;" command="moveRowUp"/>
-          <button label="&modifyheaders.options.headers.move.down;" command="moveRowDown"/>
-          <separator orient="horizontal"/>
-          <button label="&modifyheaders.options.headers.enable;" command="enableHeader" flex="0"/>
-          <button label="&modifyheaders.options.headers.enable.all;" command="enableAllHeaders" flex="0"/>
-          <button label="&modifyheaders.options.headers.disable.all;" command="disableAllHeaders" flex="0"/>
-          <separator orient="horizontal"/>
-          <hbox>
-            <vbox>
-              <image src="chrome://modifyheaders/content/enabled.gif"/>
-            </vbox>
-            <description flex="1" value="Enabled"/>
-          </hbox>
-          <hbox>
-            <vbox>
-              <image src="chrome://modifyheaders/content/disabled.gif"/>
-            </vbox>
-            <description value="Disabled"/>
-          </hbox>
-          <spacer flex="1"/>
-        </vbox>
-      </hbox>
+      </vbox>
     </vbox>
-  </vbox>
   </prefpane>
-</overlay>
+</overlay>

File chrome/content/prefs-options.xul

 <?xml version="1.0"?>
 <!DOCTYPE page SYSTEM "chrome://modifyheaders/locale/modifyheaders.dtd">
-<overlay id="modifyheaders-headers-overlay"
+<overlay id="modifyheaders-options-overlay"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   
-  <prefpane id="paneOptions" label="Options">
+  <prefpane id="paneOptions" label="&modifyheaders.label.options;">
     <preferences>
       <preference id="always-on" name="modifyheaders.config.alwaysOn" type="bool" />
       <preference id="open-as-tab" name="modifyheaders.config.openNewTab" type="bool" />
     </preferences>
-    <stringbundleset>
-      <stringbundle id="stringResources"
-        src="chrome://modifyheaders/locale/modifyheaders.properties"/>
-    </stringbundleset>
 
-    <hbox>
-      <spacer flex="1"/>
-      <button label="&modifyheaders.help.button;" command="openHelp" flex="0"/>
-    </hbox>
     <groupbox>
-      <caption label="&modifyheaders.config.general.label;"/>
-      <checkbox id="modifyheaders-always-on" label="&modifyheaders.config.general.always.on;" preference="always-on" />
-      <checkbox id="modifyheaders-open-as-tab" label="&modifyheaders.config.general.open.in.tab;" preference="open-as-tab" />
+      <caption label="&modifyheaders.caption.options.general;"/>
+      <checkbox id="modifyheaders-always-on" label="&modifyheaders.label.options.alwayson;" preference="always-on" />
+      <checkbox id="modifyheaders-open-as-tab" label="&modifyheaders.label.options.openintab;" preference="open-as-tab" />
     </groupbox>
 
     <groupbox flex="1">
-      <caption label="&modifyheaders.config.import.export;"/>
+      <caption label="&modifyheaders.caption.options.export-import;"/>
       <hbox>
-        <button id="exportButton" label="Export Headers"
+        <button id="exportButton" label="&modifyheaders.button.export;"
           oncommand="ModifyHeaders.Preferences.openExportWizard()" />
-        <button id="importButton" label="Import Headers"
+        <button id="importButton" label="&modifyheaders.button.import;"
           oncommand="ModifyHeaders.Preferences.openImportWizard()" />
       </hbox>
     </groupbox>

File chrome/content/toolsOverlay.xul

 	<!-- Add a menu item to the 'tools' menu -->
 	<!-- Firefox / Flock -->
 	<menupopup id="menu_ToolsPopup">
-    	<menuitem id="menu_ToolsPopup_modifyheaders" insertbefore="sanitizeSeparator" label="&modifyheaders.menu.label;" oncommand="ModifyHeaders.open()" />
+    	<menuitem id="menu_ToolsPopup_modifyheaders" insertbefore="sanitizeSeparator" label="&modifyheaders.menuitem.tools.label;" oncommand="ModifyHeaders.open()" />
 	</menupopup>
   
   <!-- Firefox 4 App Menu -->
   <menupopup id="appmenu_webDeveloper_popup">
-      <menuitem id="appmenu_modifyheaders" insertafter="appmenu_pageSource" label="&modifyheaders.menu.label;" oncommand="ModifyHeaders.open()" />
+      <menuitem id="appmenu_modifyheaders" insertafter="appmenu_pageSource" label="&modifyheaders.menuitem.tools.label;" oncommand="ModifyHeaders.open()" />
   </menupopup>
 
-    <!-- Mozilla Suite / Seamonkey -->
-	<menupopup id="taskPopup">
-    	<menuitem id="taskPopup_modifyheaders" label="&modifyheaders.menu.label;" oncommand="ModifyHeaders.open()" />
+  <!-- Seamonkey 2.0 -->
+	<menupopup id="toolsPopup">
+    	<menuitem id="toolsPopup_modifyheaders" label="&modifyheaders.menuitem.tools.label;" oncommand="ModifyHeaders.open()" />
 	</menupopup>
 </overlay>

File chrome/locale/en-US/help/about.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>About Modify Headers</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-	    <h3>About Modify Headers</h3>
-	    
-	    <table>
-	        <tr>
-	            <td class="label">Created by:</td>
-	            <td>Gareth Hunt</td>
-	        </tr>
-	        <tr>
-	            <td class="label">Version:</td>
-	            <td>0.6.9</td>
-	        </tr>
-	        <tr>
-	            <td class="label">Homepage:</td>
-	            <td><a href="http://modifyheaders.mozdev.org" target="_blank">http://modifyheaders.mozdev.org</a></td>
-	        </tr>
-            <tr>
-                <td class="label">Bugzilla:</td>
-                <td><a href="http://modifyheaders.mozdev.org/bugs.html" target="_blank">http://modifyheaders.mozdev.org/bugs.html</a></td>
-            </tr>
-            <tr>
-                <td class="label">Blog:</td>
-                <td><a href="http://www.garethhunt.com/" target="_blank">http://www.garethhunt.com/</a></td>
-            </tr>
-	    </table>
-        
-        <p>Many thanks goes to these <a href="chrome://modifyheaders/locale/help/contributors.xhtml">contributors</a>.</p>
-	    
-        <h3>Release Notes</h3>
-        
-        <h4>Version 0.6.0</h4>
-        <ul>
-            <li>Added Import/Export function</li>
-            <li>Usability improvements</li>
-        </ul>
-        
-        <h4>Version 0.5.4</h4>
-        <ul>
-            <li>Fixed <i>Edit Header</i> feature so that the <b>Add, Modify, Filter</b> menulist is changed to the correct value when the <i>Edit</i> button is pressed.</li>
-        </ul>
-        
-        <h4>Version 0.5.3</h4>
-        <ul>
-            <li>Added support for Firefox 2 (full release)</li>
-        </ul>
-        
-        <h4>Version 0.5.2</h4>
-        <ul>
-            <li>Added support for Firefox 2 (beta 2), Flock, Nvu and Seamonkey</li>
-            <li>Added debug preference - accessible through about:config</li>
-            <li>Added list of contributors</li>
-        </ul>
-        
-        <h4>Version 0.5.1</h4>
-        <ul>
-            <li>Debug mode was left on by accident in 0.5.0.  Turned this off to stop verbose messages.</li>
-        </ul>
-	    
-	    <h4>Version 0.5.0</h4>
-	    <ul>
-            <li>Implemented Modify Headers service so that requests can be modified when the extension window is closed.</li>
-	    	<li>Added 'Always On' preference to the configuration window.</li>
-	    	<li>Updated help function to include release notes and roadmap.</li>
-	    	<li>Provided compatibility with Firefox v1.5 rc 1.</li>
-	    </ul>
-	    
-		<h4>Version 0.3.1</h4>
-		<ul>
-			<li>Small tweaks to make the extension suitable for update.mozilla.org.</li>
-		</ul>
-		
-		<h4>Version 0.3.0</h4>
-		<ul>
-			<li>Added help function in separate tab, includes link to bugzilla.</li>
-			<li>Fixed bug 9910: scroll bar masks enable/disable indicators.</li>
-			<li>Fixed bug 9911: enable all/disable all.</li>
-		</ul>
-	</body>
-</html>

File chrome/locale/en-US/help/adding.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Modifyheaders Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-		<h3>Adding Headers</h3>
-		
-		<p>If the <b>Add</b> option is selected, this will add a value to the selected header name.  If the header does not
-		exist by default, it will be created. It will not override the current value of the header.  This option is suitable where
-		headers can contain more than one value, eg:</p>
-		
-		<ul>
-			<li>Accept</li>
-			<li>Accept-Encoding</li>
-			<li>Cache-Control</li>
-			<li>Cookies</li>
-		</ul>
-		
-		<p>It is not suitable for headers where multiple values are not permitted, eg User-Agent.</p>
-	</body>
-</html>

File chrome/locale/en-US/help/configuration.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Configuration - Modify Headers Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-		<h3>Configuration Options</h3>
-		
-		<p>There are two configuration options available:</p>
-		
-		<p><img alt="Configuration Options" src="chrome://modifyheaders/locale/help/images/configuration.jpg" /></p>
-		
-		<table>
-			<tr>
-				<td valign="top"><b>Always On</b></td>
-				<td valign="top">If this option is checked, headers will be modified even if the administration window is closed.</td>
-			</tr>
-			<tr>
-				<td valign="top"><b>Open Modifyheaders in a new tab</b></td>
-				<td valign="top">When this options is checked, the Modify Headers administration interface will open in a new tab.  When unchecked,
-				the administration interface will open in a new window.</td>
-			</tr>
-		</table>
-	</body>
-</html>

File chrome/locale/en-US/help/contributors.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>Modify Headers Contributors</title>
-        <link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-    </head>
-    <body>
-        <h3>Contributors</h3>
-        
-        <p>Thanks you to those people who have contributed <a href="http://modifyheaders.mozdev.org/bugs.html" target="_blank">code</a>,
-        <a href="http://modifyheaders.mozdev.org/bugs.html" target="_blank">suggestions</a> or kindly <a href="chrome://modifyheaders/locale/help/donate.xhtml">donated</a>:</p>
-        
-        <ul>
-            <li>James Abley</li>
-            <li>Krist van Besien</li>
-            <li>Jeff Ullmann</li>
-            <li>Galen Wright-Watson</li>
-        </ul>
-    </body>
-</html>

File chrome/locale/en-US/help/credits.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Modifyheaders Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-		<h3>Credits</h3>
-		
-		<p>Modifyheaders is created by Gareth Hunt</p>
-	</body>
-</html>

File chrome/locale/en-US/help/donate.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Donate to Modify Headers</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-	    <h3>Donate to Modify Headers</h3>
-	    
-        <p>Modify Headers is developed in my free time.  If you use and appreciate the extension, please consider donating.</p>
-        
-        <p>All donations will be gratefully received and you can choose to have your name immortalised on the <a href="chrome://modifyheaders/locale/help/contributors.xhtml">Contributors</a> page.</p>
-        
-        <p>Thanks,<br/>
-        Gareth</p>
-        
-        <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
-            <input type="hidden" name="cmd" value="_s-xclick"/>
-            <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
-            <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHdwYJKoZIhvcNAQcEoIIHaDCCB2QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBnG+ePxNM3t8m+NzRWWMaRJBLqAXS4FYGTielsnEw7oSeFd2BZEapX6nLdTAKiYWmW0QE3apd/FfeV1BDkDgoYDhBiZhqZpJctcHaLyaKATi/nhqUxEnX70B/h1OjQohyAVBMHxS4k2jI9BmSOiH5TqkLc4kDtA2g/haElwxkzkTELMAkGBSsOAwIaBQAwgfQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIL4qTj3UpT1yAgdBSkY8jCaborHmiZBEO5488NtE6BpAdwpSNDY7j6D1ne4E1AJvHPYR0VBw28l8246zF+LQKiQ932u+GjA+FigWMrVrYOfanTnAz19tj9mzkLiqie/yRKtlgZigyUgMapvUSTmmu2Me0rMeMtW2iNCsl2PVrsWj/99BS4O2DSlpa0SwPRbW1AlrCB3NnstrImOwHaSYFQ1F8Jz0KvxN4Hs5UqMwi5Sx1k+oWOt9UowqrjBeQ+JGtOjc8WuDNQuOAdeNinrgjI4XEvQMyI6+0XKtGoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDYwMjE4MTI1NjQ1WjAjBgkqhkiG9w0BCQQxFgQU+G53Fk6gmIEbF+qp3ZhBXDISAA4wDQYJKoZIhvcNAQEBBQAEgYA5zPw06xp85IYnODg2CGKvMkGnss7qhkrzL1Tr9L2ey1zb6yTu05o5/Cs8SvFZVjA0j44jIJ8JZVH7T4hgerhgx6iv8/J1mKIgMhp0UNt+bVRYv0y/WwXtkSVdHaRh5Tkef8DCsRDxD7cseu/AhDOz1Tujr+Kzz9DORhy1I9ytCg==-----END PKCS7-----"/>
-        </form>
-	</body>
-</html>

File chrome/locale/en-US/help/filtering.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Modifyheaders Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-		<h3>Filtering Headers</h3>
-		
-		<p>The <b>Filter</b> action removes the specified header from the request.  It is really only useful for removing
-		standard headers sent by the browser.  Typically, this can be used for removing:</p>
-		
-		<ul>
-			<li>Cookie</li>
-		</ul>
-		
-		<p>Note that the header name only be specified, no value is required.</p>
-	</body>
-</html>

File chrome/locale/en-US/help/images/configuration.jpg

Removed
Old image

File chrome/locale/en-US/help/images/header-list.jpg

Removed
Old image

File chrome/locale/en-US/help/images/menu.jpg

Removed
Old image

File chrome/locale/en-US/help/images/quickstart.jpg

Removed
Old image

File chrome/locale/en-US/help/index.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Modifyheaders Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
-	</head>
-	<body>
-		<h3>Modify Headers Help</h3>
-		
-		<h4>Introduction</h4>
-		
-		<p>This brief help document provides guidance on how to get the most out of the Modify Headers extension.</p>
-        
-		<p>If you have any feedback about the extension, please email the mailing list:
-		<a href="mailto:modifyheaders@mozdev.org">modifyheaders@mozdev.org</a>.</p>
-		
-		<p>Please post bugs and enhancement requests to <a class="helptopic" target="_blank" href="http://modifyheaders.mozdev.org/bugs.html">Bugzilla</a>.</p>
-	</body>
-</html>

File chrome/locale/en-US/help/modifying.xhtml

-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[
-    <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
-    %brandDTD;
-    <!ENTITY % platformDTD SYSTEM "chrome://help/locale/platformStrings.dtd" >
-    %platformDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-	<head>
-		<title>Modifyheaders Help</title>
-		<link rel="stylesheet" type="text/css" href="chrome://modifyheaders/content/modifyheadersHelp.css"/>
<