Remove all files and leave a forwarding address pointing at GitHub repo. default tip
authorBrian Warner <warner@mozilla.com>
Mon, 31 Jan 2011 10:33:56 -0800
changeset 1160 451cf82b04136a974ae13d0087c03564a93b0885
parent 1159 4edadd79c9b97761c27b5ca93bab5e2dd57b5cc1
push id476
push userbwarner@mozilla.com
push dateMon, 31 Jan 2011 18:34:12 +0000
Remove all files and leave a forwarding address pointing at GitHub repo. Too many people were tricked into believing that this stale labs/jetpack-sdk repo was still active. Please follow https://github.com/mozilla/addon-sdk instead, or the hg mirror at http://hg.mozilla.org/projects/addon-sdk .
README.txt
bin/activate
bin/activate.bat
bin/cfx
bin/cfx.bat
bin/deactivate.bat
bin/integration-scripts/buildbot-run-cfx-helper
bin/integration-scripts/integration-check
examples/reading-data/data/mom.png
examples/reading-data/data/sample.html
examples/reading-data/lib/main.js
examples/reading-data/package.json
examples/reading-data/tests/test-main.js
examples/reddit-panel/data/panel.js
examples/reddit-panel/lib/main.js
examples/reddit-panel/package.json
packages/addon-kit/README.md
packages/addon-kit/data/moz_favicon.ico
packages/addon-kit/data/test-page-worker.html
packages/addon-kit/data/test-page-worker.js
packages/addon-kit/data/test.html
packages/addon-kit/docs/clipboard.md
packages/addon-kit/docs/context-menu.md
packages/addon-kit/docs/notifications.md
packages/addon-kit/docs/page-mod.md
packages/addon-kit/docs/page-worker.md
packages/addon-kit/docs/panel.md
packages/addon-kit/docs/private-browsing.md
packages/addon-kit/docs/request.md
packages/addon-kit/docs/selection.md
packages/addon-kit/docs/simple-storage.md
packages/addon-kit/docs/tabs.md
packages/addon-kit/docs/widget.md
packages/addon-kit/docs/windows.md
packages/addon-kit/lib/clipboard.js
packages/addon-kit/lib/context-menu.js
packages/addon-kit/lib/notifications.js
packages/addon-kit/lib/page-mod.js
packages/addon-kit/lib/page-worker.js
packages/addon-kit/lib/panel.js
packages/addon-kit/lib/private-browsing.js
packages/addon-kit/lib/request.js
packages/addon-kit/lib/selection.js
packages/addon-kit/lib/simple-storage.js
packages/addon-kit/lib/tabs.js
packages/addon-kit/lib/widget.js
packages/addon-kit/lib/windows.js
packages/addon-kit/package.json
packages/addon-kit/tests/pagemod-test-helpers.js
packages/addon-kit/tests/test-clipboard.js
packages/addon-kit/tests/test-context-menu.html
packages/addon-kit/tests/test-context-menu.js
packages/addon-kit/tests/test-notifications.js
packages/addon-kit/tests/test-page-mod.js
packages/addon-kit/tests/test-page-worker.js
packages/addon-kit/tests/test-panel.js
packages/addon-kit/tests/test-private-browsing.js
packages/addon-kit/tests/test-request.js
packages/addon-kit/tests/test-selection.js
packages/addon-kit/tests/test-simple-storage.js
packages/addon-kit/tests/test-tabs.js
packages/addon-kit/tests/test-widget.js
packages/addon-kit/tests/test-windows.js
packages/api-utils/README.md
packages/api-utils/data/bootstrap-remote-process.js
packages/api-utils/data/test-content-symbiont.js
packages/api-utils/docs/api-utils.md
packages/api-utils/docs/app-strings.md
packages/api-utils/docs/byte-streams.md
packages/api-utils/docs/collection.md
packages/api-utils/docs/content.md
packages/api-utils/docs/content/loader.md
packages/api-utils/docs/content/symbiont.md
packages/api-utils/docs/content/worker.md
packages/api-utils/docs/cuddlefish.md
packages/api-utils/docs/errors.md
packages/api-utils/docs/es5.md
packages/api-utils/docs/events.md
packages/api-utils/docs/file.md
packages/api-utils/docs/hidden-frame.md
packages/api-utils/docs/list.md
packages/api-utils/docs/match-pattern.md
packages/api-utils/docs/memory.md
packages/api-utils/docs/observer-service.md
packages/api-utils/docs/plain-text-console.md
packages/api-utils/docs/preferences-service.md
packages/api-utils/docs/securable-module.md
packages/api-utils/docs/self.md
packages/api-utils/docs/tab-browser.md
packages/api-utils/docs/text-streams.md
packages/api-utils/docs/timer.md
packages/api-utils/docs/traceback.md
packages/api-utils/docs/traits.md
packages/api-utils/docs/unit-test.md
packages/api-utils/docs/unload.md
packages/api-utils/docs/url.md
packages/api-utils/docs/window-utils.md
packages/api-utils/docs/xhr.md
packages/api-utils/docs/xpcom.md
packages/api-utils/docs/xul-app.md
packages/api-utils/lib/api-utils.js
packages/api-utils/lib/app-strings.js
packages/api-utils/lib/byte-streams.js
packages/api-utils/lib/collection.js
packages/api-utils/lib/content.js
packages/api-utils/lib/content/loader.js
packages/api-utils/lib/content/symbiont.js
packages/api-utils/lib/content/worker.js
packages/api-utils/lib/cuddlefish.js
packages/api-utils/lib/e10s.js
packages/api-utils/lib/errors.js
packages/api-utils/lib/es5.js
packages/api-utils/lib/events.js
packages/api-utils/lib/file.js
packages/api-utils/lib/find-tests-e10s-adapter.js
packages/api-utils/lib/find-tests.js
packages/api-utils/lib/hidden-frame.js
packages/api-utils/lib/list.js
packages/api-utils/lib/match-pattern.js
packages/api-utils/lib/memory.js
packages/api-utils/lib/observer-service.js
packages/api-utils/lib/plain-text-console.js
packages/api-utils/lib/preferences-service.js
packages/api-utils/lib/securable-module.js
packages/api-utils/lib/self-e10s-adapter.js
packages/api-utils/lib/self.js
packages/api-utils/lib/tab-browser.js
packages/api-utils/lib/tabs/events.js
packages/api-utils/lib/tabs/tab.js
packages/api-utils/lib/text-streams.js
packages/api-utils/lib/timer-e10s-adapter.js
packages/api-utils/lib/timer.js
packages/api-utils/lib/traceback.js
packages/api-utils/lib/traits.js
packages/api-utils/lib/traits/core.js
packages/api-utils/lib/unit-test-finder.js
packages/api-utils/lib/unit-test.js
packages/api-utils/lib/unload.js
packages/api-utils/lib/url.js
packages/api-utils/lib/utils/data.js
packages/api-utils/lib/utils/function.js
packages/api-utils/lib/utils/registry.js
packages/api-utils/lib/utils/thumbnail.js
packages/api-utils/lib/window-utils.js
packages/api-utils/lib/windows/dom.js
packages/api-utils/lib/windows/loader.js
packages/api-utils/lib/windows/tabs.js
packages/api-utils/lib/xhr.js
packages/api-utils/lib/xpcom.js
packages/api-utils/lib/xul-app.js
packages/api-utils/package.json
packages/api-utils/tests/e10s-samples/adapter-only-client.js
packages/api-utils/tests/e10s-samples/adapter-only-e10s-adapter.js
packages/api-utils/tests/e10s-samples/chrome-only-module-client.js
packages/api-utils/tests/e10s-samples/chrome-only-module.js
packages/api-utils/tests/e10s-samples/hello-world.js
packages/api-utils/tests/e10s-samples/superpower-client.js
packages/api-utils/tests/e10s-samples/superpower-e10s-adapter.js
packages/api-utils/tests/e10s-samples/superpower.js
packages/api-utils/tests/e10s-samples/syntax-error.js
packages/api-utils/tests/e10s-samples/thrown-exception.js
packages/api-utils/tests/fixtures/es5.js
packages/api-utils/tests/interoperablejs-read-only/README.txt
packages/api-utils/tests/interoperablejs-read-only/compliance/ORACLE
packages/api-utils/tests/interoperablejs-read-only/compliance/absolute/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/absolute/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/absolute/submodule/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/absolute/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/cyclic/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/cyclic/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/cyclic/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/cyclic/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/determinism/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/determinism/submodule/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/determinism/submodule/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/determinism/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/exactExports/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/exactExports/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/exactExports/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/exactExports/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/hasOwnProperty/hasOwnProperty.js
packages/api-utils/tests/interoperablejs-read-only/compliance/hasOwnProperty/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/hasOwnProperty/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/hasOwnProperty/toString.js
packages/api-utils/tests/interoperablejs-read-only/compliance/method/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/method/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/method/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/missing/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/missing/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/monkeys/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/monkeys/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/monkeys/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/monkeys/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/nested/a/b/c/d.js
packages/api-utils/tests/interoperablejs-read-only/compliance/nested/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/nested/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/reflexive/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/reflexive/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/reflexive/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/relative/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/relative/submodule/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/relative/submodule/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/relative/test.js
packages/api-utils/tests/interoperablejs-read-only/compliance/transitive/a.js
packages/api-utils/tests/interoperablejs-read-only/compliance/transitive/b.js
packages/api-utils/tests/interoperablejs-read-only/compliance/transitive/c.js
packages/api-utils/tests/interoperablejs-read-only/compliance/transitive/program.js
packages/api-utils/tests/interoperablejs-read-only/compliance/transitive/test.js
packages/api-utils/tests/test-api-utils.js
packages/api-utils/tests/test-app-strings.js
packages/api-utils/tests/test-byte-streams.js
packages/api-utils/tests/test-collection.js
packages/api-utils/tests/test-content-loader.js
packages/api-utils/tests/test-content-symbiont.js
packages/api-utils/tests/test-content-worker.js
packages/api-utils/tests/test-cuddlefish.js
packages/api-utils/tests/test-e10s-porting.js
packages/api-utils/tests/test-e10s.js
packages/api-utils/tests/test-errors.js
packages/api-utils/tests/test-es5.js
packages/api-utils/tests/test-events.js
packages/api-utils/tests/test-file.js
packages/api-utils/tests/test-function-utils.js
packages/api-utils/tests/test-globals.js
packages/api-utils/tests/test-hidden-frame.js
packages/api-utils/tests/test-list.js
packages/api-utils/tests/test-manifest.js
packages/api-utils/tests/test-match-pattern.js
packages/api-utils/tests/test-memory.js
packages/api-utils/tests/test-observer-service.js
packages/api-utils/tests/test-plain-text-console.js
packages/api-utils/tests/test-preferences-service.js
packages/api-utils/tests/test-registry.js
packages/api-utils/tests/test-securable-module.js
packages/api-utils/tests/test-self.js
packages/api-utils/tests/test-tab-browser.js
packages/api-utils/tests/test-text-streams.js
packages/api-utils/tests/test-timer.js
packages/api-utils/tests/test-traceback.js
packages/api-utils/tests/test-traits-core.js
packages/api-utils/tests/test-traits.js
packages/api-utils/tests/test-unit-test.js
packages/api-utils/tests/test-unload.js
packages/api-utils/tests/test-url.js
packages/api-utils/tests/test-window-loader.js
packages/api-utils/tests/test-window-utils.js
packages/api-utils/tests/test-xhr.js
packages/api-utils/tests/test-xpcom.js
packages/api-utils/tests/test-xul-app.js
packages/development-mode/README.md
packages/development-mode/docs/bootstrap.md
packages/development-mode/docs/main.md
packages/development-mode/lib/bootstrap.js
packages/development-mode/lib/main.js
packages/development-mode/package.json
packages/test-harness/README.md
packages/test-harness/data/sample.txt
packages/test-harness/docs/harness.md
packages/test-harness/docs/run-tests.md
packages/test-harness/lib/harness.js
packages/test-harness/lib/run-tests.js
packages/test-harness/package.json
packages/test-harness/tests/test-packaging.js
packages/test-harness/tests/test-self.js
python-lib/cuddlefish/Test App.app/Contents/Info.plist
python-lib/cuddlefish/Test App.app/Contents/MacOS/xulrunner
python-lib/cuddlefish/Test App.app/Contents/Resources
python-lib/cuddlefish/__init__.py
python-lib/cuddlefish/apiparser.py
python-lib/cuddlefish/app-extension/application.ini
python-lib/cuddlefish/app-extension/bootstrap.js
python-lib/cuddlefish/app-extension/components/harness.js
python-lib/cuddlefish/app-extension/defaults/preferences/prefs.js
python-lib/cuddlefish/app-extension/install.rdf
python-lib/cuddlefish/bunch.py
python-lib/cuddlefish/manifest.py
python-lib/cuddlefish/packaging.py
python-lib/cuddlefish/preflight.py
python-lib/cuddlefish/prefs.py
python-lib/cuddlefish/rdf.py
python-lib/cuddlefish/runner.py
python-lib/cuddlefish/server.py
python-lib/cuddlefish/templates.py
python-lib/cuddlefish/tests/__init__.py
python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon.png
python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/lib/main.js
python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/package.json
python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon.png
python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/lib/main.js
python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/package.json
python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/lib/main.js
python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/package.json
python-lib/cuddlefish/tests/bug-588661-files/packages/bar/lib/bar-loader.js
python-lib/cuddlefish/tests/bug-588661-files/packages/bar/package.json
python-lib/cuddlefish/tests/bug-588661-files/packages/foo/lib/foo-loader.js
python-lib/cuddlefish/tests/bug-588661-files/packages/foo/package.json
python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar-e10s-adapter.js
python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar.js
python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/foo.js
python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/package.json
python-lib/cuddlefish/tests/static-files/docs/APIsample.md
python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/main.js
python-lib/cuddlefish/tests/static-files/packages/aardvark/package.json
python-lib/cuddlefish/tests/static-files/packages/api-utils/lib/loader.js
python-lib/cuddlefish/tests/static-files/packages/api-utils/package.json
python-lib/cuddlefish/tests/static-files/packages/barbeque/lib/bar-module.js
python-lib/cuddlefish/tests/static-files/packages/barbeque/package.json
python-lib/cuddlefish/tests/static-files/xpi-template/components/harness.js
python-lib/cuddlefish/tests/test_apiparser.py
python-lib/cuddlefish/tests/test_init.py
python-lib/cuddlefish/tests/test_manifest.py
python-lib/cuddlefish/tests/test_packaging.py
python-lib/cuddlefish/tests/test_preflight.py
python-lib/cuddlefish/tests/test_rdf.py
python-lib/cuddlefish/tests/test_runner.py
python-lib/cuddlefish/tests/test_server.py
python-lib/cuddlefish/tests/test_xpi.py
python-lib/cuddlefish/version_comparator.py
python-lib/cuddlefish/xpi.py
python-lib/ecdsa/LICENSE
python-lib/ecdsa/__init__.py
python-lib/ecdsa/curves.py
python-lib/ecdsa/der.py
python-lib/ecdsa/ecdsa.py
python-lib/ecdsa/ellipticcurve.py
python-lib/ecdsa/keys.py
python-lib/ecdsa/numbertheory.py
python-lib/ecdsa/test_pyecdsa.py
python-lib/ecdsa/util.py
python-lib/jetpack_sdk_env.py
python-lib/mozrunner/__init__.py
python-lib/mozrunner/killableprocess.py
python-lib/mozrunner/qijo.py
python-lib/mozrunner/winprocess.py
python-lib/mozrunner/wpk.py
python-lib/simplejson/__init__.py
python-lib/simplejson/decoder.py
python-lib/simplejson/encoder.py
python-lib/simplejson/scanner.py
python-lib/simplejson/tool.py
static-files/css/apidocs.css
static-files/css/base.css
static-files/index.html
static-files/js/jquery.js
static-files/js/main.js
static-files/js/render.js
static-files/js/renderapi.js
static-files/js/showdown.js
static-files/md/dev-guide/best-practices.md
static-files/md/dev-guide/cfx-tool.md
static-files/md/dev-guide/chrome.md
static-files/md/dev-guide/credits.md
static-files/md/dev-guide/events.md
static-files/md/dev-guide/getting-started.md
static-files/md/dev-guide/globals.md
static-files/md/dev-guide/glossary.md
static-files/md/dev-guide/internal-globals.md
static-files/md/dev-guide/package-spec.md
static-files/md/dev-guide/packaging.md
static-files/md/dev-guide/program-id.md
static-files/md/dev-guide/programs.md
static-files/md/dev-guide/troubleshooting.md
static-files/md/dev-guide/web-content.md
static-files/md/dev-guide/xpi.md
static-files/md/dev-guide/xul-extensions.md
static-files/media/content-scripting-overview.jpg
static-files/media/multiple-workers.jpg
--- a/README.txt
+++ b/README.txt
@@ -1,30 +1,13 @@
-Add-on SDK README
-==================
-
-Before proceeding, please make sure you've installed Python 2.5
-or 2.6 if it's not already on your system:
-
-  http://python.org/download/
-
-Note that Python 3.0 and 3.1 are not supported in this release.
-
-For Windows users, MozillaBuild (https://wiki.mozilla.org/MozillaBuild)
-will install the correct version of Python and the MSYS package, which
-will make it easier to work with the SDK.
-
-To get started, first enter the same directory that this file is
-in using a shell program. On Unix systems or on Windows with MSYS,
-you can execute the following command:
-
-  source bin/activate
-
-Windows users using cmd.exe should instead run:
-
-  bin\activate.bat
-
-Then run:
-
-  cfx docs
-
-This should start a documentation server and open a web browser
-with further instructions.
+The Add-On SDK has moved!
+
+The new home of the Add-On SDK's source code repository is on GitHub:
+
+  https://github.com/mozilla/addon-sdk/
+
+
+Mercurial users can pull from a mirror hosted at:
+
+ http://hg.mozilla.org/projects/addon-sdk
+
+(note that the new hg mirror does not share history with the old
+labs/jetpack-sdk repo: you will need to do a new 'hg clone').
deleted file mode 100644
--- a/bin/activate
+++ /dev/null
@@ -1,82 +0,0 @@
-# This file must be used with "source bin/activate" *from bash*
-# you cannot run it directly
-
-deactivate () {
-    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
-        PATH="$_OLD_VIRTUAL_PATH"
-        export PATH
-        unset _OLD_VIRTUAL_PATH
-    fi
-
-    # This should detect bash and zsh, which have a hash command that must
-    # be called to get it to forget past commands.  Without forgetting
-    # past commands the $PATH changes we made may not be respected
-    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
-        hash -r
-    fi
-
-    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
-        PS1="$_OLD_VIRTUAL_PS1"
-        export PS1
-        unset _OLD_VIRTUAL_PS1
-    fi
-
-    if [ -n "$_OLD_PYTHONPATH" ] ; then
-        PYTHONPATH="$_OLD_PYTHONPATH"
-        export PYTHONPATH
-        unset _OLD_PYTHONPATH
-    fi
-
-    unset CUDDLEFISH_ROOT
-
-    unset VIRTUAL_ENV
-    if [ ! "$1" = "nondestructive" ] ; then
-    # Self destruct!
-        unset deactivate
-    fi
-}
-
-# unset irrelavent variables
-deactivate nondestructive
-
-_OLD_PYTHONPATH="$PYTHONPATH"
-_OLD_VIRTUAL_PATH="$PATH"
-
-VIRTUAL_ENV="`pwd`"
-
-if [ "x$OSTYPE" = "xmsys" ] ; then
-  CUDDLEFISH_ROOT="`pwd -W | sed s,/,\\\\\\\\,g`"
-  PATH="`pwd`/bin:$PATH"
-  # msys will convert any env vars with PATH in it to use msys
-  # form and will unconvert before launching
-  PYTHONPATH="`pwd -W`/python-lib;$PYTHONPATH"
-else
-  CUDDLEFISH_ROOT="$VIRTUAL_ENV"
-  PYTHONPATH="$VIRTUAL_ENV/python-lib:$PYTHONPATH"
-  PATH="$VIRTUAL_ENV/bin:$PATH"
-fi
-
-VIRTUAL_ENV="`pwd`"
-
-export CUDDLEFISH_ROOT
-export PYTHONPATH
-export PATH
-
-_OLD_VIRTUAL_PS1="$PS1"
-if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
-    # special case for Aspen magic directories
-    # see http://www.zetadev.com/software/aspen/
-    PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
-else
-    PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
-fi
-export PS1
-
-# This should detect bash and zsh, which have a hash command that must
-# be called to get it to forget past commands.  Without forgetting
-# past commands the $PATH changes we made may not be respected
-if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
-    hash -r
-fi
-
-python -c "from jetpack_sdk_env import welcome; welcome()"
deleted file mode 100644
--- a/bin/activate.bat
+++ /dev/null
@@ -1,82 +0,0 @@
-@echo off
-set VIRTUAL_ENV=%CD%
-set CUDDLEFISH_ROOT=%VIRTUAL_ENV%
-
-SET WINCURVERKEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
-REG QUERY "%WINCURVERKEY%" /v "ProgramFilesDir (x86)" >nul 2>nul
-if %ERRORLEVEL% EQU 0 (
-  SET WIN64=1
-) else (
-  SET WIN64=0
-)
-
-if "%WIN64%" EQU "1" (
-  SET PYTHONKEY=HKLM\SOFTWARE\Wow6432Node\Python\PythonCore
-) else (
-  SET PYTHONKEY=HKLM\SOFTWARE\Python\PythonCore
-)
-
-SET PYTHONVERSION=
-SET PYTHONINSTALL=
-
-if "%PYTHONVERSION%" EQU "" (
-  REG QUERY "%PYTHONKEY%\2.6\InstallPath" /ve >nul 2>nul
-  if %ERRORLEVEL% EQU 0 (
-    SET PYTHONVERSION=2.6
-  )
-)
-
-if "%PYTHONVERSION%" EQU "" (
-  REG QUERY "%PYTHONKEY%\2.5\InstallPath" /ve >nul 2>nul
-  if %ERRORLEVEL% EQU 0 (
-    SET PYTHONVERSION=2.5
-  )
-)
-
-if "%PYTHONVERSION%" EQU "" (
-  REG QUERY "%PYTHONKEY%\2.4\InstallPath" /ve >nul 2>nul
-  if %ERRORLEVEL% EQU 0 (
-    SET PYTHONVERSION=2.4
-  )
-)
-
-if "%PYTHONVERSION%" NEQ "" (
-  FOR /F "tokens=3* skip=1 delims=	 " %%A IN ('REG QUERY "%PYTHONKEY%\%PYTHONVERSION%\InstallPath" /ve') DO SET "PYTHONINSTALL=%%A"
-)
-
-if "%PYTHONINSTALL%" NEQ "" (
-  SET "PATH=%PATH%;%PYTHONINSTALL%"
-)
-
-if defined _OLD_PYTHONPATH (
-    set PYTHONPATH=%_OLD_PYTHONPATH%
-)
-if not defined PYTHONPATH (
-    set PYTHONPATH=;
-)
-set _OLD_PYTHONPATH=%PYTHONPATH%
-set PYTHONPATH=%VIRTUAL_ENV%\python-lib;%PYTHONPATH%
-
-if not defined PROMPT (
-    set PROMPT=$P$G
-)
-
-if defined _OLD_VIRTUAL_PROMPT (
-    set PROMPT=%_OLD_VIRTUAL_PROMPT%
-)
-
-set _OLD_VIRTUAL_PROMPT=%PROMPT%
-set PROMPT=(%VIRTUAL_ENV%) %PROMPT%
-
-if defined _OLD_VIRTUAL_PATH (
-    set PATH=%_OLD_VIRTUAL_PATH%
-    goto SKIPPATH
-)
-set _OLD_VIRTUAL_PATH=%PATH%
-
-:SKIPPATH
-set PATH=%VIRTUAL_ENV%\bin;%PATH%
-
-python -c "from jetpack_sdk_env import welcome; welcome()"
-
-:END
deleted file mode 100755
--- a/bin/cfx
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /usr/bin/env python
-
-import os
-import sys
-
-# set the cuddlefish "root directory" for this process if it's not already
-# set in the environment
-cuddlefish_root = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
-
-if 'CUDDLEFISH_ROOT' not in os.environ:
-    os.environ['CUDDLEFISH_ROOT'] = cuddlefish_root
-
-# add our own python-lib path to the python module search path.
-python_lib_dir = os.path.join(cuddlefish_root, "python-lib")
-if python_lib_dir not in sys.path:
-    sys.path.append(python_lib_dir)
-
-# now export to env so sub-processes get it too
-if 'PYTHONPATH' not in os.environ:
-    os.environ['PYTHONPATH'] = python_lib_dir
-elif python_lib_dir not in os.environ['PYTHONPATH'].split(os.pathsep):
-    paths = os.environ['PYTHONPATH'].split(os.pathsep)
-    paths.insert(0, python_lib_dir)
-    os.environ['PYTHONPATH'] = os.pathsep.join(paths)
-
-import cuddlefish
-
-if __name__ == '__main__':
-    cuddlefish.run()
deleted file mode 100644
--- a/bin/cfx.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-
-python "%VIRTUAL_ENV%\bin\cfx" %1 %2 %3 %4 %5 %6 %7 %8 %9
deleted file mode 100644
--- a/bin/deactivate.bat
+++ /dev/null
@@ -1,20 +0,0 @@
-@echo off
-
-if defined _OLD_VIRTUAL_PROMPT (
-    set PROMPT=%_OLD_VIRTUAL_PROMPT%
-)
-set _OLD_VIRTUAL_PROMPT=
-
-if defined _OLD_VIRTUAL_PATH (
-    set PATH=%_OLD_VIRTUAL_PATH%
-)
-set _OLD_VIRTUAL_PATH=
-
-if defined _OLD_PYTHONPATH (
-    set PYTHONPATH=%_OLD_PYTHONPATH%
-)
-set _OLD_PYTHONPATH=
-
-set CUDDLEFISH_ROOT=
-
-:END
deleted file mode 100755
--- a/bin/integration-scripts/buildbot-run-cfx-helper
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-source ./bin/activate
-if [ type -P xvfb-run ]
-then
-  xvfb-run cfx $*
-else
-  cfx $*
-fi  
-deactivate
deleted file mode 100755
--- a/bin/integration-scripts/integration-check
+++ /dev/null
@@ -1,314 +0,0 @@
-#!/usr/bin/env python
-import os, signal, datetime, time, threading
-import urllib2
-import zipfile, tarfile
-import subprocess
-import stat
-import optparse
-import sys, re
-
-global fname
-global base_path, new_dir
-
-
-def define_parameters():
-  try:
-    #Take the current working directory
-    dir=subprocess.Popen('pwd', stdout=subprocess.PIPE, shell=True).communicate()
-    default_path=dir[0]
-    default_path.strip()
-    
-    # Setup command line parser
-    x=subprocess.Popen('cd ~; pwd', stdout=subprocess.PIPE, shell=True).communicate()
-    home=x[0]
-    home=home.strip()
-    
-    #The following are the parameters that can be used to pass a dynamic URL, a specific path or a binry. The binary is not used yet. It will be used in version 2.0
-    #If a dynamic path is to be mentioned, it should start with a '/'. For eg. "/Desktop"
-    parser = optparse.OptionParser()
-    parser.add_option('-u', '--url', dest = 'url', default='ftp://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/jetpack-sdk-latest.zip')
-    parser.add_option('-p', '--path', dest = 'path', default=default_path)
-    parser.add_option('-b', '--binary', dest = 'binary', default='/Applications/Firefox.app')
-    (options, args) = parser.parse_args()
-    
-    #Get the URL from the parameter
-    link=options.url
-    #Set the base path for the user. If the user supplies the path, use the home variable as well. Else, take the default path of this script as the installation directory.
-    global base_path
-    if options.path!=default_path:
-      base_path=home+str(options.path).strip()+'/'
-    else:
-      base_path=str(options.path).strip()+'/'
-    print('Your Base path is ='+base_path)
-    
-    bin=options.binary #This assignment is not used in this program. It will be used in version 2 of this script.
-    ###if app or bin is empty, dont pass anything
-    
-    #Search for the .zip file or tarball file in the URL.
-    i=link.rfind('/')
-    global fname
-    fname=link[i+1:]
-    m=re.search('zip',fname,re.I)
-    n=re.search('gz',fname,re.I)
-    if m:
-      print 'zip file present in the URL.'
-      global zip,gz
-      zip=True;
-      gz=False;
-    elif n:
-      print 'gz file present in the URL'
-      gz=True;
-      zip=False;
-    else:
-      print 'zip/gz file not present. Check the URL.'
-      return
-    print("File name is ="+fname)
-    
-    #Join the base path and the zip/tar file name to crate a complete Local file path.
-    fpath = base_path+fname
-    print('Your local file path will be='+fpath)
-    #zipfilepath='/Users/moco/Desktop/'+fname
-    zipfilepath=base_path
-    #extractiondir='/Users/moco/Desktop/'
-    extractiondir=fpath
-    
-    #Call the download function to download the SDK from the URL to the local machine.
-    download(link,fpath,zip)
-    
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-
-def download(url,fpath,zip):
-  try:
-    #Start the download
-    print("Downloading...Please be patient!")
-    file = urllib2.urlopen(url)
-    output = open(fpath,'w')
-    output.write(file.read())
-    print('Download was successful.')
-    output.close()
-    
-    #Call the extract function to start the extraction process.
-    extract(base_path,fname)
-    
-  except ValueError: #Handles broken URL errors.
-    print 'The URL is ether broken or the file does not exist. Please enter the correct URL.'
-  except urllib2.URLError, e: # Handles the FTP errors
-    print '\nFTP URL not correct. Check again!'
-  except urllib2.HTTPError, e: # Handles the HTTP errors
-    print '\nFile not found on the Server!'
-  except IOError as (errno, strerror): #Handles file errors
-    print "I/O error - Check the destination path: {1}".format(errno, strerror)
-  except KeyboardInterrupt:
-    print('You cancelled the operation.')
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-    
-#Function to extract the downloaded zipfile.
-def extract(zipfilepath, extfile):
-  try:
-    #Timeout is set to 15 seconds. 
-    timeout=15
-    #change the directory to the location of the zip file.
-    os.chdir(zipfilepath)
-    
-    #Code for getting the folder name of Jetpack along with the version number.
-    if zip:
-      #print 'inside zip'
-      f=zipfile.ZipFile(extfile)
-      list=f.namelist()[0]
-      print('File List= ' + list)
-      temp_name=list.split('/')
-      print('Folder Name= ' +temp_name[0])
-      folder_name=temp_name[0]
-    elif gz:
-      #print 'inside gz'
-      f=tarfile.open(extfile)
-      list=f.getnames()[0]
-      temp_name=list.split('/')
-      print('Folder Name= ' +temp_name[0])
-      folder_name=temp_name[0]
-      
-    print ('Starting to Extract...')
-    
-    #Timeout code. The subprocess.popen exeutes the command and the thread waits for a timeout. If the process does not finish within the mentioned-
-    #timeout, the process is killed.
-    kill_check = threading.Event()
-    def kill_process(pid):
-      print '\nProcess Timedout. Killing the process. Please Rerun.'
-      os.kill(pid, signal.SIGKILL)
-      kill_check.set() # tell the main routine to kill. Used SIGKILL to hard kill the process.
-      return
-    
-    if zip:
-    #Call the command to unzip the downloaded file.
-      p=subprocess.Popen('unzip '+extfile, stdout=subprocess.PIPE, shell=True)
-      pid = p.pid
-    elif gz:
-    #Call the command to untar the downloaded file.
-      p=subprocess.Popen('tar -xf '+extfile, stdout=subprocess.PIPE, shell=True)
-      pid = p.pid
-
-    #Set a watch to check for process completion.
-    watch = threading.Timer(timeout, kill_process, args=(pid, ))
-    watch.start()
-    (stdout, stderr) = p.communicate()
-    watch.cancel() # if it's still waiting to run
-    success = not kill_check.isSet()
-    
-    #Abort process if process fails.
-    if not success:
-      return
-    #print 'after printing success'
-    kill_check.clear()
-    print('Unzip Successful.')
-    #Call the function to run the cfx commands
-    run_cmd(base_path,folder_name)
-  except OSError as (errno, strerror):
-    print 'O/S Error({0}) - {1}'.format(errno,strerror)
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-
-#Function to run the cfx testall comands and to make sure the SDK is not broken.
-def run_cmd(home_path,folder_name):
-  try:
-    timeout=150
-    global new_dir
-    new_dir=home_path+folder_name
-    os.chdir(new_dir)
-    print '\nStarting tests...'
-    #Timeout code. The subprocess.popen exeutes the command and the thread waits for a timeout. If the process does not finish within the mentioned-
-    #timeout, the process is killed.
-    kill_check = threading.Event()
-    def kill_process(pid):
-      print '\nProcess Timedout. Killing the process. Please Rerun.'
-      os.kill(pid, signal.SIGKILL)
-      kill_check.set() # tell the main routine to kill. Used SIGKILL to hard kill the process.
-      return
-    
-    #Set the path for the logs. They will be in the parent directory of the Add-on SDK.
-    global base_path
-    log_path=base_path+'tests.log 2>&1'
-    #Subprocess call to set up the jetpack environment and to start the tests. Also sends the output to a log file.
-    p=subprocess.Popen('. bin/activate; cfx testall -a firefox> '+log_path, stdout=subprocess.PIPE, shell=True)
-    pid = p.pid
-    watch = threading.Timer(timeout, kill_process, args=(pid, ))
-    watch.start()
-    (stdout, stderr) = p.communicate()
-    watch.cancel() # if it's still waiting to run
-    success = not kill_check.isSet()
-    if not success:
-      return
-    kill_check.clear()
-    
-    if p.returncode!=0:
-        print('\nAll tests were not successful. Check the test-logs in the jetpack directory. Exiting the process.')
-        result_sdk()
-        return
-    else:
-        result_sdk()
-        print('\nAll tests were successful. Yay \o/ . Running a sample package test now...')
-    #Check the logs for any failure. 
-    #result_sdk(new_dir)
-    
-    #Call to check the tests for a sample xpi package.
-    package(new_dir)
-  
-  except OSError:
-    #will reach here if the jetpack 0.X directory doesnt exist
-    print 'O/S Error({0}) - {1}'.format(errno,strerror)
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-    
-def package(example_dir):
-  try:
-    timeout=20
-    
-    print '\nNow Running packaging tests...'
-    
-    kill_check = threading.Event()
-    def kill_process(pid):
-      print '\nProcess Timedout. Killing the process. Please Rerun.'
-      os.kill(pid, signal.SIGKILL)
-      kill_check.set() # tell the main routine to kill. Used SIGKILL to hard kill the process.
-      return
-    
-    #Set the path for the example logs. They will be in the parent directory of the Add-on SDK.
-    global base_path
-    exlog_path=base_path+'test-example.log 2>&1'
-    #Subprocess call to test the sample example for packaging.
-    p=subprocess.Popen('. bin/activate; cfx -p examples/reading-data run -a firefox; cfx -p examples/reading-data run -a firefox > '+exlog_path, stdout=subprocess.PIPE, shell=True)
-    pid = p.pid
-    watch= threading.Timer(timeout, kill_process, args=(pid, ))
-    watch.start()
-    (stdout, stderr) = p.communicate()
-    watch.cancel() # if it's still waiting to run
-    success = not kill_check.isSet()
-    if not success:
-      return
-    kill_check.clear()
-    #ret_code=subprocess.call('source bin/activate; cfx -p examples/reading-data run -a firefox; cfx -p examples/reading-data run -a firefox > test-example.log 2>&1', stdout=subprocess.PIPE, shell=True)
-    
-    #print p.returncode
-
-    if p.returncode!=0:
-        print('\nSample tests were not executed correctly. Check the test-example log in jetpack diretory. Exiting the process.')
-        result_example()
-        return
-    else:
-        print('\nAll tests pass. The SDK is working! Yay \o/')
-        result_example()
-        
-  except OSError as (errno, strerror):
-    print 'O/S Error({0}) - {1}'.format(errno,strerror)
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-    
-def result_sdk():
-  try:
-    global base_path
-    log_dir=base_path+'tests.log'
-    f=open(log_dir,'r')
-    
-    #Search for the words 'FAIL' or 'warning' in the log. If found, report them.
-    err=re.search('FAIL',f.read(),re.I)
-    warn=re.search('warning:',f.read(),re.I)
-    if err or warn:
-      for line in open(log_dir):
-        n=re.search('\d+ of \d+ tests passed',line,re.I)
-        if n:
-          print n.group()
-      print ('\nOverall result - ' + str(err.group()) + '. Look at the test log at '+log_dir)
-    #else:
-      #print 'All tests passed.'
-      
-  except IOError as (errno, strerror):
-    print "I/O error({0}): {1}".format(errno, strerror)
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-    
-def result_example():
-  try:
-    global base_path
-    exlog_dir=base_path+'test-example.log'
-    f=open(exlog_dir,'r')
-    m=re.search('FAIL',f.read(),re.I)
-    if m:
-      for line in open(exlog_dir):
-        n=re.search('OK',line,re.I)
-        if n:
-          print n.group()
-      print ('\nOverall result - ' + str(m.group()) + '. Look at the example log at '+exlog_dir)
-    #else:
-      #print 'All tests passed.'
-  except IOError as (errno, strerror):
-      print "I/O error({0}): {1}".format(errno, strerror)
-  except:
-    print "Unexpected error:", sys.exc_info()[0]
-  
-#if __name__ == "__main__":
-#  main()
-#try:
-define_parameters()
-#except:
-#    print "Unexpected error in the beginning:", sys.exc_info()[0]
deleted file mode 100644
index 4ba89a2c1ef900e9363746d45820f0b9e857e51f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/examples/reading-data/data/sample.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html><body>
-<h1>Hello World</h1>
-</body></html>
deleted file mode 100644
--- a/examples/reading-data/lib/main.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var self = require("self");
-var panels = require("panel");
-var widgets = require("widget");
-
-function replaceMom(html) {
-  return html.replace("World", "Mom");
-}
-exports.replaceMom = replaceMom;
-
-exports.main = function(options, callbacks) {
-  console.log("My ID is " + self.id);
-
-  // Load the sample HTML into a string.
-  var helloHTML = self.data.load("sample.html");
-
-  // Let's now modify it...
-  helloHTML = replaceMom(helloHTML);
-
-  // ... and then create a panel that displays it.
-  var myPanel = panels.Panel({
-    contentURL: "data:text/html," + helloHTML
-  });
-
-  // Load the URL of the sample image.
-  var iconURL = self.data.url("mom.png");
-
-  // Create a widget that displays the image.  We'll attach the panel to it.
-  // When you click the widget, the panel will pop up.
-  widgets.Widget({
-    label: "Mom",
-    contentURL: iconURL,
-    panel: myPanel
-  });
-
-  // If you run cfx with --static-args='{"quitWhenDone":true}' this program
-  // will automatically quit Firefox when it's done.
-  if (options.staticArgs.quitWhenDone)
-    callbacks.quit();
-}
deleted file mode 100644
--- a/examples/reading-data/package.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "name": "reading-data",
-    "description": "A demonstration of reading bundled data.",
-    "keywords": [],
-    "author": "Brian Warner",
-    "contributors": [],
-    "version": "1.0b1",
-    "license": "MPL 1.1/GPL 2.0/LGPL 2.1",
-    "id": "anonid0-reading-data"
-}
deleted file mode 100644
--- a/examples/reading-data/tests/test-main.js
+++ /dev/null
@@ -1,20 +0,0 @@
-const m = require("main");
-const self = require("self");
-
-exports.testReplace = function(test) {
-  const input = "Hello World";
-  const output = m.replaceMom(input);
-  test.assertEqual(output, "Hello Mom");
-  var callbacks = { quit: function() {} };
-
-  // Make sure it doesn't crash...
-  m.main({ staticArgs: {} }, callbacks);
-};
-
-exports.testID = function(test) {
-  // The ID is randomly generated during tests, so we cannot compare it against
-  // anything in particular.  Just assert that it is not empty.
-  test.assert(self.id.length > 0);
-  test.assertEqual(self.data.url("sample.html"),
-                   "resource://reading-data-reading-data-data/sample.html");
-};
deleted file mode 100644
--- a/examples/reddit-panel/data/panel.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// This is a content script.  It executes inside the context of the Reddit page
-// loaded into the panel and has access to that page's window object and other
-// global objects (although the page does not have access to globals defined by
-// this script unless they are explicitly attached to the window object).
-//
-// This content script is injected into the context of the Reddit page
-// by the Panel API, which is accessed by the main add-on script in lib/main.js.
-// See that script for more information about how the panel is created.
-
-window.addEventListener("click", function(event) {
-  var t = event.target;
-
-  // Don't intercept the click if it isn't on a link.
-  if (t.nodeName != "A")
-    return;
-
-  // Don't intercept the click if it was on one of the links in the header
-  // or next/previous footer, since those links should load in the panel itself.
-  var x = t.parentNode;
-  while (x && x.getAttribute) {
-    if (x.getAttribute("id") == "header" ||
-        x.getAttribute("class") == "nextprev")
-      return;
-    x = x.parentNode;
-  }
-
-  // Intercept the click, passing it to the addon, which will load it in a tab.
-  event.stopPropagation();
-  event.preventDefault();
-  postMessage(t.toString());
-}, false);
deleted file mode 100644
--- a/examples/reddit-panel/lib/main.js
+++ /dev/null
@@ -1,22 +0,0 @@
-const widgets = require("widget");
-const data = require("self").data;
-
-exports.main = function(options, callbacks) {
-  widgets.Widget({
-    label: "Reddit",
-    contentURL: "http://www.reddit.com/static/favicon.ico",
-    panel: require("panel").Panel({
-      width: 240,
-      height: 320,
-      contentURL: "http://www.reddit.com/.mobile?keep_extension=True",
-      contentScriptFile: [data.url("panel.js")],
-      contentScriptWhen: "ready",
-      onMessage: function(message) {
-        require("tab-browser").addTab(message);
-      }
-    })
-  });
-
-  if (options.staticArgs.quitWhenDone)
-    callbacks.quit();
-};
deleted file mode 100644
--- a/examples/reddit-panel/package.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "license": "MPL 1.1/GPL 2.0/LGPL 2.1", 
-    "name": "reddit-panel",
-    "contributors": [],
-    "author": "Myk Melez",
-    "version": "1.0b1",
-    "keywords": [],
-    "description": "Displays Reddit in a panel.",
-    "id": "anonid0-reddit-panel"
-}
deleted file mode 100644
--- a/packages/addon-kit/README.md
+++ /dev/null
@@ -1,1 +0,0 @@
-This package provides a set of high-level APIs for add-ons to use.
deleted file mode 100644
index d44438903b751f4732f5365783eb0229b0501f9a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/packages/addon-kit/data/test-page-worker.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-    <title>Page Worker test</title>
-</head>
-<body>
-  <p id="paragraph">Lorem ipsum dolor sit amet.</p>
-</body>
-</html>
deleted file mode 100644
--- a/packages/addon-kit/data/test-page-worker.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function testLoadContentPage() {
-  // get title directly
-  postMessage(["assertEqual", document.title, "Page Worker test",
-                         "Correct page title accessed directly"]);
-
-  // get <p> directly
-  let p = document.getElementById("paragraph");
-  postMessage(["assert", !!p, "<p> can be accessed directly"]);
-  postMessage(["assertEqual", p.firstChild.nodeValue,
-                         "Lorem ipsum dolor sit amet.",
-                         "Correct text node expected"]);
-
-  // Modify page
-  let div = document.createElement("div");
-  div.setAttribute("id", "block");
-  div.appendChild(document.createTextNode("Test text created"));
-  document.body.appendChild(div);
-
-  // Check back the modification
-  div = document.getElementById("block");
-  postMessage(["assert", !!div, "<div> can be accessed directly"]);
-  postMessage(["assertEqual", div.firstChild.nodeValue,
-                         "Test text created", "Correct text node expected"]);
-  postMessage(["done"]);
-}
-
-window.addEventListener("DOMContentLoaded", testLoadContentPage, true);
deleted file mode 100644
--- a/packages/addon-kit/data/test.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <head>
-    <title>foo</title>
-  </head>
-  <body>
-    <p>bar</p>
-  </body>
-</html>
deleted file mode 100644
--- a/packages/addon-kit/docs/clipboard.md
+++ /dev/null
@@ -1,58 +0,0 @@
-<!-- contributed by Dietrich Ayala [dietrich@mozilla.com]  -->
-
-The `clipboard` module allows callers to interact with the system clipboard,
-setting and retrieving its contents.
-
-You can optionally specify the type of the data to set and retrieve.
-The following types are supported:
-
-* `text` (plain text)
-* `html` (a string of HTML)
-
-If no data type is provided, then the module will detect it for you.
-
-Examples
---------
-
-Set and get the contents of the clipboard.
-
-    let clipboard = require("clipboard");
-    clipboard.set("Lorem ipsum dolor sit amet");
-    let contents = clipboard.get();
-
-Set the clipboard contents to some HTML.
-
-    let clipboard = require("clipboard");
-    clipboard.set("<blink>Lorem ipsum dolor sit amet</blink>", "html");
-
-If the clipboard contains HTML content, open it in a new tab.
-
-    let clipboard = require("clipboard");
-    if (clipboard.currentFlavors.indexOf("html") != -1)
-      require("tabs").open("data:text/html," + clipboard.get("html"));
-
-<api name="set">
-@function
-  Replace the contents of the user's clipboard with the provided data.
-@param data {string}
-  The data to put on the clipboard.
-@param [datatype] {string}
-  The type of the data (optional).
-</api>
-
-<api name="get">
-@function
-  Get the contents of the user's clipboard.
-@param [datatype] {string}
-  Retrieve the clipboard contents only if matching this type (optional).
-  The function will return null if the contents of the clipboard do not match
-  the supplied type.
-</api>
-
-<api name="currentFlavors">
-@property {array}
-  Data on the clipboard is sometimes available in multiple types. For example,
-  HTML data might be available as both a string of HTML (the `html` type)
-  and a string of plain text (the `text` type). This function returns an array
-  of all types in which the data currently on the clipboard is available.
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/context-menu.md
+++ /dev/null
@@ -1,462 +0,0 @@
-<!-- contributed by Drew Willcoxon [adw@mozilla.com]  -->
-<!-- edited by Noelle Murata [fiveinchpixie@gmail.com]  -->
-
-The `context-menu` module lets you add items to Firefox's page context menu.
-
-
-Introduction
-------------
-
-The `context-menu` API provides a simple, declarative way to add items to the
-page's context menu.  You can add items that perform an action when clicked,
-submenus, and menu separators.
-
-Instead of manually adding items when particular contexts occur and then
-removing them when those contexts go away, you *bind* items to contexts, and the
-adding and removing is automatically handled for you.
-
-Items are bound to contexts in much the same way that event listeners are bound
-to events.  When the user invokes the context menu, all of the items bound to
-the current context are automatically added to the menu.  If no items are bound,
-none are added.  Likewise, any items that were previously in the menu but are
-not bound to the current context are automatically removed from the menu.  You
-never need to manually remove your items from the menu unless you want them to
-never appear again.
-
-For example, if your extension needs to add a context menu item whenever the
-user visits a certain page, don't create the item when that page loads, and
-don't remove it when the page unloads.  Rather, create your item only once, when
-your program starts, and supply a context that matches the target URL.
-
-
-Specifying Contexts
--------------------
-
-As its name implies, the context menu should be reserved for the occurrence of
-specific contexts.  Contexts can be related to page content or the page itself,
-but they should never be external to the page.
-
-For example, a good use of the menu would be to show an "Edit Image" item when
-the user right-clicks an image in the page.  A bad use would be to show a
-submenu that listed all the user's tabs, since tabs aren't related to the page
-or the node the user clicked to open the menu.
-
-### The Page Context
-
-First of all, you may not need to specify a context at all.  When an item does
-not specify a context, the *page context* applies.  The page context occurs
-when the user invokes the context menu on a non-interactive portion of the page.
-
-Try right-clicking a blank spot in a page, or on text.  Make sure that no text
-is selected.  The menu that appears should contain the items "Back", "Forward",
-"Reload", "Stop", and so on.  This is the page context.
-
-The page context is appropriate when your item acts on the page as a whole.  It
-does not occur when the user invokes the context menu on a link, image, or other
-non-text node, or while a selection exists.
-
-### Declarative Contexts
-
-You can specify some simple, declarative contexts when you construct a menu
-item by setting the `context` property of the options object passed to its
-constructor.  Such contexts may be specified with instances of any of the
-following types.  Each is a constructor exported by the `context-menu` module.
-
-<table>
-  <tr>
-    <td><code>
-      PageContext()
-    </code></td>
-    <td>
-      The page context.
-    </td>
-  </tr>
-  <tr>
-    <td><code>
-      SelectionContext()
-    </code></td>
-    <td>
-      This context occurs when the menu is invoked on a page that contains a
-      selection.
-    </td>
-  </tr>
-  <tr>
-    <td><code>
-      SelectorContext(selector)
-    </code></td>
-    <td>
-      This context occurs when the menu is invoked on a node that either matches
-      <code>selector</code>, a CSS selector,  or has an ancestor that matches.
-      <code>selector</code> may include multiple selectors separated by commas,
-      e.g., <code>"a[href], img"</code>.
-    </td>
-  </tr>
-  <tr>
-    <td><code>
-      URLContext(matchPattern)
-    </code></td>
-    <td>
-      This context occurs when the menu is invoked on pages with particular
-      URLs.  <code>matchPattern</code> is a match pattern string or an array of
-      match pattern strings.  When <code>matchPattern</code> is an array, the
-      context occurs when the menu is invoked on a page whose URL matches any of
-      the patterns.  These are the same match pattern strings that you use with
-      the <a href="#module/addon-kit/page-mod"><code>page-mod</code></a>
-      <code>include</code> property.
-      <a href="#module/api-utils/match-pattern">Read more about patterns</a>.
-    </td>
-  </tr>
-  <tr>
-    <td>
-      array
-    </td>
-    <td>
-      An array of any of the other types.  This context occurs when all contexts
-      in the array occur.
-    </td>
-  </tr>
-</table>
-
-Menu items also have a `context` property that can be used to add and remove
-declarative contexts after construction.  For example:
-
-    var context = contextMenu.SelectorContext("img");
-    myMenuItem.context.add(context);
-    myMenuItem.context.remove(context);
-
-When a menu item is bound to more than one context, it appears in the menu when
-all of those contexts occur.
-
-### In Content Scripts
-
-To interact with pages in the browser, you create content scripts and pass them
-when constructing menu items.  Only items in the top-level context menu can have
-content scripts.
-
-One of the things you can do in a content script is listen for an event named
-`"context"`.  This event is fired whenever the context menu is about to be
-shown.  If your listener returns true, the menu item associated with the content
-script is shown in the menu.
-
-For example, this is an item that appears whenever the context menu is invoked
-on a page whose URL contains "mozilla" as a substring:
-
-    var myItem = contextMenu.Item({
-      label: "My Mozilla Item",
-      contentScript: 'on("context", function (node) {' +
-                     '  return /mozilla/.test(document.URL);' +
-                     '});'
-    });
-
-Note that the listener function has a parameter called `node`.  This is the node
-in the page that the user context-clicked to invoke the menu.  You can use it to
-determine whether your item should be shown.
-
-You can both specify declarative contexts and listen for contexts in a content
-script.  In that case, the declarative contexts are evaluated first.  If they
-are not current, then your context listener is never called.
-
-This example takes advantage of that fact.  The listener can be assured that
-`node` will always be an image:
-
-    var myItem = contextMenu.Item({
-      label: "My Mozilla Image Item",
-      context: contextMenu.SelectorContext("img"),
-      contentScript: 'on("context", function (node) {' +
-                     '  return /mozilla/.test(node.src);' +
-                     '});'
-    });
-
-Your item is shown only when all declarative contexts are current and your
-context listener returns true.
-
-
-Handling Menu Item Clicks
--------------------------
-
-When the user clicks your menu item, an event named `"click"` is dispatched to
-the item's content script.  Content scripts let you interact with pages in the
-browser, and they also let you handle menu item clicks.
-
-Therefore, to handle a click, listen for `"click"` events in your content
-script like so:
-
-    var myItem = contextMenu.Item({
-      label: "My Item",
-      contentScript: 'on("click", function (node, data) {' +
-                     '  console.log("Item clicked!");' +
-                     '});'
-    });
-
-Note that the listener function has parameters called `node` and `data`.  `node`
-is the node that the user context-clicked to invoke the menu.  You can use it
-when performing some action.  `data` is the `data` property of the menu item
-that was clicked.  Since only top-level menu items have content scripts, this
-comes in handy for `Menu`s with sub-items.  For example:
-
-    var myMenu = contextMenu.Menu({
-      label: "My Menu",
-      contentScript: 'on("click", function (node, data) {' +
-                     '  console.log("You clicked " + data);' +
-                     '});',
-      items: [
-        contextMenu.Item({ label: "Item 1", data: "item1" }),
-        contextMenu.Item({ label: "Item 2", data: "item2" }),
-        contextMenu.Item({ label: "Item 3", data: "item3" })
-      ]
-    });
-
-Often you will need to collect some kind of information in the click listener
-and perform an action unrelated to content.  To communicate to the menu item
-associated with the content script, the content script can call the global
-`postMessage` function, passing it some JSON-able data.  The menu item's
-`onMessage` function will be called with that data.
-
-    var myItem = contextMenu.Item({
-      label: "Edit Image",
-      context: contextMenu.SelectorContext("img"),
-      contentScript: 'on("click", function (node, data) {' +
-                     '  postMessage(node.src);' +
-                     '});',
-      onMessage: function (imgSrc) {
-        openImageEditor(imgSrc);
-      }
-    });
-
-
-
-Examples
---------
-
-Each of these examples can be added to the top-level scope of your program; you
-only need to create an item once.  See the Introduction above for further
-discussion.
-
-Also, in the real world you probably don't want to include content scripts
-directly in your programs like these examples do.  Instead, make separate files
-in your package's `data` directory, get the URLs of those files using the
-[`self`][self] module, and pass them to menu item constructors using the
-`contentScriptFile` options object property.
-
-First, don't forget to import the module:
-
-    var contextMenu = require("context-menu");
-
-Show an "Edit Page Source" item when the user right-clicks a non-interactive
-part of the page:
-
-    var pageSourceItem = contextMenu.Item({
-      label: "Edit Page Source",
-      contentScript: 'on("click", function (node, data) {' +
-                     '  postMessage(document.URL);' +
-                     '});',
-      onMessage: function (pageURL) {
-        editSource(page.URL);
-      }
-    });
-
-Show an "Edit Image" item when the menu is invoked on an image:
-
-    var editImageItem = contextMenu.Item({
-      label: "Edit Image",
-      context: contextMenu.SelectorContext("img"),
-      contentScript: 'on("click", function (node, data) {' +
-                     '  postMessage(node.src);' +
-                     '});',
-      onMessage: function (imgSrc) {
-        openImageEditor(imgSrc);
-      }
-    });
-
-Show an "Edit Mozilla Image" item when the menu is invoked on an image in a
-mozilla.org or mozilla.com page:
-
-    var editMozImageItem = contextMenu.Item({
-      label: "Edit Mozilla Image",
-      context: [
-        contextMenu.URLContext(["*.mozilla.org", "*.mozilla.com"]),
-        contextMenu.SelectorContext("img")
-      ],
-      contentScript: 'on("click", function (node, data) {' +
-                     '  postMessage(node.src);' +
-                     '});',
-      onMessage: function (imgSrc) {
-        openImageEditor(imgSrc);
-      }
-    });
-
-Show an "Edit Page Images" item when the page contains at least one image:
-
-    var editImagesItem = contextMenu.Item({
-      label: "Edit Page Images",
-      // This ensures the item only appears during the page context.
-      context: contextMenu.PageContext(),
-      contentScript: 'on("context", function (node) {' +
-                     '  var pageHasImgs = !!document.querySelector("img");' +
-                     '  return pageHasImgs;' +
-                     '});' +
-                     'on("click", function (node, data) {' +
-                     '  var imgs = document.querySelectorAll("img");' +
-                     '  var imgSrcs = [];' +
-                     '  for (var i = 0 ; i < imgs.length; i++)' +
-                     '    imgSrcs.push(imgs[i].src);' +
-                     '  postMessage(imgSrcs);' +
-                     '});',
-      onMessage: function (imgSrcs) {
-        openImageEditor(imgSrcs);
-      }
-    });
-
-Show a "Search With" menu when the user right-clicks an anchor that searches
-Google or Wikipedia with the text contained in the anchor:
-
-    var googleItem = contextMenu.Item({
-      label: "Google",
-      data: "http://www.google.com/search?q="
-    });
-    var wikipediaItem = contextMenu.Item({
-      label: "Wikipedia",
-      data: "http://en.wikipedia.org/wiki/Special:Search?search="
-    });
-    var searchMenu = contextMenu.Menu({
-      label: "Search With",
-      context: contextMenu.SelectorContext("a[href]"),
-      contentScript: 'on("click", function (node, data) {' +
-                     '  var searchURL = data + node.textContent;' +
-                     '  window.location.href = searchURL;' +
-                     '});',
-      items: [googleItem, wikipediaItem]
-    });
-
-<api name="Item">
-@class
-A labeled menu item that can perform an action when clicked.
-<api name="Item">
-@constructor
-  Creates a labeled menu item that can perform an action when clicked.
-@param options {object}
-  An object with the following keys:
-  @prop label {string}
-    The item's label.  It must either be a string or an object that implements
-    `toString()`.
-  @prop [data] {string}
-    An optional arbitrary value to associate with the item.  It must be either a
-    string or an object that implements `toString()`.  It will be passed to
-    click listeners.
-  @prop [context] {value}
-    If the item is contained in the top-level context menu, this declaratively
-    specifies the context under which the item will appear; see Specifying
-    Contexts above.  Ignored if the item is contained in a submenu.
-  @prop [contentScript] {string,array}
-    If the item is contained in the top-level context menu, this is the content
-    script or an array of content scripts that the item can use to interact with
-    the page.  Ignored if the item is contained in a submenu.
-  @prop [contentScriptFile] {string,array}
-    If the item is contained in the top-level context menu, this is the local
-    file URL of the content script or an array of such URLs that the item can
-    use to interact with the page.  Ignored if the item is contained in a
-    submenu.
-  @prop [onMessage] {function}
-    If the item is contained in the top-level context menu, this function will
-    be called when the content script calls `postMessage`.  It will be passed
-    the data that was passed to `postMessage`.  Ignored if the item is contained
-    in a submenu.
-</api>
-<api name="destroy">
-@method
-  Permanently removes the item from the top-level context menu.  If the item is
-  not contained in the top-level context menu, this method does nothing.
-</api>
-</api>
-
-<api name="Menu">
-@class
-A labeled menu item that expands into a submenu.
-<api name="Menu">
-@constructor
-  Creates a labeled menu item that expands into a submenu.
-@param options {object}
-  An object with the following keys:
-  @prop label {string}
-    The item's label.  It must either be a string or an object that implements
-    `toString()`.
-  @prop items {array}
-    An array of menu items that the menu will contain.  Each must be an `Item`,
-    `Menu`, or `Separator`.
-  @prop [context] {value}
-    If the menu is contained in the top-level context menu, this declaratively
-    specifies the context under which the menu will appear; see Specifying
-    Contexts above.  Ignored if the menu is contained in a submenu.
-  @prop [contentScript] {string,array}
-    If the menu is contained in the top-level context menu, this is the content
-    script or an array of content scripts that the menu can use to interact with
-    the page.  Ignored if the menu is contained in a submenu.
-  @prop [contentScriptFile] {string,array}
-    If the menu is contained in the top-level context menu, this is the local
-    file URL of the content script or an array of such URLs that the menu can
-    use to interact with the page.  Ignored if the menu is contained in a
-    submenu.
-  @prop [onMessage] {function}
-    If the menu is contained in the top-level context menu, this function will
-    be called when the content script calls `postMessage`.  It will be passed
-    the data that was passed to `postMessage`.  Ignored if the menu is contained
-    in a submenu.
-</api>
-<api name="destroy">
-@method
-  Permanently removes the menu from the top-level context menu.  If the menu is
-  not contained in the top-level context menu, this method does nothing.
-</api>
-</api>
-
-<api name="Separator">
-@class
-A menu separator.  Separators can be contained only in `Menu`s, not in the
-top-level context menu.
-<api name="Separator">
-@constructor
-  Creates a menu separator.
-</api>
-</api>
-
-<api name="PageContext">
-@class
-<api name="PageContext">
-@constructor
-  Creates a page context.  See Specifying Contexts above.
-</api>
-</api>
-
-<api name="SelectionContext">
-@class
-<api name="SelectionContext">
-@constructor
-  Creates a context that occurs when a page contains a selection.  See
-  Specifying Contexts above.
-</api>
-</api>
-
-<api name="SelectorContext">
-@class
-<api name="SelectorContext">
-@constructor
-  Creates a context that matches a given CSS selector.  See Specifying Contexts
-  above.
-@param selector {string}
-  A CSS selector.
-</api>
-</api>
-
-<api name="URLContext">
-@class
-<api name="URLContext">
-@constructor
-  Creates a context that matches pages with particular URLs.  See Specifying
-  Contexts above.
-@param matchPattern {string,array}
-  A [match pattern] string or an array of match pattern strings.
-  [match pattern]: #module/api-utils/match-pattern
-</api>
-</api>
-
-[self]: #module/api-utils/self
deleted file mode 100644
--- a/packages/addon-kit/docs/notifications.md
+++ /dev/null
@@ -1,56 +0,0 @@
-<!-- contributed by Drew Willcoxon [adw@mozilla.com]  -->
-
-The `notifications` module allows you to display transient [toaster]()- or
-[Growl]()-style messages to the user.
-
-[toaster]: http://en.wikipedia.org/wiki/Toast_%28computing%29
-[Growl]: http://growl.info/
-
-Examples
---------
-
-Here's a typical example.  When the message is clicked, a string is logged to
-the console.
-
-    var notifications = require("notifications");
-    notifications.notify({
-      title: "Jabberwocky",
-      text: "'Twas brillig, and the slithy toves",
-      data: "did gyre and gimble in the wabe",
-      onClick: function (data) {
-        console.log(data);
-        // console.log(this.data) would produce the
-        // same result in this case.
-      }
-    });
-
-This one displays an icon that's stored in the add-on's `data` directory.  (See
-the `self` module documentation for more information.)
-
-    var notifications = require("notifications");
-    var self = require("self");
-    var myIconURL = self.data.url("myIcon.png");
-    notifications.notify({
-      text: "I have an icon!",
-      iconURL: myIconURL
-    });
-
-
-<api name="notify">
-@function
-  Displays a transient notification to the user.
-@param options {object}
-  An object with the following keys.  Each is optional.
-  @prop [title] {string}
-    A string to display as the message's title.
-  @prop [text] {string}
-    A string to display as the body of the message.
-  @prop [iconURL] {string}
-    The URL of an icon to display inside the message.  It may be a remote URL,
-    a data URI, or a URL returned by the `self` module.
-  @prop [onClick] {function}
-    A function to be called when the user clicks the message.  It will be passed
-    the value of `data`.
-  @prop [data] {string}
-    A string that will be passed to `onClick`.
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/page-mod.md
+++ /dev/null
@@ -1,215 +0,0 @@
-<!-- contributed by Nickolay Ponomarev [asqueella@gmail.com] -->
-<!-- contributed by Myk Melez [myk@mozilla.org] -->
-<!-- contributed by Irakli Gozalishvil [gozala@mozilla.com] -->
-
-Overview
---------
-The page-mod module enables add-on developers to execute scripts in the context
-of specific web pages. Most obviously you could use page-mod to dynamically
-modify the content of certain pages.
-
-The module exports a constructor function `PageMod` which creates a new page
-modification (or "mod" for short).
-
-A page mod does not modify its pages until those pages are loaded or reloaded.
-In other words, if your add-on is loaded while the user's browser is open, the
-user will have to reload any open pages that match the mod for the mod to affect
-them.
-
-To stop a page mod from making any more modifications, call its `destroy`
-method.
-
-Like all modules that interact with web content, page-mod uses content
-scripts that execute in the content process and defines a messaging API to
-communicate between the content scripts and the main add-on script. For more
-details on content scripting see the tutorial on [interacting with web
-content](#guide/web-content).
-
-To create a PageMod the add-on developer supplies:
-
-* a set of rules to select the desired subset of web pages based on their URL.
-Each rule is specified using the
-[match-pattern](#module/api-utils/match-pattern) syntax.
-
-* a set of content scripts to execute in the context of the desired pages.
-
-* a value for the onAttach option: this value is a function which will be
-called when a page is loaded that matches the ruleset. This is used to set up a
-communication channel between the add-on code and the content script.
-
-All these parameters are optional except for the ruleset, which must include
-at least one rule.
-
-The following add-on displays an alert whenever a page matching the ruleset is
-loaded:
-
-    var pageMod = require("page-mod");
-    pageMod.PageMod({
-      include: "*.org",
-      contentScript: 'window.alert("Page matches ruleset");'
-    });
-
-If you specify a value of "ready" for `contentScriptWhen` then the content
-script can interact with the DOM itself:
-
-    var pageMod = require("page-mod");
-    pageMod.PageMod({
-      include: "*.org",
-      contentScriptWhen: 'ready',
-      contentScript: 'document.body.innerHTML = ' +
-                     ' "<h1>Page matches ruleset</h1>";'
-    });
-
-### <a name="pagemod-content-scripts">Communicating With Content Scripts</a>###
-
-When a matching page is loaded the `PageMod` will call the function that the
-add-on code supplied to `onAttach`. The `PageMod` supplies two arguments to
-this function: the `PageMod` itself and a `worker` object.
-
-The worker can be thought of as the add-on's end of
-a communication channel between the add-on code and the content scripts that
-have been attached to this page.
-
-Thus the add-on can pass messages to the content scripts by calling the
-worker's `postMessage` function and can receive messages from the content
-scripts by registering a function as a listener to the worker's `on` function.
-
-Note that if multiple matching pages are loaded simultaneously then each page
-is loaded into its own execution context with its own copy of the content
-scripts. In this case `onAttach` is called once for each loaded page, and the
-add-on code will have a separate worker for each page:
-
-![Multiple workers](media/multiple-workers.jpg)
-
-This is demonstrated in the following example:
-
-    var pageMod = require("page-mod");
-    var tabs = require("tabs");
-
-    var workers = new Array();
-
-    pageMod.PageMod({
-      include: ["http://www.mozilla*"],
-      contentScriptWhen: 'ready',
-      contentScript: "onMessage = function onMessage(message) {" +
-                     "  window.alert(message);};",
-      onAttach: function onAttach(worker, mod) {
-        if (workers.push(worker) == 3) {
-          workers[0].postMessage("The first worker!");
-          workers[1].postMessage("The second worker!");
-          workers[2].postMessage("The third worker!");
-        }
-      }
-    });
-
-    tabs.open("http://www.mozilla.com");
-    tabs.open("http://www.mozilla.org");
-    tabs.open("http://www.mozilla-europe.org");
-
-Here we specify a ruleset to match any URLs starting with
-"http://www.mozilla". When a page matches we add the supplied worker to
-an array, and when we have three workers in the array we send a message to
-each worker in turn, telling it the order in which it was attached. The
-worker just displays the message in an alert box.
-
-This shows that separate pages execute in separate contexts and that each
-context has its own communication channel with the add-on script.
-
-Note though that while there is a separate worker for each execution context,
-the worker is shared across all the content scripts associated with a single
-execution context. In the following example we pass two content scripts into
-the `PageMod`: these content scripts will share a worker instance.
-
-In the example each content script identifies itself to the add-on script
-by sending it a message using the global `postMessage` function. In the
-`onAttach` function the add-on code logs the fact that a new page is
-attached and registers a listener function that simply logs the message:
-
-
-    var pageMod = require("page-mod");
-    const data = require("self").data;
-    var tabs = require("tabs");
-
-    pageMod.PageMod({
-      include: ["http://www.mozilla*"],
-      contentScriptWhen: 'ready',
-      contentScript: ["postMessage('Content script 1 is attached to '+ " +
-                      "document.URL);",
-                      "postMessage('Content script 2 is attached to '+ " +
-                      "document.URL);"],
-      onAttach: function onAttach(worker, mod) {
-        console.log("Attaching content scripts")
-        worker.on('message', function(data) {
-          console.log(data);
-        });
-      }
-    });
-
-    tabs.open("http://www.mozilla.com");
-
-The console output of this add-on is:
-
-    info: Attaching content scripts
-    info: Content script 1 is attached to http://www.mozilla.com/en-US/
-    info: Content script 2 is attached to http://www.mozilla.com/en-US/
-
-<api name="PageMod">
-@class
-A PageMod object. Once activated a page mod will execute the supplied content
-scripts in the context of any pages matching the pattern specified by the
-'include' property.
-<api name="PageMod">
-@constructor
-Creates a PageMod.
-@param options {object}
-  Options for the PageMod, with the following keys:
-  @prop include {string,array}
-    A match pattern string or an array of match pattern strings.  These define
-    the pages to which the PageMod applies.  See the [match-pattern] module for
-    a description of match pattern syntax.
-    At least one match pattern must be supplied.
-    [match-pattern]: #module/api-utils/match-pattern
-  @prop [contentScriptFile] {string,array}
-    The local file URLs of content scripts to load.  Content scripts specified
-    by this option are loaded *before* those specified by the `contentScript`
-    option. Optional.
-  @prop [contentScript] {string,array}
-    The texts of content scripts to load.  Content scripts specified by this
-    option are loaded *after* those specified by the `contentScriptFile` option.
-    Optional.
-  @prop [contentScriptWhen] {string}
-    When to load the content scripts.  Optional.
-    Possible values are "start" (default), which loads them as soon as
-    the window object for the page has been created, and "ready", which loads
-    them once the DOM content of the page has been loaded.
-  @prop [onAttach] {function}
-A function to call when the PageMod attaches content scripts to
-a matching page. The function will be called with two arguments:
-
-* A `worker` object which the add-on script can use to communicate with
-the content scripts attached to the page in question. See "[Communicating with
-content scripts](#pagemod-content-scripts)" for more details.
-
-* The PageMod itself.
-
-</api>
-
-<api name="include">
-@property {List}
-A [List] of match pattern strings.  These define the pages to which the page mod
-applies.  See the [match-pattern] module for a description of match patterns.
-Rules can be added to the list by calling its `add` method and removed by
-calling its `remove` method.
-
-[List]: https://jetpack.mozillalabs.com/sdk/latest/docs/#module/api-utils/list
-[match-pattern]: #module/api-utils/match-pattern
-</api>
-
-<api name="destroy">
-@method
-Stops the page mod from making any more modifications.  Once destroyed the page
-mod can no longer be used.  Note that modifications already made to open pages
-will not be undone.
-</api>
-
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/page-worker.md
+++ /dev/null
@@ -1,189 +0,0 @@
-<!-- contributed by Felipe Gomes [felipc@gmail.com] -->
-
-The `page-worker` module provides a way to create a permanent, invisible page
-and access its DOM.
-
-Introduction
-------------
-
-The module exports a constructor function `Page`, which constructs a new page.
-A page may be destroyed, after which its memory is freed, and you must create a
-new instance to load another page.
-
-Pages have associated content scripts, which are JavaScript scripts that have
-access to the content loaded into the pages.  A program can specify scripts
-to load for a page worker, and the program can communicate with those scripts
-over an asynchronous JSON pipe.
-
-Events
-------
-Content workers may emit the following types of events:
-
-####"message"####
-Event allows the page worker to receive messages from the content scripts.
-Calling `postMessage` function from the one of the content scripts will
-asynchronously emit 'message' event on the worker.
-
-####"error"####
-Event allows the page worker to react on an uncaught runtime script error
-that occurs in one of the content scripts.
-
-Examples
---------
-
-### Print all header titles from a Wikipedia article ###
-
-First, don't forget to import the module:
-
-    var pageWorkers = require("page-worker");
-
-Then make a script that will send the titles from the content script
-to the program:
-
-    var script = "var elements = document.querySelectorAll('h2 > span'); " +
-                 "for (var i = 0; i < elements.length; i++) { " +
-                 "  postMessage(elements[i].textContent) " +
-                 "}";
-
-Finally, create a page pointed to Wikipedia:
-
-    pageWorkers.Page({
-      contentURL: "http://en.wikipedia.org/wiki/Internet",
-      contentScript: script,
-      contentScriptWhen: "ready",
-      onMessage: function(message) {
-        console.log(message);
-      }
-    });
-
-The page's `onMessage` callback function will print all the titles it receives
-from the content script.
-
-<api name="Page">
-@class
-The `Page` object loads the page specified by the `contentURL` option and
-executes any content scripts that have been supplied to it in the
-`contentScript` and/or `contentScriptFile` options.
-
-The page is not displayed to the user.
-
-The page is loaded as soon as the page object is created and stays loaded until
-its `destroy` method is called or the add-on is unloaded.
-<api name="Page">
-@constructor
-  Creates an uninitialized Page Worker instance.
-@param [options] {object}
-  The *`options`* parameter is optional, and if given it should be an object
-  with any of the following keys:
-  @prop [contentURL] {URL,string}
-    The URL of the content to load in the panel.
-  @prop [allow] {object}
-    An object with keys to configure the permissions of the Page Worker.
-    The boolean key `script` controls if scripts from the page
-    are allowed to run. Its default value is false.
-  @prop [contentScriptFile] {string,array}
-    The local file URLs of content scripts to load.  Content scripts specified
-    by this option are loaded *before* those specified by the `contentScript`
-    option.
-  @prop [contentScript] {string,array}
-    The texts of content scripts to load.  Content scripts specified by this
-    option are loaded *after* those specified by the `contentScriptFile` option.
-  @prop [contentScriptWhen] {string}
-    When to load the content scripts.
-    Possible values are "start" (default), which loads them as soon as
-    the window object for the page has been created, and "ready", which loads
-    them once the DOM content of the page has been loaded.
-  @prop [onMessage] {function,array}
-    Functions to call when a content script sends the program a message.
-</api>
-
-<api name="contentURL">
-@property {URL}
-The URL of the content loaded.
-</api>
-
-<api name="allow">
-@property {object}
-  An object with keys to configure the permissions on the Page Worker.
-  The boolean key `script` controls if scripts from the page
-  are allowed to run.
-</api>
-
-<api name="contentScriptFile">
-@property {array}
-The local file URLs of content scripts to load.  Content scripts specified by
-this property are loaded *before* those specified by the `contentScript`
-property.
-</api>
-
-<api name="contentScript">
-@property {array}
-The texts of content scripts to load.  Content scripts specified by this
-property are loaded *after* those specified by the `contentScriptFile` property.
-</api>
-
-<api name="contentScriptWhen">
-@property {string}
-When to load the content scripts.
-Possible values are "start" (default), which loads them as soon as
-the window object for the page has been created, and "ready", which loads
-them once the DOM content of the page has been loaded.
-</api>
-
-<api name="destroy">
-@method
-Unloads the Page Worker. After you destroy a Page Worker, its memory is freed
-and you must create a new instance if you need to load another page.
-</api>
-
-<api name="postMessage">
-@method
-Send a message to the content scripts.
-@param message {string,number,object,array,boolean}
-The message to send.  Must be stringifiable to JSON.
-</api>
-
-<api name="on">
-@method
-Registers an event `listener` that will be called when events of
-specified `type` are emitted.
-
-If the `listener` is already registered for this `type`, a call to this
-method has no effect.
-
-If the event listener is being registered while an event is being processed,
-the event listener is not called during the current emit.
-
-@param type {String}
-  The type of event.
-
-@param listener {Function}
-  The listener function that processes the event.
-</api>
-
-Example:
-
-    var page = require("page-worker").PageWorker({
-      contentURL: 'http://mozilla.org'
-    });
-    page.on('message', function onMessage(message) {
-      console.log(message);
-    })
-
-<api name="removeListener">
-@method
-Unregisters an event `listener` for the specified event `type`.
-
-If the `listener` is not registered for this `type`, a call to this
-method has no effect.
-
-If an event listener is removed while an event is being processed, it is
-still triggered by the current emit. After it is removed, the event listener
-is never invoked again (unless registered again for future processing).
-
-@param type {String}
-  The type of event.
-@param listener {Function}
-  The listener function that processes the event.
-</api>
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/panel.md
+++ /dev/null
@@ -1,198 +0,0 @@
-<!-- contributed by Myk Melez [myk@mozilla.org] -->
-<!-- contributed by Irakli Gozalishvili [gozala@mozilla.com] -->
-
-The `panel` module creates floating modal "popup dialogs" that appear on top of
-web content and browser chrome and persist until dismissed by users or programs.
-Panels are useful for presenting temporary interfaces to users in a way that is
-easier for users to ignore and dismiss than a modal dialog, since panels are
-hidden the moment users interact with parts of the application interface outside
-them.
-
-Introduction
-------------
-
-The module exports a single constructor function, `Panel`, which constructs a new panel.
-
-A panel's content is loaded as soon as it is created, before the panel is shown,
-and the content remains loaded when a panel is hidden, so it is possible
-to keep a panel around in the background, updating its content as appropriate
-in preparation for the next time it is shown.
-
-Panels can be anchored to a particular element in a DOM window, including both
-chrome elements, i.e. parts of the host application interface, and content
-elements, i.e. parts of a web page in an application tab.  Panels that are
-anchored to an element should have an arrow that points from the panel to the
-element, but that has not yet been implemented.  The work to implement it is
-tracked in bug 554937.
-
-Panels have associated content scripts, which are JavaScript scripts that have
-access to the content loaded into the panels.  Programs can specify one or more
-content scripts to load for a panel, and the program can communicate with those
-scripts via an asynchronous message passing API.
-
-Examples
---------
-
-Create and show a simple panel with content from the `data/` directory:
-
-    const data = require("self").data;
-    var panel = require("panel").Panel({
-      contentURL: data.url("foo.html")
-    });
-
-    panel.show();
-
-The tutorial section on [web content](#guide/web-content) has a more complex
-example using panels.
-
-<api name="Panel">
-@class
-The Panel object represents a floating modal dialog that can by an add-on to
-present user interface content.
-
-Once a panel object has been created it can be activated using the global
-`add()` function and can subsequently be shown and hidden using its `show()`
-and `hide()` methods. Once a panel is no longer needed it can be deactivated
-using `remove()`.
-
-The content of a panel is specified using the `contentURL` option. An add-on
-can interact with the content of a panel using content scripts which it
-supplies in the `contentScript` and/or `contentScriptFile` options. For example,
-a content script could create a menu and send the user's selection to the
-add-on.
-<api name="Panel">
-@constructor
-Creates a panel.
-@param options {object}
-  Options for the panel, with the following keys:
-  @prop [width] {number}
-    The width of the panel in pixels. Optional.
-  @prop [height] {number}
-    The height of the panel in pixels. Optional.
-  @prop [contentURL] {URL,string}
-    The URL of the content to load in the panel.
-  @prop [allow] {object}
-    Permissions for the content, with the following keys:
-    @prop [script] {boolean}
-      Whether or not to execute script in the content.  Defaults to true.
-      Optional.
-    Optional.
-  @prop [contentScriptFile] {string,array}
-    The local file URLs of content scripts to load.  Content scripts specified
-    by this option are loaded *before* those specified by the `contentScript`
-    option. Optional.
-  @prop [contentScript] {string,array}
-    The texts of content scripts to load.  Content scripts specified by this
-    option are loaded *after* those specified by the `contentScriptFile` option.
-    Optional.
-  @prop [contentScriptWhen] {string}
-    When to load the content scripts.  Optional.
-    Possible values are "start" (default), which loads them as soon as
-    the window object for the page has been created, and "ready", which loads
-    them once the DOM content of the page has been loaded.
-  @prop onMessage {function,array}
-    Functions to call when a content script sends the program a message.
-  @prop onShow {function,array}
-    Functions to call when the panel is shown.
-  @prop onHide {function,array}
-    Functions to call when the panel is hidden.
-</api>
-
-<api name="height">
-@property {number}
-The height of the panel in pixels.
-</api>
-
-<api name="width">
-@property {number}
-The width of the panel in pixels.
-</api>
-
-<api name="contentURL">
-@property {URL}
-The URL of the content loaded in the panel.
-</api>
-
-<api name="allow">
-@property {object}
-Permissions for the content, with the following keys:
-@prop script {boolean}
-  Whether or not to execute script in the content.  Defaults to true.
-</api>
-
-<api name="contentScriptFile">
-@property {array}
-The local file URLs of content scripts to load.  Content scripts specified by
-this property are loaded *before* those specified by the `contentScript`
-property.
-</api>
-
-<api name="contentScript">
-@property {array}
-The texts of content scripts to load.  Content scripts specified by this
-property are loaded *after* those specified by the `contentScriptFile` property.
-</api>
-
-<api name="contentScriptWhen">
-@property {string}
-When to load the content scripts.
-Possible values are "start" (default), which loads them as soon as
-the window object for the page has been created, and "ready", which loads
-them once the DOM content of the page has been loaded.
-</api>
-
-<api name="destroy">
-@method
-Destroy the panel, unloading any content that was loaded in it. Once
-destroyed, the panel can no longer be used. If you just want to hide
-the panel and might show it later, use `hide` instead.
-</api>
-
-<api name="onMessage">
-@property {array}
-Functions to call when a content script sends the panel a message.
-</api>
-
-<api name="postMessage">
-@method
-Send a message to the content scripts.
-@param message {string,number,object,array,boolean}
-The message to send.  Must be stringifiable to JSON.
-</api>
-
-<api name="show">
-@method
-Display the panel.
-@param [anchor] {DOM node handle}
-A handle to a DOM node in a page to which the panel should appear to be
-connected.  If not given, the panel is centered inside the most recent browser
-window.
-</api>
-
-<api name="hide">
-@method
-Stop displaying the panel.
-</api>
-
-<api name="resize">
-@method
-Resizes the panel to its new dimensions.
-@param width {number}
-The new width of the panel in pixels.
-@param height {number}
-The new height of the panel in pixels.
-</api>
-</api>
-
-<api name="add">
-@function
-Register a panel, loading its content and preparing it to be shown when its
-`show` method is invoked.
-@param panel {Panel} the panel to add
-</api>
-
-<api name="remove">
-@function
-Unregister a panel, unloading the content that was loaded in it.
-@param panel {Panel} the panel to remove
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/private-browsing.md
+++ /dev/null
@@ -1,55 +0,0 @@
-<!-- contributed by Paul O’Shannessy [paul@oshannessy.com]  -->
-<!-- edited by Noelle Murata [fiveinchpixie@gmail.com]  -->
-<!-- contributed by Irakli Gozalishvili [gozala@mozilla.com] -->
-
-
-The `private-browsing` module allows you to access the private browsing service
-- detecting if it is active and adding callbacks for transitioning into and out
-of private browsing mode.
-
-Private browsing is a singleton, so in most cases it will be easiest to store it
-in a variable.
-
-    var pb = require("private-browsing");
-
-## Events ##
-
-When the browser starts or stops private browsing mode, the following events
-are emitted:
-
-### start ###
-Emitted when the browser starts private browsing mode.
-
-    pb.on("start", function() {
-      // Do something when the browser starts private browsing mode.
-    });
-
-
-### stop ###
-Emitted when the browser stops private browsing mode.
-
-
-    pb.on("stop", function() {
-      // Do something when the browser stops private browsing mode.
-    });
-
-## Supported Applications ##
-
-This module is available in all applications. However, only Firefox will ever
-transition into or out of private browsing mode. For all other applications,
-`pb.isActive` will always be `false`, and none of the events will be emitted.
-
-<api name="isActive">
-@property {boolean}
-  This read-only boolean is true if private browsing mode is turned on.
-</api>
-
-<api name="activate">
-@function
-  Turns on private browsing mode.
-</api>
-
-<api name="deactivate">
-@function
-  Turns off private browsing mode.
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/request.md
+++ /dev/null
@@ -1,151 +0,0 @@
-The `request` module lets you make simple, yet powerful network requests.
-
-<api name="Request">
-@class
-The `Request` object is used to make `GET` or `POST` network requests. It is
-constructed with a URL to which the request is sent. Optionally the user may
-specify a collection of headers and content to send alongside the request and
-a callback which will be executed once the request completes.
-
-Once a `Request` object has been created a `GET` request can be executed by
-calling its `get()` method, or a `POST` request by calling its `post()` method.
-
-When the server completes the request, the `Request` returns a
-`Response` object to the caller containing the response and calls the callback.
-
-Each `Request` object is designed to be used once. Once `GET` or `POST` are
-called, attempting to call either will throw an error.
-
-Since the request is not being made by any particular website, requests made
-here are not subject to the same-domain restriction that requests made in web
-pages are subject to.
-
-With the exception of `response`, all of a `Request` object's properties
-correspond with the options in the constructor. Each can be set by simply
-performing an assignment. However, keep in mind that the same validation rules
-that apply to `options` in the constructor will apply during assignment. Thus,
-each can throw if given an invalid value.
-
-The example below shows how to use Request to get the most recent public tweet.
-
-    var Request = require('request').Request;
-    var latestTweetRequest = Request({
-      url: "http://api.twitter.com/1/statuses/public_timeline.json",
-      onComplete: function (response) {
-        var tweet = response.json[0];
-        console.log("User: " + tweet.user.screen_name);
-        console.log("Tweet: " + tweet.text);
-      }
-    });
-    // Be a good consumer and check for rate limiting before doing more.
-    Request({
-      url: "http://api.twitter.com/1/account/rate_limit_status.json",
-      onComplete: function (response) {
-        if (response.json.remaining_hits) {
-          latestTweetRequest.get();
-        } else {
-          console.log("You have been rate limited!");
-        }
-      }
-    }).get();
-
-<api name="Request">
-@constructor
-This constructor creates a request object that can be used to make network
-requests. The constructor takes a single parameter `options` which is used to
-set several properties on the resulting `Request`.
-@param options {object}
-    @prop url {string}
-    This is the url to which the request will be made.
-
-    @prop onComplete {callback}
-    This function will be called when the request has received a response. In
-    terms of XHR, when `readyState == 4`. The `response` & `request` objects
-    are passed to the callback as arguments.
-
-    @prop [headers] {object}
-    An unordered collection of name/value pairs representing headers to send
-    with the request.
-
-    @prop [content] {string,object}
-    The content to send to the server. If `content` is a string, it should be
-    URL-encoded (use `encodeURIComponent`). If `content` is an object, it
-    should be a collection of name/value pairs. Nested objects & arrays should
-    encode safely.
-
-    For `GET` requests, the query string (`content`) will be appended to the
-    URL. For `POST` requests, the query string will be sent as the body of the
-    request.
-
-    @prop [contentType] {string}
-    The type of content to send to the server. This explicitly sets the
-    `Content-Type` header. The default value is `application/x-www-form-urlencoded`.
-</api>
-
-<api name="url">
-@property {string}
-</api>
-
-<api name="headers">
-@property {object}
-</api>
-
-<api name="content">
-@property {string,object}
-</api>
-
-<api name="contentType">
-@property {string}
-</api>
-
-<api name="response">
-@property {Response}
-</api>
-
-<api name="get">
-@method
-Make a `GET` request.
-@returns {Request}
-</api>
-
-<api name="post">
-@method
-Make a `POST` request.
-@returns {Request}
-</api>
-</api>
-
-
-<api name="Response">
-@class
-The Response object contains the response to a network request issued using a
-`Request` object. It is returned by the `get()` or `post()` method of a
-`Request` object.
-
-All members of a `Response` object are read-only.
-<api name="text">
-@property {string}
-The content of the response as plain text.
-</api>
-
-<api name="json">
-@property {object}
-The content of the response as a JavaScript object. The value will be `null`
-if the document cannot be processed by `JSON.parse`.
-</api>
-
-<api name="status">
-@property {string}
-The HTTP response status code (e.g. *200*).
-</api>
-
-<api name="statusText">
-@property {string}
-The HTTP response status line (e.g. *OK*).
-</api>
-
-<api name="headers">
-@property {object}
-The HTTP response headers represented as key/value pairs.
-</api>
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/selection.md
+++ /dev/null
@@ -1,85 +0,0 @@
-<!-- contributed by Eric H. Jung [eric.jung@yahoo.com] -->
-<!-- contributed by Irakli Gozalishvili [gozala@mozilla.com] -->
-
-The `selection` module provides a means to get and set text and HTML selections
-in the current Firefox page.  It can also observe new selections.
-
-It does not currently support selections inside `textarea` and `input` elements,
-however.
-
-Registering for Selection Notifications
----------------------------------------
-
-To be notified when the user makes a selection, register listener on 'select'
-event. Each listener will be called after a selection is made.
-
-    function myCallback() {
-      console.log("A selection has been made.");
-    }
-    var selection = require("selection");
-    selection.on('select', myCallback);
-
-    // removing listeners
-    selection.removeListener('select', myCallback);
-
-Iterating Over Discontiguous Selections
----------------------------------------
-
-Discontiguous selections can be accessed by iterating over the `selection`
-module itself. Each iteration yields a `Selection` object from which `text`,
-`html`, and `isContiguous` properties can be accessed.
-
-
-Examples
---------
-
-Log the current contiguous selection as text:
-
-    var selection = require("selection");
-    if (selection.text)
-      console.log(selection.text);
-
-Log the current discontiguous selections as HTML:
-
-    var selection = require("selection");
-    if (!selection.isContiguous) {
-      for (var subselection in selection) {
-         console.log(subselection.html);
-      }
-    }
-
-Surround HTML selections with delimiters:
-
-    var selection = require("selection");
-    selection.on('select', function (selection) {
-      selection.html = "\\\" + selection.html + "///";
-    });
-
-<api name="text">
-@property {string}
-  Gets or sets the current selection as plain text. Setting the selection
-  removes all current selections, inserts the specified text at the location of
-  the first selection, and selects the new text. Getting the selection when
-  there is no current selection returns `null`. Setting the selection when there
-  is no current selection throws an exception. Getting the selection when
-  `isContiguous` is `true` returns the text of the first selection.
-</api>
-
-<api name="html">
-@property {string}
-  Gets or sets the current selection as HTML. Setting the selection removes all
-  current selections, inserts the specified text at the location of the first
-  selection, and selects the new text. Getting the selection when there is no
-  current selection returns `null`. Setting the selection when there is no
-  current selection throws an exception. Getting the selection when
-  `isContiguous` is `true` returns the text of the first selection.
-</api>
-
-<api name="isContiguous">
-@property {boolean}
-  `true` if the current selection is a single, contiguous selection, and `false`
-  if there are two or more discrete selections, each of which may or may not be
-  spatially adjacent. If there is no current selection, this property is `null`.
-  (Discontiguous selections can be created by the user with
-  Ctrl+click-and-drag.)
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/simple-storage.md
+++ /dev/null
@@ -1,137 +0,0 @@
-The `simple-storage` module lets you easily and persistently store data across
-application restarts.  If you're familiar with [DOM storage][] on the Web, it's
-kind of like that, but for extensions.
-
-[DOM storage]: https://developer.mozilla.org/en/DOM/Storage
-
-
-Introduction
-------------
-
-The simple storage module exports an object called `storage` that is persistent
-and private to your extension.  It's a normal JavaScript object, and you can
-treat it as you would any other.
-
-To store a value, just assign it to a property on `storage`:
-
-    var simpleStorage = require("simple-storage");
-    simpleStorage.storage.array = [1, 1, 2, 3, 5, 8, 13];
-    simpleStorage.storage.boolean = true;
-    simpleStorage.storage.null = null;
-    simpleStorage.storage.number = 3.1337;
-    simpleStorage.storage.object = { a: "foo", b: { c: true }, d: null };
-    simpleStorage.storage.string = "O frabjous day!";
-
-You can store array, boolean, number, object, null, and string values.  If you'd
-like to store other types of values, you'll first have to convert them to
-strings or another one of these types.
-
-You can also set the `storage` property itself.  The types above are also legal
-here.
-
-    simpleStorage.storage = [1, 1, 2, 3, 5, 8, 13];
-    simpleStorage.storage = true;
-    simpleStorage.storage = null;
-    simpleStorage.storage = 3.1337;
-    simpleStorage.storage = { a: "foo", b: { c: true }, d: null };
-    simpleStorage.storage = "O frabjous day!";
-
-Be careful with this approach, though: You must set the `storage` property on
-the module, not a reference to the `storage` object, so the following pattern
-will not work:
-
-    // This is no good!
-    var myStorage = simpleStorage.storage;
-    myStorage = "I will not be saved! :(";
-
-
-Quotas
-------
-
-The simple storage available to your extension is limited.  Currently this limit
-is about five megabytes (5,242,880 bytes).  You can choose to be notified when
-you go over quota, and you should respond by reducing the amount of data in
-storage.  If the user quits the application while you are over quota, all data
-stored since the last time you were under quota will not be persisted.  You
-should not let that happen.
-
-To listen for quota notifications, register a listener for `"OverQuota"`
-events. It will be called when your storage goes over quota.
-
-    function myOnOverQuotaListener(simpleStorage) {
-      console.log("Uh oh.");
-    }
-    simpleStorage.on("OverQuota", myOnOverQuotaListener);
-
-Note that the listener is passed a reference to the simple storage module.
-Listeners can also be removed:
-
-    simpleStorage.removeListener("OverQuota", myOnOverQuotaListener);
-
-To find out how much of your quota you're using, check the module's `quotaUsage`
-property.  It indicates the percentage of quota your storage occupies.  If
-you're within your quota, it's a number from 0 to 1, inclusive, and if you're
-over, it's a number greater than 1.
-
-Therefore, when you're notified that you're over quota, respond by removing
-storage until your `quotaUsage` is less than or equal to 1.  Which particular
-data you remove is up to you.  For example:
-
-    simpleStorage.storage = [ /* some long array */ ];
-    simpleStorage.on("OverQuota", function () {
-      while (simpleStorage.quotaUsage > 1)
-        simpleStorage.storage.pop();
-    });
-
-
-Private Browsing
-----------------
-
-*This section applies only to extensions running on Firefox.*
-
-If your storage is related to your users' Web history, personal information, or
-other sensitive data, your extension should respect [private browsing
-mode][SUMO].  While private browsing mode is active, you should not store any
-sensitive data.
-
-Because any kind of data can be placed into simple storage, support for private
-browsing is not built into the module.  Instead, use the `private-browsing`
-module in the `api-utils` package to check private browsing status and
-respond accordingly.
-
-For example, the URLs your users visit should not be stored during private
-browsing.  If your extension records the URL of the selected tab, here's how you
-might handle that:
-
-    simpleStorage.storage.history = [];
-    var privateBrowsing = require("private-browsing");
-    if (!privateBrowsing.active) {
-      var url = getSelectedTabURL();
-      simpleStorage.storage.history.push(url);
-    }
-
-For more information on supporting private browsing, see its [Mozilla Developer
-Network documentation][MDN].  While that page does not apply specifically to
-SDK-based add-ons (and its code samples don't apply at all), you should
-follow its guidance on best practices and policies.
-
-[SUMO]: http://support.mozilla.com/en-US/kb/Private+Browsing
-[MDN]: https://developer.mozilla.org/En/Supporting_private_browsing_mode
-
-
-<api name="storage">
-@property {object}
-  A persistent object private to the extension.  Properties with array, boolean,
-  number, object, null, and string values will be persisted.  The `storage`
-  property itself may also be set to a value of one of these types or a new
-  object.
-</api>
-
-<api name="quotaUsage">
-@property {number}
-  A number in the range [0, Infinity) that indicates the percentage of quota
-  occupied by storage.  A value in the range [0, 1] indicates that the storage
-  is within quota.  A value greater than 1 indicates that the storage exceeds
-  quota.
-</api>
-
deleted file mode 100644
--- a/packages/addon-kit/docs/tabs.md
+++ /dev/null
@@ -1,272 +0,0 @@
-<!-- contributed by Dietrich Ayala [dietrich@mozilla.com]  -->
-<!-- edited by Noelle Murata [fiveinchpixie@gmail.com]  -->
-
-
-The `tabs` module provides easy access to tabs and tab-related events.
-
-Events
-------
-
-Events represent common actions and state changes for tabs and their content.
-
-Listeners are passed the `tab` object that triggered the event.
-
-All the tabs and lists of tabs emit following events:
-
-### open ###
-Event emitted when a new tab is open.
-This does not mean that the content has loaded, only that the browser tab
-itself is fully visible to the user.
-
-Tab content related properties (title, thumbnail, favicon, url) will not
-be correct at this point. Use `ready` event listener to be notified when the
-page has loaded.
-
-### close ###
-Event emitted when a tab is closed.
-
-### ready ###
-Event emitted when a tab's content's DOM is ready.
-
-This is equivalent to the `DOMContentLoaded` event for the given content page.
-This event will be emitted multiple times for the same tab, if different content
-is loaded into it.
-
-At this point all the tab content related properties can be used.
-
-### activate ###
-Event emitted when an inactive tab is made active.
-
-### deactivate ###
-Event emitted when the active tab is made inactive.
-
-**Example**
-
-    var tabs = require("tabs").tabs;
-
-    // listen for tab openings.
-    tabs.on('open', function onOpen(tab) {
-      myOpenTabs.push(tab);
-    });
-
-    // listen for tab content loadings.
-    tabs.on('ready', function(tab) {
-      console.log('tab is loaded', tab.title, tab.url)
-    });
-
-<api name="tabs">
-@property {TabList}
-
-The live list of all open tabs, across all open windows.
-
-_See TabList class for more details._
-
-**Example**
-
-    var tabs= require("tabs").tabs;
-    for each (var tab in tabs) {
-      console.log(tab.title);
-    }
-</api>
-
-<api name="TabList">
-@class
-The set of sorted list of open tabs.
-An instance of `TabList` represents a list of open tabs. `Tablist` can represent
-a list of tabs per window as in the case of `BrowserWindow`'s `tabs` property
-or list of all open tabs as in the case of `tabs` object that is exported by
-this module.
-
-`TabList` instances emit all the events described in the "events" section.
-Listeners are passed the `tab` object that triggered the event.
-
-<api name="active">
-@property {Tab}
-
-The currently active tab in this list. This property is read-only.
-
-**Example**
-
-    // Getting active tab's title.
-    var tabs = require("tabs").tabs;
-    console.log("title of active tab is " + tabs.active.title);
-
-    // Activate tab next to currently active one.
-    tabs.active = tabs[tabs.active++];
-</api>
-<api name="length">
-@property {number}
-
-Number of items in this list.
-</api>
-<api name="open">
-@method
-Open a new tab. If this is a list of tabs for a window, the tab will be opened
-on this window. If this is a list of all tabs, the new tab will be open in the
-active window or in the new window depending on the option being passed.
-
-**Example**
-
-    var tabs = require("tabs").tabs;
-
-    // Open a new tab on active window and make tab active.
-    tabs.open("http://www.mysite.com");
-
-    // Open a new tab in a new window and make it active.
-    tabs.open({
-      url: "http://www.mysite.com",
-      inNewWindow: true
-    });
-
-    // Open a new tab on active window in the background.
-    tabs.open({
-      url: "http://www.mysite.com",
-      inBackground: true
-    });
-
-    // Open a new tab as an apptab and do something once it's open.
-    tabs.open({
-      url: "http://www.mysite.com",
-      isPinned: true,
-      onOpen: function onOpen(tab) {
-        // do stuff like listen for content
-        // loading.
-      }
-    });
-
-@param options {object}
-An object containing configurable options for how and where the tab will be
-opened, as well as a listeners for the tab events.
-
-If the only option being used is `url`, then a bare string URL can be passed to
-`open` instead of adding at a property of the `options` object.
-
-@prop [url] {string}
-String URL to be opened in the new tab.
-This is a required property.
-
-@prop [inNewWindow] {boolean}
-If present and true, a new browser window will be opened and the URL will be
-opened in the first tab in that window. This is an optional property.
-
-@prop [inBackground] {boolean}
-If present and true, the new tab will be opened to the right of the active tab
-and will not be active. This is an optional property.
-
-@prop [isPinned] {boolean}
-If present and true, then the new tab will be pinned as an AppTab.
-[AppTab]:http://blog.mozilla.com/faaborg/2010/07/28/app-tabs-in-firefox-4-beta-2/
-
-@prop [onOpen] {function}
-A callback function that will be registered for 'open' event.
-This is an optional property.
-@prop [onClose] {function}
-A callback function that will be registered for 'close' event.
-This is an optional property.
-@prop [onReady] {function}
-A callback function that will be registered for 'ready' event.
-This is an optional property.
-@prop [onActivate] {function}
-A callback function that will be registered for 'activate' event.
-This is an optional property.
-@prop [onDeactivate] {function}
-A callback function that will be registered for 'deactivate' event.
-This is an optional property.
-@prop [onActivate] {function}
-A callback function that will be registered for 'activate' event.
-This is an optional property.
-</api>
-</api>
-
-<api name="Tab">
-@class
-A `tab` instance represents a single open tab. It contains various tab
-properties, several methods for manipulation, as well as per-tab event
-registration.
-
-Tabs emit all the events described in the "events" section. Listeners are
-passed the `tab` object that triggered the event.
-
-    var tabs = require("tabs").tabs;
-
-    // Close the active tab.
-    tabs.activeTab.close();
-
-    // Move the active tab one position to the right.
-    tabs.activeTab.index++;
-
-    // Open a tab and listen for content being ready.
-    tabs.open({
-      url: "http://www.mozilla.com",
-      onReady: function(tab) {
-        console.log(tab.title);
-      }
-    });
-
-<api name="title">
-@property {string}
-The title of the page currently loaded in the tab.
-This property can be set to change the tab title.
-</api>
-
-<api name="url">
-@property {String}
-The URL of the page currently loaded in the tab.
-This property can be set to load a different URL in the tab.
-</api>
-
-<api name="favicon">
-@property {string}
-The URL of the favicon for the page currently loaded in the tab.
-This property is read-only.
-</api>
-
-<api name="style">
-@property {string}
-The CSS style for the tab. **NOT IMPLEMENTED YET**.
-</api>
-
-<api name="index">
-@property {integer}
-The index of the tab relative to other tabs in the application window.
-This property can be set to change it's relative position.
-</api>
-
-<api name="thumbnail">
-@property {string}
-Data URI of a thumbnail of the page currently loaded in the tab.
-This property is read-only.
-</api>
-
-<api name="isPinned">
-@property {boolean}
-Whether or not tab is pinned as an [AppTab].
-This property is read-only.
-[AppTab]:http://blog.mozilla.com/faaborg/2010/07/28/app-tabs-in-firefox-4-beta-2/
-</api>
-
-<api name="pin">
-@method
-Pins this tab as an [AppTab].
-[AppTab]:http://blog.mozilla.com/faaborg/2010/07/28/app-tabs-in-firefox-4-beta-2/
-</api>
-
-<api name="unpin">
-@method
-Unpin this tab.
-</api>
-
-<api name="close">
-@method
-Close this tab.
-
-@param [callback] {function}
-A function to be called when the tab finishes its closing process.
-This is an optional arguments.
-</api>
-
-<api name="activate">
-@method
-Makes this tab active, which will bring this tab to the foreground.
-</api>
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/widget.md
+++ /dev/null
@@ -1,160 +0,0 @@
-<!-- contributed by Dietrich Ayala [dietrich@mozilla.com]  -->
-<!-- edited by Noelle Murata [fiveinchpixie@gmail.com]  -->
-
-The `widget` module provides a consistent, unified way for extensions to
-expose their user-interface in a way that blends in well with the host
-application.
-
-The widgets are displayed in the Firefox 4 Add-on Bar by default.
-Users can move them around using the Firefox toolbar customization
-palette, available in the View/Toolbars menu.
-
-The widget bar can be shown and hidden via the Control+Shift+U keyboard
-shortcut (or Cmd+Shift+U if on Mac).
-
-To communicate between your widget and the content loading in it, every widget
-exposes the `Loader` module API. This allows you to run content scripts in
-the context of your widget's content. For example, to be notified when the 
-widget contents have loaded, you can make a small script that calls back to the
-widget when it first loads, or when it's DOM is ready. See the example code
-below for various ways of doing this.
-
-## Examples ##
-
-    const widgets = require("widget");
-
-    // A basic click-able image widget.
-    widgets.Widget({
-      label: "Widget with an image and a click handler",
-      contentURL: "http://www.google.com/favicon.ico",
-      onClick: function() require("tabs").activeTab.location = "http://www.google.com"
-    });
-
-    // A widget that changes display on mouseover.
-    widgets.Widget({
-      label: "Widget with changing image on mouseover",
-      contentURL: "http://www.yahoo.com/favicon.ico",
-      onMouseover: function() {
-        this.contentURL = "http://www.bing.com/favicon.ico";
-      },
-      onMouseout: function() {
-        this.contentURL = "http://www.yahoo.com/favicon.ico";
-      }
-    });
-
-    // A widget that updates content on a timer.
-    widgets.Widget({
-      label: "Widget that updates content on a timer",
-      content: "0",
-      contentScript: "setTimeout(function() { document.body.innerHTML++; }, 2000)",
-      contentScriptWhen: "ready"
-    });
-
-    // A widget that loads a random Flickr photo every 5 minutes.
-    widgets.Widget({
-      label: "Random Flickr Photo Widget",
-      contentURL: "http://www.flickr.com/explore/",
-      contentScriptWhen: "ready",
-      contentScript: "postMessage(document.querySelector('.pc_img').src); " +
-        "setTimeout(function() { document.location = 'http://www.flickr.com/explore/'; }, 5 * 60 * 1000);",
-      onMessage: function(widget, message) {
-        widget.contentURL = message;
-      },
-      onClick: function() require("tabs").activeTab.location = this.contentURL
-    });
-
-    // A widget created with a specified width, that grows.
-    let myWidget = widgets.Widget({
-      label: "Wide widget that grows wider on a timer",
-      content: "I'm getting longer.",
-      width: 50,
-    });
-    require("timer").setInterval(function() myWidget.width += 10, 1000);
-
-<api-name="Widget">
-@class
-Represents a widget object.
-<api name="Widget">
-@constructor {options}
-  Creates a new widget.  The widget is immediately added to the widget bar.
-
-@param options {object}
-  An object with the following keys:
-
-  @prop [label] {string}
-    A required string description of the widget used for accessibility,
-    title bars, and error reporting.
-
-  @prop [content] {string}
-    An optional string value containing the displayed content of the widget.
-    It may contain raw HTML content. Widgets must have either the `content` property or the
-    `contentURL` property set.
-
-  @prop [contentURL] {URL}
-    An optional string URL to content to load into the widget. This can be
-    local content via the `self` module, or remote content, and can be an image
-    or web content. Widgets must have either the `content` property or the
-    `contentURL` property set.
-
-  @prop [panel] {panel}
-    An optional `Panel` to open when the user clicks on the widget.  See the
-    [`panel`](#module/addon-kit/panel) module for more information about the
-    `Panel` objects to which this option can be set and the `reddit-panel`
-    example add-on for an example of using this option.  Note: If you also
-    specify an `onClick` callback function, it will be called instead of the
-    panel being opened.  However, you can then show the panel from the `onClick`
-    callback function by calling `panel.show()`.
-
-  @prop [width] {integer}
-    Optional width in pixels of the widget. This property can be updated after
-    the widget has been created, to resize it. If not given, a default width is
-    used.
-
-  @prop [onClick] {callback}
-    An optional function to be called when the widget is clicked. It is called
-    as `onClick(widget, event)`. `widget` is the `Widget` instance, and `event`
-    is the standard DOM event object.
-
-  @prop [onMouseover] {callback}
-    An optional function to be called when the user passes the mouse over the
-    widget. It is called as `onMouseover(widget, event)`. `widget` is the
-    `Widget` instance, and `event` is the standard DOM event object.
-
-  @prop [onMouseout] {callback}
-    An optional function to be called when the mouse is no longer over the
-    widget. It is called as `onMouseout(widget, event)`. `widget` is the
-    `Widget` instance, and `event` is the standard DOM event object.
-
-  @prop [tooltip] {string}
-    Optional text to show when the user's mouse hovers over the widget.  If not
-    given, the `label` is used.
-
-  @prop [allow] {object}
-    Permissions for the content, with the following keys:
-    @prop [script] {boolean}
-      Whether or not to execute script in the content.  Defaults to true.
-
-  @prop [contentScriptFile] {array}
-    The local file URLs of content scripts to load.  Content scripts specified
-    by this property are loaded *before* those specified by the `contentScript`
-    property.
-
-  @prop [contentScript] {array}
-    The texts of content scripts to load.  Content scripts specified by this
-    property are loaded *after* those specified by the `contentScriptFile`
-    property.
-
-  @prop [contentScriptWhen] {string}
-    When to load the content scripts.
-    Possible values are "start" (default), which loads them as soon as
-    the window object for the page has been created, and "ready", which loads
-    them once the DOM content of the page has been loaded.
-
-  @prop [onMessage] {array}
-    Functions to call when a content script sends the widget a message.
-</api>
-<api name="destroy">
-@method
-  Removes the widget from the widget bar.
-</api>
-</api>
deleted file mode 100644
--- a/packages/addon-kit/docs/windows.md
+++ /dev/null
@@ -1,173 +0,0 @@
-<!-- contributed by Felipe Gomes [felipc@gmail.com]  -->
-
-
-The `windows` module provides easy access to browser windows, their
-tabs, and open/close related functions and events.
-
-This module currently only supports browser windows and does not provide
-access to non-browser windows such as the Bookmarks Library, preferences
-or other non-browser windows created via add-ons.
-
-Events
-------
-
-Events represent common actions and state changes for windows.
-
-Listeners are passed the `window` object that triggered the event.
-
-All the windows and lists of windows emit following events:
-
-### open ###
-Event emitted when a new window is open.
-This does not mean that the content has loaded, only that the browser window
-itself is fully visible to the user.
-
-### close ###
-Event emitted when a window is closed.
-
-<api name="browserWindows">
-@property {List}
-An object that contains various properties and methods to access
-functionality from browser windows, such as opening new windows, accessing
-their tabs or switching the current active window.
-
-`browserWindows` provides access to all the currently open browser windows:
-
-    var windows = require("windows");
-    for each (var window in windows.browserWindows) {
-      console.log(window.title);
-    }
-
-    console.log(windows.browserWindows.length);
-
-Object emits all the events listed under "Events" section.
-
-####Examples####
-
-    var windows = require("windows").browserWindows;
-
-    // add a listener to the 'open' event
-    windows.on('open', function(window) {
-      myOpenWindows.push(window);
-    });
-
-    // add a listener to the 'close' event
-    windows.on('close', function(window) {
-      console.log("A window was closed.");
-    });
-
-<api name="activeWindow">
-@property {BrowserWindow}
-
-The currently active window. This property is read-only.
-
-**Example**
-
-    // get
-    var windows = require("windows");
-    console.log("title of active window is " +
-                windows.browserWindows.activeWindow.title);
-
-    anotherWindow.activate();
-    // set
-    windows.activeWindow == anotherWindow // true
-</api>
-
-</api>
-
-<api name="open">
-@function
-Open a new window.
-
-    var windows = require("windows").browserWindows;
-
-    // Open a new window.
-    windows.open("http://www.mysite.com");
-
-    // Open a new window and set a listener for "open" event.
-    windows.open({
-      url: "http://www.mysite.com",
-      onOpen: function(window) {
-        // do stuff like listen for content
-        // loading.
-      }
-    });
-
-@param options {object}
-An object containing configurable options for how this window will be opened,
-as well as a callback for being notified when the window has fully opened.
-
-If the only option being used is `url`, then a bare string URL can be passed to
-`open` instead of specifying it as a property of the `options` object.
-
-@prop url {string}
-String URL to be opened in the new window.
-This is a required property.
-
-@prop [onOpen] {function}
-A callback function that is called when the window has opened. This does not
-mean that the URL content has loaded, only that the window itself is fully
-functional and its properties can be accessed. This is an optional property.
-
-@prop [onClose] {function}
-A callback function that is called when the window will be called.
-This is an optional property.
-</api>
-
-</api>
-
-<api name="BrowserWindow">
-@class
-A `BrowserWindow` instance represents a single open window. They can be
-retrieved from the `browserWindows` property exported by this module.
-
-    var windows = require("windows").browserWindows;
-
-    //Print how many tabs the current window has
-    console.log("The active window has " +
-                windows.activeWindow.tabs.length +
-                " tabs.");
-
-    // Print the title of all browser windows
-    for each (var window in windows) {
-      console.log(window.title);
-    }
-
-    // close the active window
-    windows.activeWindow.close();
-
-    windows.activeWindow.close(function() {
-      console.log("The active window was closed");
-    });
-
-<api name="title">
-@property {string}
-The current title of the window. Usually the title of the active tab,
-plus an app identifier.
-This property is read-only.
-</api>
-
-<api name="tabs">
-@property {TabList}
-An instance of [TabList](#module/addon-kit/tabs) representing the live list of
-all the open tabs for this window.
-This property is read-only.
-</api>
-
-<api name="activate">
-@method
-Makes window active, which will focus that window and bring it to the
-foreground.
-</api>
-
-<api name="close">
-@method
-Close the window.
-
-@param [callback] {function}
-A function to be called when the window finishes its closing process.
-This is an optional argument.
-</api>
-
-</api>
-
deleted file mode 100644
--- a/packages/addon-kit/lib/clipboard.js
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Paul O’Shannessy <paul@oshannessy.com> (Original Author)
- *   Dietrich Ayala <dietrich@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const {Cc,Ci} = require("chrome");
-const errors = require("errors");
-const apiUtils = require("api-utils");
- 
-/*
-While these data flavors resemble Internet media types, they do
-no directly map to them.
-*/
-const kAllowableFlavors = [
-  "text/unicode",
-  "text/html"
-  /* CURRENTLY UNSUPPORTED FLAVORS
-  "text/plain",
-  "image/png",
-  "image/jpg",
-  "image/gif"
-  "text/x-moz-text-internal",
-  "AOLMAIL",
-  "application/x-moz-file",
-  "text/x-moz-url",
-  "text/x-moz-url-data",
-  "text/x-moz-url-desc",
-  "text/x-moz-url-priv",
-  "application/x-moz-nativeimage",
-  "application/x-moz-nativehtml",
-  "application/x-moz-file-promise-url",
-  "application/x-moz-file-promise-dest-filename",
-  "application/x-moz-file-promise",
-  "application/x-moz-file-promise-dir"
-  */
-];
-
-/*
-Aliases for common flavors. Not all flavors will
-get an alias. New aliases must be approved by a
-Jetpack API druid.
-*/
-const kFlavorMap = [
-  { short: "text", long: "text/unicode" },
-  { short: "html", long: "text/html" }
-  // Images are currently unsupported.
-  //{ short: "image", long: "image/png" },
-];
-
-let clipboardService = Cc["@mozilla.org/widget/clipboard;1"].
-                       getService(Ci.nsIClipboard);
-
-let clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].
-                      getService(Ci.nsIClipboardHelper);
-
-
-exports.set = function(aData, aDataType) {
-  let options = {
-    data: aData,
-    datatype: aDataType || "text/unicode"
-  };
-  options = apiUtils.validateOptions(options, {
-    data: {
-      is: ["string"]
-    },
-    datatype: {
-      is: ["null", "undefined", "string"]
-    }
-  });
-
-  var flavor = fromJetpackFlavor(options.datatype);
-
-  if (!flavor)
-    throw new Error("Invalid flavor");
-
-  // Additional checks for using the simple case
-  if (flavor == "text/unicode") {
-    clipboardHelper.copyString(options.data);
-    return true;
-  }
-
-  // Below are the more complex cases where we actually have to work with a
-  // nsITransferable object
-  var xferable = Cc["@mozilla.org/widget/transferable;1"].
-                 createInstance(Ci.nsITransferable);
-  if (!xferable)
-    throw new Error("Couldn't set the clipboard due to an internal error " + 
-                    "(couldn't create a Transferable object).");
-
-  switch (flavor) {
-    case "text/html":
-      var str = Cc["@mozilla.org/supports-string;1"].
-                createInstance(Ci.nsISupportsString);
-      str.data = options.data;
-      xferable.addDataFlavor(flavor);
-      xferable.setTransferData(flavor, str, options.data.length * 2);
-      break;
-    // TODO: images!
-    // TODO: add a text/unicode flavor for HTML text that
-    // returns a plaintextified representation of the HTML.
-    default:
-      throw new Error("Unable to handle the flavor " + flavor + ".");
-  }
-
-  // TODO: Not sure if this will ever actually throw. -zpao
-  try {
-    clipboardService.setData(
-      xferable,
-      null,
-      clipboardService.kGlobalClipboard
-    );
-  } catch (e) {
-    throw new Error("Couldn't set clipboard data due to an internal error: " + e);
-  }
-  return true;
-};
-
-
-exports.get = function(aDataType) {
-  let options = {
-    datatype: aDataType
-  };
-  options = apiUtils.validateOptions(options, {
-    datatype: {
-      is: ["null", "undefined", "string"]
-    }
-  });
-
-  var xferable = Cc["@mozilla.org/widget/transferable;1"].
-                 createInstance(Ci.nsITransferable);
-  if (!xferable)
-    throw new Error("Couldn't set the clipboard due to an internal error " + 
-                    "(couldn't create a Transferable object).");
-
-  var flavor = aDataType ? fromJetpackFlavor(aDataType) : "text/unicode";
-
-  // Ensure that the user hasn't requested a flavor that we don't support.
-  if (!flavor)
-    throw new Error("Getting the clipboard with the flavor '" + flavor +
-                    "' is > not supported.");
-
-  // TODO: Check for matching flavor first? Probably not worth it.
-
-  xferable.addDataFlavor(flavor);
-
-  // Get the data into our transferable.
-  clipboardService.getData(
-    xferable,
-    clipboardService.kGlobalClipboard
-  );
-
-  var data = {};
-  var dataLen = {};
-  try {
-    xferable.getTransferData(flavor, data, dataLen);
-  } catch (e) {
-    // Clipboard doesn't contain data in flavor, return null.
-    return null;
-  }
-
-  // There's no data available, return.
-  if (data.value === null)
-    return null;
-
-  // TODO: Add flavors here as we support more in kAllowableFlavors.
-  switch (flavor) {
-    case "text/unicode":
-    case "text/html":
-      data = data.value.QueryInterface(Ci.nsISupportsString).data;
-      break;
-    default:
-      data = null;
-  }
-
-  return data;
-};
-
-exports.__defineGetter__("currentFlavors", function() {
-  // Loop over kAllowableFlavors, calling hasDataMatchingFlavors for each.
-  // This doesn't seem like the most efficient way, but we can't get
-  // confirmation for specific flavors any other way. This is supposed to be
-  // an inexpensive call, so performance shouldn't be impacted (much).
-  var currentFlavors = [];
-  for each (var flavor in kAllowableFlavors) {
-    var matches = clipboardService.hasDataMatchingFlavors(
-      [flavor],
-      1,
-      clipboardService.kGlobalClipboard
-    );
-    if (matches)
-      currentFlavors.push(toJetpackFlavor(flavor));
-  }
-  return currentFlavors;
-});
-
-// SUPPORT FUNCTIONS ////////////////////////////////////////////////////////
-
-function toJetpackFlavor(aFlavor) {
-  for each (flavorMap in kFlavorMap)
-    if (flavorMap.long == aFlavor)
-      return flavorMap.short;
-  // Return null in the case where we don't match
-  return null;
-}
-
-function fromJetpackFlavor(aJetpackFlavor) {
-  // TODO: Handle proper flavors better
-  for each (flavorMap in kFlavorMap)
-    if (flavorMap.short == aJetpackFlavor || flavorMap.long == aJetpackFlavor)
-      return flavorMap.long;
-  // Return null in the case where we don't match.
-  return null;
-}
deleted file mode 100644
--- a/packages/addon-kit/lib/context-menu.js
+++ /dev/null
@@ -1,1165 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Drew Willcoxon <adw@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const {Ci} = require("chrome");
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The context-menu module currently supports only Firefox.  In the future ",
-    "we would like it to support other applications, however.  Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=560716 for more information."
-  ].join(""));
-}
-
-const apiUtils = require("api-utils");
-const collection = require("collection");
-const { Worker } = require("content");
-const url = require("url");
-const { MatchPattern } = require("match-pattern");
-
-// All user items we add have this class name.
-const ITEM_CLASS = "jetpack-context-menu-item";
-
-// Items in the top-level context menu also have this class.
-const TOPLEVEL_ITEM_CLASS = "jetpack-context-menu-item-toplevel";
-
-// Items in the overflow submenu also have this class.
-const OVERFLOW_ITEM_CLASS = "jetpack-context-menu-item-overflow";
-
-// The ID of the menu separator that separates standard context menu items from
-// our user items.
-const SEPARATOR_ID = "jetpack-context-menu-separator";
-
-// If more than this number of items are added to the context menu, all items
-// overflow into a "Jetpack" submenu.
-const OVERFLOW_THRESH_DEFAULT = 10;
-const OVERFLOW_THRESH_PREF =
-  "extensions.addon-sdk.context-menu.overflowThreshold";
-
-// The label of the overflow sub-<menu>.
-//
-// TODO: Localize this.
-const OVERFLOW_MENU_LABEL = "Add-ons";
-
-// The ID of the overflow sub-<menu>.
-const OVERFLOW_MENU_ID = "jetpack-content-menu-overflow-menu";
-
-// The ID of the overflow submenu's <menupopup>.
-const OVERFLOW_POPUP_ID = "jetpack-content-menu-overflow-popup";
-
-// These are used by PageContext.isCurrent below.  If the popupNode or any of
-// its ancestors is one of these, Firefox uses a tailored context menu, and so
-// the page context doesn't apply.
-const NON_PAGE_CONTEXT_ELTS = [
-  Ci.nsIDOMHTMLAnchorElement,
-  Ci.nsIDOMHTMLAppletElement,
-  Ci.nsIDOMHTMLAreaElement,
-  Ci.nsIDOMHTMLButtonElement,
-  Ci.nsIDOMHTMLCanvasElement,
-  Ci.nsIDOMHTMLEmbedElement,
-  Ci.nsIDOMHTMLImageElement,
-  Ci.nsIDOMHTMLInputElement,
-  Ci.nsIDOMHTMLIsIndexElement,
-  Ci.nsIDOMHTMLMapElement,
-  Ci.nsIDOMHTMLMediaElement,
-  Ci.nsIDOMHTMLMenuElement,
-  Ci.nsIDOMHTMLObjectElement,
-  Ci.nsIDOMHTMLOptionElement,
-  Ci.nsIDOMHTMLSelectElement,
-  Ci.nsIDOMHTMLTextAreaElement,
-];
-
-
-exports.Item = apiUtils.publicConstructor(Item);
-exports.Menu = apiUtils.publicConstructor(Menu);
-exports.Separator = apiUtils.publicConstructor(Separator);
-
-
-function Item(options) {
-  let rules = optionsRules();
-  rules.data = {
-    map: function (v) v.toString(),
-    is: ["string", "undefined"]
-  };
-  options = apiUtils.validateOptions(options, rules);
-
-  defineItemProps(this, options);
-
-  // TODO: Add setter for this?
-  this.__defineGetter__("data", function () {
-    return "data" in options ? options.data : undefined;
-  });
-
-  this.toString = function Item_toString() {
-    return '[object Item "' + options.label + '"]';
-  };
-
-  browserManager.addItem(this);
-}
-
-function Menu(options) {
-  let rules = optionsRules();
-  rules.items = {
-    is: ["array"]
-  };
-  options = apiUtils.validateOptions(options, rules);
-
-  defineItemProps(this, options);
-
-  // TODO: Add setter for this?
-  this.__defineGetter__("items", function () options.items.slice(0));
-
-  this.toString = function Menu_toString() {
-    return '[object Menu "' + options.label + '"]';
-  };
-
-  browserManager.addItem(this);
-  options.items.forEach(function (i) browserManager.removeItem(i));
-}
-
-function Separator() {
-  this.toString = function Separator_toString() {
-    return "[object Separator]";
-  };
-}
-
-
-function Context() {}
-
-function PageContext() {
-  this.isCurrent = function PageContext_isCurrent(popupNode) {
-    let win = popupNode.ownerDocument.defaultView;
-    if (win && !win.getSelection().isCollapsed)
-      return false;
-
-    let cursor = popupNode;
-    while (cursor && !(cursor instanceof Ci.nsIDOMHTMLHtmlElement)) {
-      if (NON_PAGE_CONTEXT_ELTS.some(function (iface) cursor instanceof iface))
-        return false;
-      cursor = cursor.parentNode;
-    }
-    return true;
-  };
-}
-
-PageContext.prototype = new Context();
-
-function SelectorContext(selector) {
-  let opts = apiUtils.validateOptions({ selector: selector }, {
-    selector: {
-      is: ["string"],
-      msg: "selector must be a string."
-    }
-  });
-
-  this.adjustPopupNode = function SelectorContext_adjustPopupNode(node) {
-    return closestMatchingAncestor(node);
-  };
-
-  this.isCurrent = function SelectorContext_isCurrent(popupNode) {
-    return !!closestMatchingAncestor(popupNode);
-  };
-
-  // Returns node if it matches selector, or the closest ancestor of node that
-  // matches, or null if node and none of its ancestors matches.
-  function closestMatchingAncestor(node) {
-    let cursor = node;
-    while (cursor) {
-      if (cursor.mozMatchesSelector(selector))
-        return cursor;
-      if (cursor instanceof Ci.nsIDOMHTMLHtmlElement)
-        break;
-      cursor = cursor.parentNode;
-    }
-    return null;
-  }
-}
-
-SelectorContext.prototype = new Context();
-
-function SelectionContext() {
-  this.isCurrent = function SelectionContext_isCurrent(popupNode) {
-    let win = popupNode.ownerDocument.defaultView;
-    if (!win)
-      return false;
-    return !win.getSelection().isCollapsed;
-  };
-}
-
-SelectionContext.prototype = new Context();
-
-function URLContext(patterns) {
-  let opts = apiUtils.validateOptions({ patterns: patterns }, {
-    patterns: {
-      map: function (v) apiUtils.getTypeOf(v) === "array" ? v : [v],
-      ok: function (v) v.every(function (p) typeof(p) === "string"),
-      msg: "patterns must be a string or an array of strings."
-    }
-  });
-  try {
-    patterns = opts.patterns.map(function (p) new MatchPattern(p));
-  }
-  catch (err) {
-    console.error("Error creating URLContext match pattern:");
-    throw err;
-  }
-
-  this.isCurrent = function URLContext_isCurrent(popupNode) {
-    let url = popupNode.ownerDocument.URL;
-    return patterns.some(function (p) p.test(url));
-  };
-}
-
-URLContext.prototype = new Context();
-
-exports.PageContext = apiUtils.publicConstructor(PageContext);
-exports.SelectorContext = apiUtils.publicConstructor(SelectorContext);
-exports.SelectionContext = apiUtils.publicConstructor(SelectionContext);
-exports.URLContext = apiUtils.publicConstructor(URLContext);
-
-
-// Returns rules for apiUtils.validateOptions() common to Item and Menu.
-function optionsRules() {
-  return {
-    context: {
-      is: ["undefined", "object", "array"],
-      ok: function (v) {
-        if (!v)
-          return true;
-        let arr = apiUtils.getTypeOf(v) === "array" ? v : [v];
-        return arr.every(function (o) o instanceof Context);
-      },
-      msg: "The 'context' option must be a Context object or an array of " +
-           "Context objects."
-    },
-    label: {
-      map: function (v) v.toString(),
-      is: ["string"],
-      ok: function (v) !!v,
-      msg: "The item must have a non-empty string label."
-    },
-    contentScript: {
-      is: ["string", "array", "undefined"],
-      ok: function (v) {
-        return apiUtils.getTypeOf(v) !== "array" ||
-               v.every(function (s) typeof(s) === "string");
-      }
-    },
-    contentScriptFile: {
-      is: ["string", "array", "undefined"],
-      ok: function (v) {
-        if (!v)
-          return true;
-        let arr = apiUtils.getTypeOf(v) === "array" ? v : [v];
-        try {
-          return arr.every(function (s) {
-            return apiUtils.getTypeOf(s) === "string" && url.toFilename(s);
-          });
-        }
-        catch (err) {}
-        return false;
-      },
-      msg: "The 'contentScriptFile' option must be a local file URL or " +
-           "an array of local file URLs."
-    },
-    onMessage: {
-      is: ["function", "undefined"]
-    }
-  };
-}
-
-// Defines some getters and other properties that are common to Item and Menu.
-// item is the Item or Menu object on which to define the properties, and
-// options is a validated options object.
-function defineItemProps(item, options) {
-  // TODO: Add setter for label?  It would require finding the item's DOM
-  // element and changing its attributes as well.  Note however that
-  // WorkerRegistry relies on label remaining constant, so if setters are added,
-  // that would need fixing.
-  item.__defineGetter__("label", function () options.label);
-
-  // Stupid ternaries to avoid Spidermonkey strict warnings.
-  item.__defineGetter__("contentScript", function () {
-    return "contentScript" in options ? options.contentScript : undefined;
-  });
-  item.__defineGetter__("contentScriptFile", function () {
-    return "contentScriptFile" in options ? options.contentScriptFile : undefined;
-  });
-  item.__defineGetter__("onMessage", function () {
-    return "onMessage" in options ? options.onMessage : undefined;
-  });
-
-  collection.addCollectionProperty(item, "context");
-  if (options.context)
-    item.context.add(options.context);
-
-  item.destroy = function Item_destroy() {
-    browserManager.removeItem(item);
-  };
-}
-
-// Does a binary search on elts, a NodeList, and returns the DOM element
-// before which an item with targetLabel should be inserted.  null is returned
-// if the new item should be inserted at the end.
-function insertionPoint(targetLabel, elts) {
-  let from = 0;
-  let to = elts.length - 1;
-
-  while (from <= to) {
-    let i = Math.floor((from + to) / 2);
-    let comp = targetLabel.localeCompare(elts[i].getAttribute("label"));
-    if (comp < 0)
-      to = i - 1;
-    else if (comp > 0)
-      from = i + 1;
-    else
-      return elts[i];
-  }
-  return elts[from] || null;
-}
-
-
-// Keeps track of all browser windows.
-let browserManager = {
-  items: [],
-  windows: [],
-
-  // Registers an item with the manager.  It's added to the context menus of
-  // all currently registered windows, and when new windows are registered it
-  // will be added to them, too.
-  addItem: function browserManager_addItem(item) {
-    this.items.push(item);
-    this.windows.forEach(function (w) w.addItems([item]));
-  },
-
-  // Registers the manager to listen for window openings and closings.  Note
-  // that calling this method can cause onTrack to be called immediately if
-  // there are open windows.
-  init: function browserManager_init() {
-    let windowTracker = new (require("window-utils").WindowTracker)(this);
-    require("unload").ensure(windowTracker);
-  },
-
-  // Registers a window with the manager.  This is a WindowTracker callback.
-  onTrack: function browserManager_onTrack(window) {
-    if (this._isBrowserWindow(window)) {
-      let win = new BrowserWindow(window);
-      this.windows.push(win);
-      win.addItems(this.items);
-    }
-  },
-
-  // Unregisters a window from the manager.  It's told to undo all menu
-  // modifications.  This is a WindowTracker callback.  Note that when
-  // WindowTracker is unloaded, it calls onUntrack for every currently opened
-  // window.  The browserManager therefore doesn't need to specially handle
-  // unload itself, since unloading the browserManager means untracking all
-  // currently opened windows.
-  onUntrack: function browserManager_onUntrack(window) {
-    if (this._isBrowserWindow(window)) {
-      for (let i = 0; i < this.windows.length; i++) {
-        if (this.windows[i].window == window) {
-          let win = this.windows.splice(i, 1)[0];
-          win.destroy();
-          return;
-        }
-      }
-    }
-  },
-
-  // Unregisters an item from the manager.  It's removed from the context menus
-  // of all windows that are currently registered.  If the item is not
-  // registered, this is a no-op.
-  removeItem: function browserManager_removeItem(item) {
-    let idx = this.items.indexOf(item);
-    if (idx >= 0) {
-      this.items.splice(idx, 1);
-      this.windows.forEach(function (w) w.removeItems([item]));
-    }
-  },
-
-  _isBrowserWindow: function browserManager__isBrowserWindow(win) {
-    let winType = win.document.documentElement.getAttribute("windowtype");
-    return winType === "navigator:browser";
-  }
-};
-
-
-// A type of Worker tailored to our uses.
-const ContextMenuWorker = Worker.compose({
-
-  // Returns true if any context listeners are defined in the worker's port.
-  anyContextListeners: function CMW_anyContextListeners() {
-    return this._port._listeners("context").length > 0;
-  },
-
-  // Returns true if any of the context listeners in the worker's port return
-  // true.  popupNode is the node that was context-clicked.
-  isAnyContextCurrent: function CMW_isAnyContextCurrent(popupNode) {
-    let listeners = this._port._listeners("context");
-    for (let i = 0; i < listeners.length; i++)
-      if (listeners[i].call(this._port._sandbox, popupNode))
-        return true;
-    return false;
-  },
-
-  // Emits a click event in the worker's port.  popupNode is the node that was
-  // context-clicked, and clickedItemData is the data of the item that was
-  // clicked.
-  fireClick: function CMW_fireClick(popupNode, clickedItemData) {
-    this._port._emit("click", popupNode, clickedItemData);
-  },
-
-  // Frees the worker's resources.
-  destroy: function CMW_destroy() {
-    this._deconstructWorker();
-  }
-});
-
-
-// This class creates and stores content workers for pairs of menu items and
-// content windows.  Since workers need to be looked up every time the context
-// menu is shown, the main purpose of this class, in addition to creating and
-// storing workers, is to provide fast lookup of workers given a menu item and
-// content window.
-function WorkerRegistry() {
-  // This is a matrix.  The rows are menu item keys, the columns content window
-  // keys.  Each entry in the matrix stores workers for pairs of content windows
-  // and menu items.
-  //
-  // workers[i][w] is an array of objects { item, win, worker }.  item is a menu
-  // item whose key is i, win is a content window whose key is w, and worker is
-  // the content worker created from the pair.  The reason workers[i][w] is an
-  // array and not a single object is that we don't require menu item keys and
-  // content window keys to be unique.
-  //
-  // This structure is fairly simple and allows worker lookups in constant time
-  // in the best case.  In the worst case, however -- when all content windows
-  // have the same key and all menu items have the same key -- lookup is O(I*W),
-  // where I is the number of items and W is the number of windows in the
-  // registry.  I don't expect users to open many duplicate pages or developers
-  // to create many identical items, so I think it's a good trade-off.
-  this.workers = {};
-
-  // These are simple lists of registered menu items and content windows.  For
-  // better performance in the best and common cases (i.e., O(1) instead of
-  // O(n)) these could be hash tables with separate chaining...
-  this.items = [];
-  this.wins = [];
-}
-
-WorkerRegistry.prototype = {
-
-  // Registers a content window, creating workers for each pair formed by the
-  // window and all previously registered menu items.
-  registerContentWin: function WR_registerContentWin(win) {
-    let winKey = this._winKey(win);
-    let (self = this) this.items.forEach(function (item) {
-      self._registerPair(win, winKey, item, self._itemKey(item));
-    });
-    this.wins.push(win);
-  },
-
-  // Registers an array of menu items, creating workers for each pair formed by
-  // the items and all previously registered content windows.
-  registerItems: function WR_registerItems(items) {
-    let (self = this) items.forEach(function (item) {
-      let itemKey = self._itemKey(item);
-      self.workers[itemKey] = self.workers[itemKey] || {};
-      self.wins.forEach(function (win) {
-        self._registerPair(win, self._winKey(win), item, itemKey);
-      });
-      self.items.push(item);
-    });
-  },
-
-  // Unregisters a content window, destroying all workers related to it.
-  unregisterContentWin: function WR_unregisterContentWin(win) {
-    let winKey = this._winKey(win);
-    let (self = this) this.items.forEach(function (item) {
-      let itemKey = self._itemKey(item);
-      let list = self._unregisterPair(win, winKey, item, itemKey);
-
-      // Delete the window column (of this item row) if there are no more
-      // entries.
-      if (!list.length)
-        delete self.workers[itemKey][winKey];
-    });
-
-    let idx = this.wins.indexOf(win);
-    if (idx < 0)
-      throw new Error("Internal error: window not registered.");
-    this.wins.splice(idx, 1);
-  },
-
-  // Unregisters an array of menu items, destroying all workers related to them.
-  unregisterItems: function WR_unregisterItems(items) {
-    let (self = this) items.forEach(function (item) {
-      let allEmpty = true;
-      let itemKey = self._itemKey(item);
-      self.wins.forEach(function (win) {
-        let list = self._unregisterPair(win, self._winKey(win), item, itemKey);
-        allEmpty = allEmpty && !list.length;
-      });
-
-      // Delete the item row if there are no more entries in any of its window
-      // columns.
-      if (allEmpty)
-        delete self.workers[itemKey];
-
-      let idx = self.items.indexOf(item);
-      if (idx < 0)
-        throw new Error("Internal error: item not registered.");
-      self.items.splice(idx, 1);
-    });
-  },
-
-  // Returns the worker for the given content-window-item pair, or null if none
-  // exists.
-  find: function WR_find(contentWin, item) {
-    let itemKey = this._itemKey(item);
-    if (itemKey in this.workers) {
-      let wins = this.workers[itemKey];
-      let winKey = this._winKey(contentWin);
-      if (winKey in wins) {
-        let list = wins[winKey];
-        let idx = this._indexOfPair(list, contentWin, item);
-        if (idx >= 0)
-          return list[idx].worker;
-      }
-    }
-    return null;
-  },
-
-  _registerPair: function WR__registerPair(win, winKey, item, itemKey) {
-    let worker = this._makeWorker(win, item);
-    this.workers[itemKey][winKey] = this.workers[itemKey][winKey] || [];
-    this.workers[itemKey][winKey].push({
-      win: win,
-      item: item,
-      worker: worker
-    });
-  },
-
-  _unregisterPair: function WR__unregisterPair(win, winKey, item, itemKey) {
-    if (!(itemKey in this.workers))
-      throw new Error("Internal error: item key not in registry.");
-    if (!(winKey in this.workers[itemKey]))
-      throw new Error("Internal error: window key not in registry.");
-    let list = this.workers[itemKey][winKey];
-    let idx = this._indexOfPair(list, win, item);
-    if (idx < 0)
-      throw new Error("Internal error: target pair not found.");
-    list[idx].worker.destroy();
-    list.splice(idx, 1);
-    return list;
-  },
-
-  _indexOfPair: function WR__indexOfPair(list, win, item) {
-    let idx = 0;
-    for (; idx < list.length; idx++)
-      if (list[idx].win === win && list[idx].item === item)
-        break;
-    return idx >= list.length ? -1 : idx;
-  },
-
-  _makeWorker: function WR__makeWorker(win, item) {
-    let worker = ContextMenuWorker({
-      window: win.wrappedJSObject,
-      contentScript: item.contentScript,
-      contentScriptFile: item.contentScriptFile,
-      onError: function (err) console.exception(err)
-    });
-    worker.on("message", function workerOnMessage(msg) {
-      if (item.onMessage) {
-        try {
-          item.onMessage(msg);
-        }
-        catch (err) {
-          console.exception(err);
-        }
-      }
-    });
-    return worker;
-  },
-
-  _winKey: function WR__winKey(win) {
-    return win.document.URL;
-  },
-
-  _itemKey: function WR__itemKey(item) {
-    // We rely on label remaining constant over the lifetime of the item.
-    return item.label;
-  }
-};
-
-
-// Keeps track of a single browser window.  Responsible for providing a
-// description of the window's current context and determining whether an item
-// matches the current context.
-//
-// TODO: If other apps besides Firefox want to support the context menu in
-// whatever way is appropriate for them, plugging in a substitute for this class
-// should be the way to do it.  Make it easy for them.  See bug 560716.
-function BrowserWindow(window) {
-  this.window = window;
-  this.doc = window.document;
-
-  let popup = this.doc.getElementById("contentAreaContextMenu");
-  if (!popup)
-    throw new Error("Internal error: Context menu popup not found.");
-  this.contextMenuPopup = new ContextMenuPopup(popup, this);
-
-  // This browser window is responsible for workers related to its content
-  // windows.
-  this.workerReg = new WorkerRegistry();
-
-  // New workers are created when content windows are loaded.
-  window.gBrowser.addEventListener("DOMContentLoaded", this, false);
-
-  // Register content windows that are already open and loaded.
-  let browsers = window.gBrowser.browsers;
-  for (let i = 0; i < browsers.length; i++)
-    if (browsers[i].contentDocument.readyState === "complete")
-      this._registerContentWin(browsers[i].contentWindow);
-}
-
-BrowserWindow.prototype = {
-
-  // Adds an array of items to the window's context menu.
-  addItems: function BW_addItems(items) {
-    this.contextMenuPopup.addItems(items);
-    this.workerReg.registerItems(items);
-  },
-
-  // The context specified for a top-level item may not match exactly the real
-  // context that triggers it.  For example, if the user context-clicks a span
-  // inside an anchor, we want items that specify an anchor context to be
-  // triggered, but the real context will indicate that the span was clicked,
-  // not the anchor.  Where the real context and an item's context conflict,
-  // clients should be given the item's context, and this method can be used to
-  // make such adjustments.  Returns an adjusted popupNode.
-  adjustPopupNode: function BW_adjustPopupNode(popupNode, topLevelItem) {
-    for (let ctxt in topLevelItem.context) {
-      if (typeof(ctxt.adjustPopupNode) === "function") {
-        let ctxtNode = ctxt.adjustPopupNode(popupNode);
-        if (ctxtNode) {
-          popupNode = ctxtNode;
-          break;
-        }
-      }
-    }
-    return popupNode;
-  },
-
-  // Returns true if all of item's contexts are current in the window.
-  areAllContextsCurrent: function BW_areAllContextsCurrent(item, popupNode) {
-    let worker = this.workerReg.find(popupNode.ownerDocument.defaultView, item);
-
-    // If the worker for the content-window-item pair doesn't exist (e.g.,
-    // because the page hasn't loaded yet), we can't really make a good decision
-    // since the content script may have a context listener.  So just don't show
-    // the item at all.
-    if (!worker)
-      return false;
-
-    // If there are no contexts given at all, the page context applies.
-    let hasContentContext = worker.anyContextListeners();
-    if (!hasContentContext && !item.context.length)
-      return new PageContext().isCurrent(popupNode);
-
-    // Otherwise, determine if all given contexts are current.  Evaluate the
-    // declarative contexts first and the worker's context listeners last.  That
-    // way the listener might be able to avoid some work.
-    let curr = true;
-    for (let ctxt in item.context) {
-      curr = curr && ctxt.isCurrent(popupNode);
-      if (!curr)
-        return false;
-    }
-    return !hasContentContext || worker.isAnyContextCurrent(popupNode);
-  },
-
-  // Sets this.popupNode to the node the user context-clicked to invoke the
-  // context menu.  For Gecko 2.0 and later, triggerNode is this node; if it's
-  // falsey, document.popupNode is used.  Returns the popupNode.
-  capturePopupNode: function BW_capturePopupNode(triggerNode) {
-    this.popupNode = triggerNode || this.doc.popupNode;
-    if (!this.popupNode)
-      console.warn("popupNode is null.");
-    return this.popupNode;
-  },
-
-  // Undoes all modifications to the window's context menu.  The BrowserWindow
-  // should not be used afterward.
-  destroy: function BW_destroy() {
-    this.contextMenuPopup.destroy();
-    this.window.gBrowser.removeEventListener("DOMContentLoaded", this, false);
-    let (self = this) this.workerReg.wins.forEach(function (win) {
-      self._unregisterContentWin(win);
-    });
-  },
-
-  // Emits a click event in the port of the content worker related to item and
-  // popupNode's content window.  Listeners will be passed popupNode and
-  // clickedItemData.
-  fireClick: function BW_fireClick(item, popupNode, clickedItemData) {
-    let worker = this.workerReg.find(popupNode.ownerDocument.defaultView, item);
-    if (worker)
-      worker.fireClick(popupNode, clickedItemData);
-  },
-
-  // Removes an array of items from the window's context menu.
-  removeItems: function BW_removeItems(items) {
-    this.contextMenuPopup.removeItems(items);
-    this.workerReg.unregisterItems(items);
-  },
-
-  // Handles content window loads and unloads.
-  handleEvent: function BW_handleEvent(event) {
-    try {
-      switch (event.type) {
-      case "DOMContentLoaded":
-        if (event.target.defaultView)
-          this._registerContentWin(event.target.defaultView);
-        break;
-      case "unload":
-        this._unregisterContentWin(event.target.defaultView);
-        break;
-      }
-    }
-    catch (err) {
-      console.exception(err);
-    }
-  },
-
-  _registerContentWin: function BW__registerContentWin(win) {
-    win.addEventListener("unload", this, false);
-    this.workerReg.registerContentWin(win);
-  },
-
-  _unregisterContentWin: function BW__unregisterContentWin(win) {
-    win.removeEventListener("unload", this, false);
-    this.workerReg.unregisterContentWin(win);
-  }
-};
-
-
-// Represents a container of items that's the child of the given Menu and Popup.
-// popupElt is a <menupopup> that represents the popup in the DOM, and window is
-// the BrowserWindow containing the popup.  The popup is responsible for
-// creating and adding items to poupElt and handling command events.
-function Popup(parentMenu, parentPopup, popupElt, window) {
-  this.parentMenu = parentMenu;
-  this.parentPopup = parentPopup;
-  this.popupElt = popupElt;
-  this.window = window;
-  this.doc = popupElt.ownerDocument;
-
-  // Keeps track of the DOM elements owned by this popup: { item, elt }.
-  this.itemWrappers = [];
-
-  popupElt.addEventListener("command", this, false);
-}
-
-Popup.prototype = {
-
-  // Adds an array of items to the popup.
-  addItems: function Popup_addItems(items) {
-    for (let i = 0; i < items.length; i++) {
-      let wrapper = { item: items[i], elt: this._makeItemElt(items[i]) };
-      this.itemWrappers.push(wrapper);
-      this.popupElt.appendChild(wrapper.elt);
-    }
-  },
-
-  // Undoes all modifications to the popup.  The popup should not be used
-  // afterward.
-  destroy: function Popup_destroy() {
-    this.popupElt.removeEventListener("command", this, false);
-  },
-
-  // The popup is responsible for two command events: those originating at items
-  // in the popup and those bubbling to the popup's parent menu.  In the first
-  // case the popup dispatches a click to the item, and in the second the popup
-  // dispatches a click to its parent menu -- in that order.
-  handleEvent: function Popup_handleEvent(event) {
-    try {
-      let elt = event.target;
-      if (elt.className.split(/\s+/).indexOf(ITEM_CLASS) >= 0) {
-        // If the event originated at an item in the popup, dispatch a click.
-        // Also set Popup.clickedItem and popupNode so ancestor popups know
-        // which item was clicked and under what context.
-        let childItemWrapper = this._findItemWrapper(elt);
-        if (childItemWrapper) {
-          let clickedItem = childItemWrapper.item;
-          let topLevelItem = this._topLevelItem(clickedItem);
-          let popupNode = this.window.adjustPopupNode(this.window.popupNode,
-                                                      topLevelItem);
-          Popup.clickedItem = clickedItem;
-          Popup.popupNode = popupNode;
-          this.window.fireClick(clickedItem, popupNode, clickedItem.data);
-        }
-
-        // Dispatch a click to this popup's parent menu.
-        if (this.parentMenu) {
-          this.window.fireClick(this.parentMenu, Popup.popupNode,
-                                Popup.clickedItem.data);
-        }
-      }
-    }
-    catch (err) {
-      console.exception(err);
-    }
-  },
-
-  // Returns true if the DOM element is owned by the wrapper.
-  _eltMatchesItemWrapper: function Popup__eltMatchesItemWrap(elt, itemWrapper) {
-    return elt == itemWrapper.elt;
-  },
-
-  // Given a DOM element, returns the item wrapper that owns it or null if none.
-  _findItemWrapper: function Popup__findItemWrapper(elt) {
-    for (let i = 0; i < this.itemWrappers.length; i++) {
-      let wrapper = this.itemWrappers[i];
-      if (this._eltMatchesItemWrapper(elt, wrapper))
-        return wrapper;
-    }
-    return null;
-  },
-
-  // Returns a DOM element representing the item.  All elements will have the
-  // ITEM_CLASS class, and className can optionally be used to add another.
-  _makeItemElt: function Popup__makeItemElt(item, className) {
-    let elt = item instanceof Item ? this._makeMenuitem(item, className) :
-              item instanceof Menu ? this._makeMenu(item, className) :
-              item instanceof Separator ? this._makeSeparator(className) :
-              null;
-    if (!elt)
-      throw new Error("Internal error: can't make element, unknown item type");
-
-    return elt;
-  },
-
-  // Returns a new <menu> representing the menu.
-  _makeMenu: function Popup__makeMenu(menu, className) {
-    let menuElt = this.doc.createElement("menu");
-    menuElt.className = ITEM_CLASS + (className ? " " + className : "");
-    menuElt.setAttribute("label", menu.label);
-    let popupElt = this.doc.createElement("menupopup");
-    menuElt.appendChild(popupElt);
-
-    // Once items are added, this value can be thrown away.  The popup handles
-    // popupshowing on its own.
-    let popup = new Popup(menu, this, popupElt, this.window);
-    popup.addItems(menu.items);
-
-    return menuElt;
-  },
-
-  // Returns a new <menuitem> representing the item.
-  _makeMenuitem: function Popup__makeMenuitem(item, className) {
-    let elt = this.doc.createElement("menuitem");
-    elt.className = ITEM_CLASS + (className ? " " + className : "");
-    elt.setAttribute("label", item.label);
-    if (item.data)
-      elt.setAttribute("value", item.data);
-    return elt;
-  },
-
-  // Returns a new <menuseparator>.
-  _makeSeparator: function Popup__makeSeparator(className) {
-    let elt = this.doc.createElement("menuseparator");
-    elt.className = ITEM_CLASS + (className ? " " + className : "");
-    return elt;
-  },
-
-  // Returns the top-level menu that contains item or item if it is top-level.
-  _topLevelItem: function Popup__topLevelItem(item) {
-    let popup = this;
-    let topLevelItem = item;
-    while (popup.parentPopup) {
-      topLevelItem = popup.parentMenu;
-      popup = popup.parentPopup;
-    }
-    return topLevelItem;
-  }
-};
-
-
-// A subclass of Popup, this represents a window's context menu popup.  It's
-// responsible for hiding and showing items according to the window's current
-// context.
-function ContextMenuPopup(popupElt, window) {
-  const self = this;
-  Popup.call(this, null, null, popupElt, window);
-
-  // Adds an array of items to the popup.
-  this.addItems = function CMP_addItems(items) {
-    // Don't do anything if there are no items.
-    if (items.length) {
-      ensureStaticEltsExist();
-      ensureListeningForPopups();
-
-      // Add each item to the top-level menu and the overflow submenu.
-      let submenuPopup = overflowPopup();
-      for (let i = 0; i < items.length; i++) {
-        let item = items[i];
-        let wrapper = {
-          item: item,
-          elt: this._makeItemElt(item, TOPLEVEL_ITEM_CLASS),
-          overflowElt: this._makeItemElt(item, OVERFLOW_ITEM_CLASS)
-        };
-        this.itemWrappers.push(wrapper);
-
-        let targetElt = insertionPoint(item.label, topLevelElts());
-        this.popupElt.insertBefore(wrapper.elt, targetElt);
-
-        targetElt = insertionPoint(item.label, overflowElts());
-        submenuPopup.insertBefore(wrapper.overflowElt, targetElt);
-      }
-    }
-  };
-
-  // Undoes all modifications to the popup.  The popup should not be used
-  // afterward.
-  this.destroy = function CMP_destroy() {
-    // Remove all the items registered with this instance of the module from the
-    // top-level menu and overflow submenu.
-    let submenuPopup = overflowPopup();
-    for (let i = 0; i < this.itemWrappers.length; i++) {
-      this.popupElt.removeChild(this.itemWrappers[i].elt);
-      if (submenuPopup)
-        submenuPopup.removeChild(this.itemWrappers[i].overflowElt);
-    }
-
-    // If there are no more items from any instance of the module, remove the
-    // separator and overflow submenu, if they exist.
-    let elts = topLevelElts();
-    if (!elts.length) {
-      let submenu = overflowMenu();
-      if (submenu)
-        this.popupElt.removeChild(submenu);
-
-      let sep = separator();
-      if (sep)
-        this.popupElt.removeChild(sep);
-    }
-
-    // Remove event listeners.
-    if (this._listeningForPopups) {
-      this.popupElt.removeEventListener("popupshowing", this, false);
-      delete this._listeningForPopups;
-    }
-    this.__proto__.destroy.call(this);
-  };
-
-  // The context menu popup needs to handle popupshowing in addition to command
-  // events.  popupshowing is used to show top-level items that match the
-  // window's current context and hide items that don't.  Each module instance
-  // is responsible for showing and hiding the items it owns.
-  this.handleEvent = function CMP_handleEvent(event) {
-    if (event.type === "command") {
-      this.__proto__.handleEvent.call(this, event);
-    }
-    else if (event.type === "popupshowing" && event.target === popupElt) {
-      try {
-        // popupElt.triggerNode was added in Gecko 2.0 by bug 383930.  The || is
-        // to avoid a Spidermonkey strict warning on earlier versions.
-        let triggerNode = popupElt.triggerNode || undefined;
-        let popupNode = window.capturePopupNode(triggerNode);
-
-        // Show and hide items.  Set a "jetpackContextCurrent" property on the
-        // DOM elements to signal which of our items match the current context.
-        this.itemWrappers.forEach(function (wrapper) {
-          let contextCurr = window.areAllContextsCurrent(wrapper.item,
-                                                         popupNode);
-          wrapper.elt.jetpackContextCurrent = contextCurr;
-          wrapper.overflowElt.jetpackContextCurrent = contextCurr;
-          wrapper.elt.hidden = !contextCurr;
-          wrapper.overflowElt.hidden = !contextCurr;
-        });
-
-        // Get the total number of items that match the current context.  It's a
-        // little tricky:  There may be other instances of this module loaded,
-        // each hiding and showing their items.  So we can't base this number on
-        // only our items, or on the hidden state of items.  That's why we set
-        // the jetpackContextCurrent property above.  The last instance to run
-        // will leave the menupopup in the correct state.
-        let elts = topLevelElts();
-        let numShown = Array.reduce(elts, function (total, elt) {
-          return total + (elt.jetpackContextCurrent ? 1 : 0);
-        }, 0);
-
-        // If too many items are shown, show the submenu and hide the top-level
-        // items.  Otherwise, hide the submenu and show the top-level items.
-        let overflow = numShown > overflowThreshold();
-        if (overflow)
-          Array.forEach(elts, function (e) e.hidden = true);
-
-        let submenu = overflowMenu();
-        if (submenu)
-          submenu.hidden = !overflow;
-
-        // If no items are shown, hide the menu separator.
-        let sep = separator();
-        if (sep)
-          sep.hidden = numShown === 0;
-      }
-      catch (err) {
-        console.exception(err);
-      }
-    }
-  };
-
-  // Removes an array of items from the popup.
-  this.removeItems = function CMP_removeItems(items) {
-    let overPopup = overflowPopup();
-    for (let i = 0; i < items.length; i++) {
-      let idx = indexOfItemWrapper(items[i]);
-      if (idx < 0) {
-        // Don't throw here; continue the loop.
-        let err = new Error("Internal error: item for removal not found.");
-        console.exception(err);
-      }
-
-      let wrapper = this.itemWrappers[idx];
-      this.popupElt.removeChild(wrapper.elt);
-      overPopup.removeChild(wrapper.overflowElt);
-      this.itemWrappers.splice(idx, 1);
-    }
-  };
-
-  // Returns true if the DOM element is owned by the wrapper.
-  this._eltMatchesItemWrapper = function CMP__eltMatchesWrap(elt, itemWrapper) {
-    return elt == itemWrapper.elt || elt == itemWrapper.overflowElt;
-  };
-
-  // Adds the popupshowing listener if it hasn't been added already.
-  function ensureListeningForPopups() {
-    if (!self._listeningForPopups) {
-      self.popupElt.addEventListener("popupshowing", self, false);
-      self._listeningForPopups = true;
-    }
-  }
-
-  // Adds the menu separator and overflow submenu if they don't exist.
-  function ensureStaticEltsExist() {
-    let sep = separator();
-    if (!sep) {
-      sep = makeSeparator();
-      self.popupElt.appendChild(sep);
-    }
-
-    let submenu = overflowMenu();
-    if (!submenu) {
-      submenu = makeOverflowMenu();
-      self.popupElt.insertBefore(submenu, sep.nextSibling);
-    }
-  }
-
-  // Returns the index of the item wrapper containing item, -1 if none.
-  function indexOfItemWrapper(item) {
-    for (let i = 0; i < self.itemWrappers.length; i++) {
-      if (self.itemWrappers[i].item === item)
-        return i;
-    }
-    return -1;
-  }
-
-  // Creates and returns the <menu> that's shown when too many items are added
-  // to the popup.
-  function makeOverflowMenu() {
-    let submenu = self.doc.createElement("menu");
-    submenu.id = OVERFLOW_MENU_ID;
-    submenu.setAttribute("label", OVERFLOW_MENU_LABEL);
-    let popup = self.doc.createElement("menupopup");
-    popup.id = OVERFLOW_POPUP_ID;
-    submenu.appendChild(popup);
-    return submenu;
-  }
-
-  // Creates and returns the <menuseparator> that separates the standard context
-  // menu items from our items.
-  function makeSeparator() {
-    let elt = self.doc.createElement("menuseparator");
-    elt.id = SEPARATOR_ID;
-    return elt;
-  }
-
-  // Returns the item elements contained in the overflow menu, a NodeList.
-  function overflowElts() {
-    return overflowPopup().getElementsByClassName(OVERFLOW_ITEM_CLASS);
-  }
-
-  // Returns the overflow <menu>.
-  function overflowMenu() {
-    return self.doc.getElementById(OVERFLOW_MENU_ID);
-  }
-
-  // Returns the overflow <menupopup>.
-  function overflowPopup() {
-    return self.doc.getElementById(OVERFLOW_POPUP_ID);
-  }
-
-  // Returns the OVERFLOW_THRESH_PREF pref value if it exists or
-  // OVERFLOW_THRESH_DEFAULT if it doesn't.
-  function overflowThreshold() {
-    let prefs = require("preferences-service");
-    return prefs.get(OVERFLOW_THRESH_PREF, OVERFLOW_THRESH_DEFAULT);
-  }
-
-  // Returns the <menuseparator>.
-  function separator() {
-    return self.doc.getElementById(SEPARATOR_ID);
-  }
-
-  // Returns the item elements contained in the top-level menu, a NodeList.
-  function topLevelElts() {
-    return self.popupElt.getElementsByClassName(TOPLEVEL_ITEM_CLASS);
-  }
-};
-
-ContextMenuPopup.prototype = Popup.prototype;
-
-
-// Init the browserManager only after setting prototypes and such above, because
-// it will cause browserManager.onTrack to be called immediately if there are
-// open windows.
-browserManager.init();
deleted file mode 100644
--- a/packages/addon-kit/lib/notifications.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et filetype=javascript
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Drew Willcoxon <adw@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const { Cc, Ci } = require("chrome");
-const apiUtils = require("api-utils");
-const errors = require("errors");
-
-try {
-  // The unit test sets this to a mock alert service.
-  var gAlertServ = Cc["@mozilla.org/alerts-service;1"].
-                   getService(Ci.nsIAlertsService);
-}
-catch (err) {
-  // An exception will be thrown if the platform doesn't provide an alert
-  // service, e.g., if Growl is not installed on OS X.  In that case, create a
-  // mock alert service that just logs to the console.
-  gAlertServ = {
-    showAlertNotification: function (iconURL, title, text) {
-      title = title ? "[" + title + "]" : "";
-      text = text || "";
-      let str = [title, text].filter(function (s) s).join(" ");
-      console.log(str);
-    }
-  };
-}
-
-exports.notify = function notifications_notify(options) {
-  let valOpts = validateOptions(options);
-  let clickObserver = !valOpts.onClick ? null : {
-    observe: function notificationClickObserved(subject, topic, data) {
-      if (topic === "alertclickcallback")
-        errors.catchAndLog(valOpts.onClick).call(options, valOpts.data,
-                                                 options);
-    }
-  };
-  gAlertServ.showAlertNotification(valOpts.iconURL, valOpts.title,
-                                   valOpts.text, !!clickObserver, valOpts.data,
-                                   clickObserver);
-};
-
-function validateOptions(options) {
-  return apiUtils.validateOptions(options, {
-    data: {
-      is: ["string", "undefined"]
-    },
-    iconURL: {
-      is: ["string", "undefined"]
-    },
-    onClick: {
-      is: ["function", "undefined"]
-    },
-    text: {
-      is: ["string", "undefined"]
-    },
-    title: {
-      is: ["string", "undefined"]
-    }
-  });
-}
deleted file mode 100644
--- a/packages/addon-kit/lib/page-mod.js
+++ /dev/null
@@ -1,193 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack Packages.
- *
- * The Initial Developer of the Original Code is Nickolay Ponomarev.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Nickolay Ponomarev <asqueella@gmail.com> (Original Author)
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-"use strict";
-
-const observers = require("observer-service");
-const { Worker, Loader } = require('content');
-const { EventEmitter } = require('events');
-const { List } = require('list');
-const { Registry } = require('utils/registry');
-const xulApp = require("xul-app");
-const { MatchPattern } = require('match-pattern');
-
-// Whether or not the host application dispatches a document-element-inserted
-// notification when the document element is inserted into the DOM of a page.
-// The notification was added in Gecko 2.0b6, it's a better time to attach
-// scripts with contentScriptWhen "start" than content-document-global-created,
-// since libraries like jQuery assume the presence of the document element.
-const HAS_DOCUMENT_ELEMENT_INSERTED =
-        xulApp.versionInRange(xulApp.platformVersion, "2.0b6", "*");
-const ON_CONTENT = HAS_DOCUMENT_ELEMENT_INSERTED ? 'document-element-inserted' :
-                   'content-document-global-created';
-const ON_READY = 'DOMContentLoaded';
-const ERR_INCLUDE = 'The PageMod must have a string or array `include` option.';
-
-// rules registry
-const RULES = {};
-
-const Rules = EventEmitter.resolve({ toString: null }).compose(List, {
-  add: function() Array.slice(arguments).forEach(function onAdd(rule) {
-    if (this._has(rule)) return;
-    // registering rule to the rules registry
-    if (!(rule in RULES))
-      RULES[rule] = new MatchPattern(rule);
-    this._add(rule);
-    this._emit('add', rule);
-  }.bind(this)),
-  remove: function() Array.slice(arguments).forEach(function onRemove(rule) {
-    if (!this._has(rule)) return;
-    this._remove(rule);
-    this._emit('remove', rule);
-  }.bind(this)),
-});
-
-/**
- * PageMod constructor (exported below).
- * @constructor
- */
-const PageMod = Loader.compose(EventEmitter, {
-  on: EventEmitter.required,
-  _listeners: EventEmitter.required,
-  contentScript: Loader.required,
-  contentScriptFile: Loader.required,
-  contentScriptWhen: Loader.required,
-  include: null,
-  constructor: function PageMod(options) {
-    this._onAttach = this._onAttach.bind(this);
-    this._onReady = this._onReady.bind(this);
-    this._onContent = this._onContent.bind(this);
-    options = options || {};
-
-    if ('contentScript' in options)
-      this.contentScript = options.contentScript;
-    if ('contentScriptFile' in options)
-      this.contentScriptFile = options.contentScriptFile;
-    if ('contentScriptWhen' in options)
-      this.contentScriptWhen = options.contentScriptWhen;
-    if ('onAttach' in options)
-      this.on('attach', options.onAttach);
-    if ('onError' in options)
-      this.on('error', options.onError);
-
-    let include = options.include;
-    let rules = this.include = Rules();
-    rules.on('add', this._onRuleAdd = this._onRuleAdd.bind(this));
-    rules.on('remove', this._onRuleRemove = this._onRuleRemove.bind(this));
-    try {
-      if (Array.isArray(include))
-        rules.add.apply(null, include);
-      else
-        rules.add(include);
-    }
-    catch(e) {
-      throw new Error(ERR_INCLUDE)
-    }
-
-    this.on('error', this._onUncaughtError = this._onUncaughtError.bind(this));
-    pageModManager.add(this._public);
-  },
-  destroy: function destroy() {
-    pageModManager.remove(this._public);
-  },
-  _onContent: function _onContent(window) {
-    if (!pageModManager.has(this))
-      return; // not registered yet
-    if ('ready' == this.contentScriptWhen)
-      window.addEventListener(ON_READY, this._onReady , false);
-    else
-      this._onAttach(window);
-  },
-  _onReady: function _onReady(event) {
-    let window = event.target.defaultView;
-    window.removeEventListener(ON_READY, this._onReady, false);
-    this._onAttach(window);
-  },
-  _onAttach: function _onAttach(window) {
-    this._emit('attach', Worker({
-      window: window.wrappedJSObject,
-      contentScript: this.contentScript,
-      contentScriptFile: this.contentScriptFile,
-      onError: this._onUncaughtError
-    }), this._public);
-  },
-  _onRuleAdd: function _onRuleAdd(url) {
-    pageModManager.on(url, this._onContent);
-  },
-  _onRuleRemove: function _onRuleRemove(url) {
-    pageModManager.off(url, this._onContent);
-  },
-  _onUncaughtError: function _onUncaughtError(e) {
-    if (this._listeners('error').length == 1)
-      console.exception(e);
-  }
-});
-exports.PageMod = function(options) PageMod(options)
-exports.PageMod.prototype = PageMod.prototype;
-
-const PageModManager = Registry.resolve({
-  constructor: '_init',
-  _destructor: '_registryDestructor'
-}).compose({
-  constructor: function PageModRegistry(constructor) {
-    this._init(PageMod);
-    observers.add(
-      ON_CONTENT, this._onContentWindow = this._onContentWindow.bind(this)
-    );
-  },
-  _destructor: function _destructor() {
-    observers.remove(ON_CONTENT, this._onContentWindow);
-    for (let rule in RULES) {
-      this._removeAllListeners(rule);
-      delete RULES[rule];
-    }
-    this._registryDestructor();
-  },
-  _onContentWindow: function _onContentWindow(domObj) {
-    let window = HAS_DOCUMENT_ELEMENT_INSERTED ? domObj.defaultView : domObj;
-    for (let rule in RULES)
-      if (RULES[rule].test(window.document.URL))
-        this._emit(rule, window);
-  },
-  off: function off(topic, listener) {
-    this.removeListener(topic, listener);
-    if (!this._listeners(topic).length)
-      delete RULES[topic];
-  }
-});
-const pageModManager = PageModManager();
deleted file mode 100644
--- a/packages/addon-kit/lib/page-worker.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Felipe Gomes <felipc@gmail.com> (Original Author)
- *   Myk Melez <myk@mozilla.org>
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *   Drew Willcoxon <adw@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-"use strict";
-
-const { Symbiont } = require("content");
-const { Trait } = require("traits");
-
-const ERR_DESTROYED =
-  "The page has been destroyed and can no longer be used.";
-
-if (!require("xul-app").isOneOf(["Firefox", "Thunderbird"])) {
-  throw new Error([
-    "The page-worker module currently supports only Firefox and Thunderbird. ",
-    "In the future, we would like it to support other applications, however. ",
-    "Please see https://bugzilla.mozilla.org/show_bug.cgi?id=546740 for more ",
-    "information."
-  ].join(""));
-}
-
-const Page = Trait.compose(
-  Symbiont.resolve({
-    constructor: '_initSymbiont',
-    postMessage: '_postMessage'
-  }),
-  {
-    _frame: Trait.required,
-    _initFrame: Trait.required,
-
-    constructor: function Page(options) {
-      options = options || {};
-
-      this.contentURL = 'contentURL' in options ? options.contentURL
-        : 'about:blank';
-      if ('contentScriptWhen' in options)
-        this.contentScriptWhen = options.contentScriptWhen;
-      if ('contentScriptFile' in options)
-        this.contentScriptFile = options.contentScriptFile;
-      if ('contentScript' in options)
-        this.contentScript = options.contentScript;
-      if ('allow' in options)
-        this.allow = options.allow;
-      if ('onError' in options)
-        this.on('error', options.onError);
-      if ('onMessage' in options)
-        this.on('message', options.onMessage);
-
-      this.on('propertyChange', this._onChange.bind(this));
-
-      this._initSymbiont();
-    },
-    postMessage: function postMessage(message) {
-      if (!this._frame)
-        throw new Error(ERR_DESTROYED);
-      this._postMessage(message);
-    },
-    destroy: function destroy() {
-      this._destructor();
-    },
-    _onChange: function _onChange(e) {
-      if ('contentURL' in e)
-        this._initFrame(this._frame);
-    }
-  }
-);
-exports.Page = function(options) Page(options);
-exports.Page.prototype = Page.prototype;
deleted file mode 100644
--- a/packages/addon-kit/lib/panel.js
+++ /dev/null
@@ -1,286 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is Mozilla.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Myk Melez <myk@mozilla.org> (Original Author)
- *   Irakli Gozalishvili <gozala@mazilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The panel module currently supports only Firefox.  In the future ",
-    "we would like it to support other applications, however.  Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=jetpack-panel-apps ",
-    "for more information."
-  ].join(""));
-}
-
-const { Ci } = require("chrome");
-const { validateOptions: valid } = require("api-utils");
-const { Symbiont } = require("content");
-const { EventEmitter } = require('events');
-
-require("xpcom").utils.defineLazyServiceGetter(
-  this,
-  "windowMediator",
-  "@mozilla.org/appshell/window-mediator;1",
-  "nsIWindowMediator"
-);
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
-      ON_SHOW = 'popupshown',
-      ON_HIDE = 'popuphidden',
-      validNumber = { is: ['number', 'undefined', 'null'] };
-
-/**
- * Emits show and hide events.
- */
-const Panel = Symbiont.resolve({
-  constructor: '_init',
-  _onInit: '_onSymbiontInit',
-  _destructor: '_symbiontDestructor'
-}).compose({
-  _frame: Symbiont.required,
-  _init: Symbiont.required,
-  _onSymbiontInit: Symbiont.required,
-  _symbiontDestructor: Symbiont.required,
-  _emit: Symbiont.required,
-  _asyncEmit: Symbiont.required,
-  on: Symbiont.required,
-  removeListener: Symbiont.required,
-  _destructor: Symbiont.required,
-
-  _inited: false,
-
-  /**
-   * If set to `true` frame loaders between xul panel frame and
-   * hidden frame are swapped. If set to `false` frame loaders are
-   * set back to normal. Setting the value that was already set will
-   * have no effect.
-   */
-  set _frameLoadersSwapped(value) {
-    if (this.__frameLoadersSwapped == value) return;
-    this._frame.QueryInterface(Ci.nsIFrameLoaderOwner)
-      .swapFrameLoaders(this._viewFrame);
-    this.__frameLoadersSwapped = value;
-  },
-  __frameLoadersSwapped: false,
-
-  constructor: function Panel(options) {
-    this._onShow = this._onShow.bind(this);
-    this._onHide = this._onHide.bind(this);
-    this.on('inited', this._onSymbiontInit.bind(this));
-
-    options = options || {};
-    if ('onShow' in options)
-      this.on('show', options.onShow);
-    if ('onHide' in options)
-      this.on('hide', options.onHide);
-    if ('width' in options)
-      this.width = options.width;
-    if ('height' in options)
-      this.height = options.height;
-    if ('contentURL' in options)
-      this.contentURL = options.contentURL;
-
-    this._init(options);
-  },
-  _destructor: function _destructor() {
-    this.hide();
-    this._removeAllListeners('show');
-    // defer cleanup to be performed after panel gets hidden
-    this._xulPanel = null;
-    this._symbiontDestructor(this);
-    this._removeAllListeners(this, 'hide');
-  },
-  destroy: function destroy() {
-    this._destructor();
-  },
-  /* Public API: Panel.width */
-  get width() this._width,
-  set width(value)
-    this._width = valid({ $: value }, { $: validNumber }).$ || this._width,
-  _width: 320,
-  /* Public API: Panel.height */
-  get height() this._height,
-  set height(value)
-    this._height =  valid({ $: value }, { $: validNumber }).$ || this._height,
-  _height: 240,
-  /* Public API: Panel.show */
-  show: function show(anchor) {
-    anchor = anchor || null;
-    let document = getWindow(anchor).document;
-    let xulPanel = this._xulPanel;
-    if (!xulPanel) {
-      xulPanel = this._xulPanel = document.createElementNS(XUL_NS, 'panel');
-      let frame = document.createElementNS(XUL_NS, 'iframe');
-      frame.setAttribute('type', 'content');
-      frame.setAttribute('flex', '1');
-      frame.setAttribute('transparent', 'transparent');
-      xulPanel.appendChild(frame);
-      document.getElementById("mainPopupSet").appendChild(xulPanel);
-    }
-    let { width, height } = this, when = 'before_start', x, y;
-    // Open the popup by the anchor.
-    // TODO: make the XUL panel an arrow panel so it gets positioned
-    // automagically once arrow panels are implemented in bug 554937.
-    if (!anchor) {
-      // Open the popup in the middle of the window.
-      x = document.documentElement.clientWidth / 2 - width / 2;
-      y = document.documentElement.clientHeight / 2 - height / 2;
-      when = null;
-    }
-    xulPanel.sizeTo(width, height);
-    xulPanel.openPopup(anchor, when, x, y);
-    return this._public;
-  },
-  /* Public API: Panel.hide */
-  hide: function hide() {
-    // The popuphiding handler takes care of swapping back the frame loaders
-    // and removing the XUL panel from the application window, we just have to
-    // trigger it by hiding the popup.
-    // XXX Sometimes I get "TypeError: xulPanel.hidePopup is not a function"
-    // when quitting the host application while a panel is visible.  To suppress
-    // them, this now checks for "hidePopup" in xulPanel before calling it.
-    // It's not clear if there's an actual issue or the error is just normal.
-    let xulPanel = this._xulPanel;
-    if (xulPanel && "hidePopup" in xulPanel)
-      xulPanel.hidePopup();
-    return this._public;
-  },
-  
-  /* Public API: Panel.resize */
-  resize: function resize(width, height) {
-    this.width = width;
-    this.height = height;
-    this._xulPanel.sizeTo(width, height);
-  },
-  
-  // While the panel is visible, this is the XUL <panel> we use to display it.
-  // Otherwise, it's null.
-  // While the panel is visible, this is the XUL <panel> we use to display it.
-  // Otherwise, it's null.
-  get _xulPanel() this.__xulPanel,
-  set _xulPanel(value) {
-    let xulPanel = this.__xulPanel;
-    if (value === xulPanel) return;
-    if (xulPanel) {
-      xulPanel.removeEventListener(ON_HIDE, this._onHide, false);
-      xulPanel.removeEventListener(ON_SHOW, this._onShow, false);
-      xulPanel.parentNode.removeChild(xulPanel);
-    }
-    if (value) {
-      value.addEventListener(ON_HIDE, this._onHide, false);
-      value.addEventListener(ON_SHOW, this._onShow, false);
-    }
-    this.__xulPanel = value;
-  },
-  __xulPanel: null,
-  get _viewFrame() this.__xulPanel.children[0], 
-  /**
-   * When the XUL panel becomes hidden, we swap frame loaders back to move
-   * the content of the panel to the hidden frame & remove panel element.
-   */
-  _onHide: function _onHide() {
-    try {
-      this._frameLoadersSwapped = false;
-      this._xulPanel = null;
-      this._emit('hide', this._public);
-    } catch(e) {
-      this._emit('error', e);
-    }
-  },
-  /**
-   * When the XUL panel becomes shown, we swap frame loaders between panel
-   * frame and hidden frame to preserve state of the content dom.
-   */
-  _onShow: function _onShow() {
-    try {
-      if (!this._inited) // defer if not initialized yet
-        return this.on('inited', this._onShow.bind(this));
-      this._frameLoadersSwapped = true;
-      this._emit('show', this._public);
-    } catch(e) {
-      this._emit('error', e);
-    }
-  },
-  /**
-   * Notification that panel was fully initialized.
-   */
-  _onInit: function _onInit() {
-    this._inited = true;
-    // perform all deferred tasks like initSymbiont, show, hide ...
-    // TODO: We're publicly exposing a private event here; this
-    // 'inited' event should really be made private, somehow.
-    this._emit('inited');
-    this._removeAllListeners('inited');
-  }
-});
-exports.Panel = function(options) Panel(options)
-exports.Panel.prototype = Panel.prototype;
-
-function getWindow(anchor) {
-  let window;
-
-  if (anchor) {
-    let anchorWindow = anchor.ownerDocument.defaultView.top;
-    let anchorDocument = anchorWindow.document;
-
-    let enumerator = windowMediator.getEnumerator("navigator:browser");
-    while (enumerator.hasMoreElements()) {
-      let enumWindow = enumerator.getNext();
-
-      // Check if the anchor is in this browser window.
-      if (enumWindow == anchorWindow) {
-        window = anchorWindow;
-        break;
-      }
-
-      // Check if the anchor is in a browser tab in this browser window.
-      let browser = enumWindow.gBrowser.getBrowserForDocument(anchorDocument);
-      if (browser) {
-        window = enumWindow;
-        break;
-      }
-
-      // Look in other subdocuments (sidebar, etc.)?
-    }
-  }
-
-  // If we didn't find the anchor's window (or we have no anchor),
-  // return the most recent browser window.
-  if (!window)
-    window = windowMediator.getMostRecentWindow("navigator:browser");
-
-  return window;
-}
-
deleted file mode 100644
--- a/packages/addon-kit/lib/private-browsing.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Paul O’Shannessy <paul@oshannessy.com>
- *  Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const {Cc,Ci} = require("chrome");
-const observers = require("observer-service");
-const { EventEmitter } = require("events");
-const { setTimeout } = require("timer");
-const unload = require("unload");
-
-const ON_START = "start";
-const ON_STOP = "stop";
-const ON_TRANSITION = "private-browsing-transition-complete";
-
-let pbService;
-// Currently, only Firefox implements the private browsing service.
-if (require("xul-app").is("Firefox")) {
-  pbService = Cc["@mozilla.org/privatebrowsing;1"].
-              getService(Ci.nsIPrivateBrowsingService);
-}
-
-const privateBrowsing = EventEmitter.compose({
-  constructor: function PrivateBrowsing() {
-    // Binding method to instance since it will be used with `setTimeout`.
-    this._emit = this._emit.bind(this);
-    this.unload = this.unload.bind(this);
-    // Report unhandled errors from listeners
-    this.on("error", console.exception.bind(console));
-    unload.ensure(this);
-    // We only need to add observers if `pbService` exists.
-    if (pbService) {
-      observers.add(ON_TRANSITION, this.onTransition.bind(this));
-      this._isActive = pbService.privateBrowsingEnabled;
-    }
-  },
-  unload: function _destructor() {
-    this._removeAllListeners(ON_START);
-    this._removeAllListeners(ON_STOP);
-  },
-  // We don't need to do anything with cancel here.
-  onTransition: function onTransition() {
-    let isActive = this._isActive = pbService.privateBrowsingEnabled;
-    setTimeout(this._emit, 0, isActive ? ON_START : ON_STOP);
-  },
-  get isActive() this._isActive,
-  set isActive(value) {
-    if (pbService)
-      pbService.privateBrowsingEnabled = !!value;
-  },
-  _isActive: false
-})()
-
-Object.defineProperty(exports, "isActive", {
-  get: function() privateBrowsing.isActive
-});
-exports.activate = function activate() privateBrowsing.isActive = true;
-exports.deactivate = function deactivate() privateBrowsing.isActive = false;
-exports.on = privateBrowsing.on;
-exports.removeListener = privateBrowsing.removeListener;
-
deleted file mode 100644
--- a/packages/addon-kit/lib/request.js
+++ /dev/null
@@ -1,299 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Paul O’Shannessy <paul@oshannessy.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const xpcom = require("xpcom");
-const xhr = require("xhr");
-const errors = require("errors");
-const apiUtils = require("api-utils");
-
-// Ugly but will fix with: https://bugzilla.mozilla.org/show_bug.cgi?id=596248
-const EventEmitter = require('events').EventEmitter.compose({
-  constructor: function EventEmitter() this
-});
-
-// Instead of creating a new validator for each request, just make one and reuse it.
-const validator = new OptionsValidator({
-  url: {
-    //XXXzpao should probably verify that url is a valid url as well
-    is:  ["string"]
-  },
-  headers: {
-    map: function (v) v || {},
-    is:  ["object"],
-  },
-  content: {
-    map: function (v) v || null,
-    is:  ["string", "object", "null"],
-  },
-  contentType: {
-    map: function (v) v || "application/x-www-form-urlencoded",
-    is:  ["string"]
-  }
-});
-
-const REUSE_ERROR = "This request object has been used already. You must " +
-                    "create a new one to make a new request."
-
-function Request(options) {
-  const self = EventEmitter(),
-        _public = self._public;
-  // request will hold the actual XHR object
-  let request;
-  let response;
-
-  if ('onComplete' in options)
-    self.on('complete', options.onComplete)
-  options = validator.validateOptions(options);
-
-  // function to prep the request since it's the same between GET and POST
-  function makeRequest(mode) {
-    // If this request has already been used, then we can't reuse it. Throw an error.
-    if (request) {
-      throw new Error(REUSE_ERROR);
-    }
-
-    request = new xhr.XMLHttpRequest();
-
-    let url = options.url;
-    // Build the data to be set. For GET requests, we want to append that to
-    // the URL before opening the request.
-    let data = makeQueryString(options.content);
-    if (mode == "GET" && data) {
-      // If the URL already has ? in it, then we want to just use &
-      url = url + (/\?/.test(url) ? "&" : "?") + data;
-    }
-
-    // open the request
-    request.open(mode, url);
-
-    // request header must be set after open, but before send
-    request.setRequestHeader("Content-Type", options.contentType);
-
-    // set other headers
-    for (let k in options.headers) {
-      request.setRequestHeader(k, options.headers[k]);
-    }
-
-    // handle the readystate, create the response, and call the callback
-    request.onreadystatechange = function () {
-      if (request.readyState == 4) {
-        response = new Response(request);
-        errors.catchAndLog(function () {
-          self._emit('complete', response, _public);
-        })();
-      }
-    }
-
-    // actually send the request. we only want to send data on POST requests
-    request.send(mode == "POST" ? data : null);
-  }
-
-  // Map these setters/getters to the options
-  ["url", "headers", "content", "contentType"].forEach(function (k) {
-    _public.__defineGetter__(k, function () options[k]);
-    _public.__defineSetter__(k, function (v) {
-      // This will automatically rethrow errors from apiUtils.validateOptions.
-      return options[k] = validator.validateSingleOption(k, v);
-    });
-  });
-
-  // response should be available as a getter
-  _public.__defineGetter__("response", function () response);
-
-  _public.get = function () {
-    makeRequest("GET");
-    return this;
-  };
-
-  _public.post = function () {
-    makeRequest("POST");
-    return this;
-  };
-
-  return _public;
-}
-exports.Request = Request;
-
-// Converts an object of unordered key-vals to a string that can be passed
-// as part of a request
-function makeQueryString(content) {
-  // Explicitly return null if we have null, and empty string, or empty object.
-  if (!content) {
-    return null;
-  }
-
-  // If content is already a string, just return it as is.
-  if (typeof(content) == "string") {
-    return content;
-  }
-
-  // At this point we have a k:v object. Iterate over it and encode each value.
-  // Arrays and nested objects will get encoded as needed. For example...
-  //
-  //   { foo: [1, 2, { omg: "bbq", "all your base!": "are belong to us" }], bar: "baz" }
-  //
-  // will be encoded as
-  //
-  //   foo[0]=1&foo[1]=2&foo[2][omg]=bbq&foo[2][all+your+base!]=are+belong+to+us&bar=baz
-  //
-  // Keys (including "[" and "]") and values will be encoded with
-  // fixedEncodeURIComponent before returning.
-  //
-  // Execution was inspired by jQuery, but some details have changed and numeric
-  // array keys are included (whereas they are not in jQuery).
-
-  let encodedContent = [];
-  function add(key, val) {
-    encodedContent.push(fixedEncodeURIComponent(key) + "=" +
-                        fixedEncodeURIComponent(val));
-  }
-
-  function make(key, val) {
-    if (typeof(val) == "object") {
-      for ([k, v] in Iterator(val)) {
-        make(key + "[" + k + "]", v);
-      }
-    }
-    else {
-      add(key, val)
-    }
-  }
-  for ([k, v] in Iterator(content)) {
-    make(k, v);
-  }
-  return encodedContent.join("&");
-
-  //XXXzpao In theory, we can just use a FormData object on 1.9.3, but I had
-  //        trouble getting that working. It would also be nice to stay
-  //        backwards-compat as long as possible. Keeping this in for now...
-  // let formData = Cc["@mozilla.org/files/formdata;1"].
-  //                createInstance(Ci.nsIDOMFormData);
-  // for ([k, v] in Iterator(content)) {
-  //   formData.append(k, v);
-  // }
-  // return formData;
-}
-
-
-// encodes a string safely for application/x-www-form-urlencoded
-// adheres to RFC 3986
-// see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent
-function fixedEncodeURIComponent (str) {
-  return encodeURIComponent(str).replace(/%20/g, "+").replace(/!/g, "%21").
-                                 replace(/'/g, "%27").replace(/\(/g, "%28").
-                                 replace(/\)/g, "%29").replace(/\*/g, "%2A");
-}
-
-function Response(request) {
-  // Define the straight mappings of our value to original request value
-  xpcom.utils.defineLazyGetter(this, "text", function () request.responseText);
-  xpcom.utils.defineLazyGetter(this, "xml", function () {
-    throw new Error("Sorry, the 'xml' property is no longer available. " +
-                    "see bug 611042 for more information.");
-  });
-  xpcom.utils.defineLazyGetter(this, "status", function () request.status);
-  xpcom.utils.defineLazyGetter(this, "statusText", function () request.statusText);
-
-  // this.json should be the JS object, so we need to attempt to parse it.
-  xpcom.utils.defineLazyGetter(this, "json", function () {
-    let _json = null;
-    try {
-      _json = JSON.parse(this.text);
-    }
-    catch (e) {}
-    return _json;
-  });
-
-  // this.headers also should be a JS object, so we need to split up the raw
-  // headers string provided by the request.
-  xpcom.utils.defineLazyGetter(this, "headers", function () {
-    let _headers = {};
-    let lastKey;
-    // Since getAllResponseHeaders() will return null if there are no headers,
-    // defend against it by defaulting to ""
-    let rawHeaders = request.getAllResponseHeaders() || "";
-    rawHeaders.split("\n").forEach(function (h) {
-      // According to the HTTP spec, the header string is terminated by an empty
-      // line, so we can just skip it.
-      if (!h.length) {
-        return;
-      }
-
-      let index = h.indexOf(":");
-      // The spec allows for leading spaces, so instead of assuming a single
-      // leading space, just trim the values.
-      let key = h.substring(0, index).trim(),
-          val = h.substring(index + 1).trim();
-
-      // For empty keys, that means that the header value spanned multiple lines.
-      // In that case we should append the value to the value of lastKey with a
-      // new line. We'll assume lastKey will be set because there should never
-      // be an empty key on the first pass.
-      if (key) {
-        _headers[key] = val;
-        lastKey = key;
-      }
-      else {
-        _headers[lastKey] += "\n" + val;
-      }
-    });
-    return _headers;
-  })
-}
-
-// apiUtils.validateOptions doesn't give the ability to easily validate single
-// options, so this is a wrapper that provides that ability.
-function OptionsValidator(rules) {
-  this.rules = rules;
-
-  this.validateOptions = function (options) {
-    return apiUtils.validateOptions(options, this.rules);
-  }
-
-  this.validateSingleOption = function (field, value) {
-    // We need to create a single rule object from our listed rules. To avoid
-    // JavaScript String warnings, check for the field & default to an empty object.
-    let singleRule = {};
-    if (field in this.rules) {
-      singleRule[field] = this.rules[field];
-    }
-    let singleOption = {};
-    singleOption[field] = value;
-    // This should throw if it's invalid, which will bubble up & out.
-    return apiUtils.validateOptions(singleOption, singleRule)[field];
-  }
-}
deleted file mode 100644
--- a/packages/addon-kit/lib/selection.js
+++ /dev/null
@@ -1,353 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is Mozilla.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Eric H. Jung <eric.jung@yahoo.com>
- *   Irakli Gozalishivili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The selection module currently supports only Firefox.  In the future ",
-    "we would like it to support other applications, however.  Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=560716 for more information."
-  ].join(""));
-}
-
-let { Ci } = require("chrome"),
-    { setTimeout } = require("timer"),
-    { EventEmitter } = require('events');
-
-// The selection type HTML
-const HTML = 0x01;
-
-// The selection type TEXT
-const TEXT = 0x02;
-
-// The selection type DOM (internal use only)
-const DOM  = 0x03;
-
-/**
- * Creates an object from which a selection can be set, get, etc. Each
- * object has an associated with a range number. Range numbers are the
- * 0-indexed counter of selection ranges as explained at
- * https://developer.mozilla.org/en/DOM/Selection.
- *
- * @param rangeNumber
- *        The zero-based range index into the selection
- */
-function Selection(rangeNumber) {
-
-  // In order to hide the private rangeNumber argument from API consumers while
-  // still enabling Selection getters/setters to access it, the getters/setters
-  // are defined as lexical closures in the Selector constructor.
-
-  this.__defineGetter__("text", function () getSelection(TEXT, rangeNumber));
-  this.__defineSetter__("text", function (str) setSelection(str, rangeNumber));
-
-  this.__defineGetter__("html", function () getSelection(HTML, rangeNumber));
-  this.__defineSetter__("html", function (str) setSelection(str, rangeNumber));
-
-  this.__defineGetter__("isContiguous", function () {
-    let sel = getSelection(DOM, rangeNumber);
-    // It isn't enough to check that rangeCount is zero. If one or more ranges
-    // are selected and then unselected, rangeCount is set to one, not zero.
-    // Therefore, if rangeCount is one, we also check if the selection is
-    // collapsed.
-    if (sel.rangeCount == 0)
-      return null;
-    if (sel.rangeCount == 1) {
-      let range = safeGetRange(sel, 0);
-      return range && range.collapsed ? null : true;
-    }
-    return false;
-  });
-}
-
-require("xpcom").utils.defineLazyServiceGetter(this, "windowMediator",
-  "@mozilla.org/appshell/window-mediator;1", "nsIWindowMediator");
-
-/**
- * Returns the most recent content window
- */
-function context() {
-  // Overlay names should probably go into the xul-app module instead of here
-  return windowMediator.getMostRecentWindow("navigator:browser").document.
-    commandDispatcher.focusedWindow;
-}
-
-/**
- * Returns the current selection from most recent content window. Depending on
- * the specified |type|, the value returned can be a string of text, stringified
- * HTML, or a DOM selection object as described at
- * https://developer.mozilla.org/en/DOM/Selection.
- *
- * @param type
- *        Specifies the return type of the selection. Valid values are the one
- *        of the constants HTML, TEXT, or DOM.
- *
- * @param rangeNumber
- *        Specifies the zero-based range index of the returned selection.
- */
-function getSelection(type, rangeNumber) {
-  let window, selection;
-  try {
-    window = context();
-    selection = window.getSelection();
-  }
-  catch (e) {
-    return null;
-  }
-
-  // Get the selected content as the specified type
-  if (type == DOM)
-    return selection;
-  else if (type == TEXT) {
-    let range = safeGetRange(selection, rangeNumber);
-    return range ? range.toString() : null;
-  }
-  else if (type == HTML) {
-    let range = safeGetRange(selection, rangeNumber);
-    // Another way, but this includes the xmlns attribute for all elements in
-    // Gecko 1.9.2+ :
-    // return Cc["@mozilla.org/xmlextras/xmlserializer;1"].
-    //   createInstance(Ci.nsIDOMSerializer).serializeToSTring(range.
-    //     cloneContents());
-    if (!range)
-      return null;
-    let node = window.document.createElement("span");
-    node.appendChild(range.cloneContents());
-    return node.innerHTML;
-  }
-  throw new Error("Type " + type + " is unrecognized.");
-}
-
-/**
- * Returns the specified range in a selection without throwing an exception.
- *
- * @param selection
- *        A selection object as described at
- *         https://developer.mozilla.org/en/DOM/Selection
- *
- * @param rangeNumber
- *        Specifies the zero-based range index of the returned selection.
- */
-function safeGetRange(selection, rangeNumber) {
-  try {
-    let range = selection.getRangeAt(rangeNumber);
-    if (!range || range.toString() == "")
-      return null;
-    return range;
-  }
-  catch (e) {
-    return null;
-  }
-}
-
-/**
- * Sets the current selection of the most recent content document by changing
- * the existing selected text/HTML range to the specified value.
- *
- * @param val
- *        The value for the new selection
- *
- * @param rangeNumber
- *        The zero-based range index of the selection to be set
- *
- */
-function setSelection(val, rangeNumber) {
-    // Make sure we have a window context & that there is a current selection.
-    // Selection cannot be set unless there is an existing selection.
-    let window, range;
-    try {
-      window = context();
-      range = window.getSelection().getRangeAt(rangeNumber);
-    }
-    catch (e) {
-      // Rethrow with a more developer-friendly message than the caught
-      // exception.
-      throw new Error("It isn't possible to change the selection, as there isn't currently a selection");
-    }
-    // Get rid of the current selection and insert our own
-    range.deleteContents();
-    let node = window.document.createElement("span");
-    range.surroundContents(node);
-
-    // Some relevant JEP-111 requirements:
-
-    // Setting the text property replaces the selection with the value to
-    // which the property is set and sets the html property to the same value
-    // to which the text property is being set.
-
-    // Setting the html property replaces the selection with the value to
-    // which the property is set and sets the text property to the text version
-    // of the HTML value.
-
-    // This sets both the HTML and text properties.
-    node.innerHTML = val;
-}
-
-function onLoad(event) {
-  SelectionListenerManager.onLoad(event);
-}
-
-function onUnload(event) {
-  SelectionListenerManager.onUnload(event);
-}
-
-let SelectionListenerManager = {
-  QueryInterface: require("xpcom").utils.generateQI([Ci.nsISelectionListener]),
-
-  // The collection of listeners wanting to be notified of selection changes
-  listeners: EventEmitter.compose({
-    emit: function emit() this._emit.apply(this, arguments),
-    off: function() this._removeAllListeners.apply(this, arguments)
-  })(),
-  /**
-   * This is the nsISelectionListener implementation. This function is called
-   * by Gecko when a selection is changed interactively.
-   *
-   * We only pay attention to the SELECTALL, KEYPRESS, and MOUSEUP selection
-   * reasons. All reasons are listed here:
-   *
-   * http://mxr.mozilla.org/mozilla1.9.2/source/content/base/public/
-   *   nsISelectionListener.idl
-   *
-   * The other reasons (NO_REASON, DRAG_REASON, MOUSEDOWN_REASON) aren't
-   * applicable to us.
-   */
-  notifySelectionChanged: function notifySelectionChanged(document, selection,
-                                                          reason) {
-    if (!["SELECTALL", "KEYPRESS", "MOUSEUP"].some(function(type) reason &
-      Ci.nsISelectionListener[type + "_REASON"]) || selection.toString() == "")
-        return;
-    setTimeout(this.listeners.emit, 0, 'select', exports)
-  },
-
-  /**
-   * Part of the Tracker implementation. This function is called by the
-   * tabs module when a browser is being tracked. Often, that means a new tab
-   * has been opened, but it can also mean an addon has been installed while
-   * tabs are already opened. In that case, this function is called for those
-   * already-opened tabs.
-   *
-   * @param browser
-   *        The browser being tracked
-   */
-  onTrack: function onTrack(browser) {
-    browser.addEventListener("load", onLoad, true);
-    browser.addEventListener("unload", onUnload, true);
-  },
-
-  onLoad: function onLoad(event) {
-    // Nothing to do without a useful window
-    let window = event.target.defaultView;
-    if (!window)
-      return;
-
-    // Wrap the add selection call with some number of setTimeout 0 because some
-    // reason it's possible to add a selection listener "too early". 2 sometimes
-    // works for gmail, and more consistently with 3, so make it 5 to be safe.
-    let count = 0;
-    let self = this;
-    function wrap(count, func) {
-      if (count-- > 0)
-        require("timer").setTimeout(wrap, 0);
-      else
-        self.addSelectionListener(window);
-    }
-    wrap();
-  },
-
-  addSelectionListener: function addSelectionListener(window) {
-    if (window.jetpack_core_selection_listener)
-      return;
-    let selection = window.getSelection();
-    if (selection instanceof Ci.nsISelectionPrivate)
-      selection.addSelectionListener(this);
-    window.jetpack_core_selection_listener = true;
-  },
-
-  onUnload: function onUnload(event) {
-    // Nothing to do without a useful window
-    let window = event.target.defaultView;
-    if (!window)
-      return;
-    this.removeSelectionListener(window);
-    this.listeners.off('error');
-    this.listeners.off('selection');
-  },
-
-  removeSelectionListener: function removeSelectionListener(window) {
-    if (!window.jetpack_core_selection_listener)
-      return;
-    let selection = window.getSelection();
-    if (selection instanceof Ci.nsISelectionPrivate)
-      selection.removeSelectionListener(this);
-    window.jetpack_core_selection_listener = false;
-  },
-
-  /**
-   * Part of the TabTracker implementation. This function is called by the
-   * tabs module when a browser is being untracked. Usually, that means a tab
-   * has been closed.
-   *
-   * @param browser
-   *        The browser being untracked
-   */
-  onUntrack: function onUntrack(browser) {
-    browser.removeEventListener("load", onLoad, true);
-    browser.removeEventListener("unload", onUnload, true);
-  }
-};
-SelectionListenerManager.listeners.on('error', console.error);
-
-/**
- * Install |SelectionListenerManager| as tab tracker in order to watch
- * tab opening/closing
- */
-require("tab-browser").Tracker(SelectionListenerManager);
-
-/**
- * Exports an iterator so that discontiguous selections can be iterated.
- */
-exports.__iterator__ = function __iterator__() {
-  for (let i = 0, sel = getSelection(DOM); i < sel.rangeCount; i++)
-    yield new Selection(i);
-};
-
-exports.on = SelectionListenerManager.listeners.on;
-exports.removeListener = SelectionListenerManager.listeners.removeListener;
-
-// Export the Selection singleton. Its rangeNumber is always zero.
-Selection.call(exports, 0);
-
deleted file mode 100644
--- a/packages/addon-kit/lib/simple-storage.js
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et filetype=javascript
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Drew Willcoxon <adw@mozilla.com> (Original Author)
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const {Cc,Ci} = require("chrome");
-const file = require("file");
-const prefs = require("preferences-service");
-const jpSelf = require("self");
-const timer = require("timer");
-const unload = require("unload");
-const { EventEmitter } = require("events");
-const { Trait } = require("traits");
-
-const WRITE_PERIOD_PREF = "jetpack.addon-kit.simple-storage.writePeriod";
-const WRITE_PERIOD_DEFAULT = 300000; // 5 minutes
-
-const QUOTA_PREF = "jetpack.addon-kit.simple-storage.quota";
-const QUOTA_DEFAULT = 5242880; // 5 MiB
-
-
-// simpleStorage.storage
-exports.__defineGetter__("storage", function () manager.root);
-exports.__defineSetter__("storage", function (val) manager.root = val);
-
-// simpleStorage.quotaUsage
-exports.__defineGetter__("quotaUsage", function () manager.quotaUsage);
-
-// A generic JSON store backed by a file on disk.  This should be isolated
-// enough to move to its own module if need be...
-function JsonStore(options) {
-  this.filename = options.filename;
-  this.quota = options.quota;
-  this.writePeriod = options.writePeriod;
-  this.onOverQuota = options.onOverQuota;
-  this.onWrite = options.onWrite;
-
-  unload.ensure(this);
-
-  this.writeTimer = timer.setInterval(this.write.bind(this),
-                                      this.writePeriod);
-}
-
-JsonStore.prototype = {
-  // The store's root.
-  get root() {
-    return this._root === undefined ? {} : this._root;
-  },
-
-  // Performs some type checking.
-  set root(val) {
-    let types = ["array", "boolean", "null", "number", "object", "string"];
-    if (types.indexOf(typeof(val)) < 0) {
-      throw new Error("storage must be one of the following types: " +
-                      types.join(", "));
-    }
-    this._root = val;
-    return val;
-  },
-
-  // Percentage of quota used, as a number [0, Inf).  > 1 implies over quota.
-  // Undefined if there is no quota.
-  get quotaUsage() {
-    return this.quota > 0 ?
-           JSON.stringify(this.root).length / this.quota :
-           undefined;
-  },
-
-  // Removes the backing file and all empty subdirectories.
-  purge: function JsonStore_purge() {
-    try {
-      // This'll throw if the file doesn't exist.
-      file.remove(this.filename);
-      let parentPath = this.filename;
-      while (true) {
-        parentPath = file.dirname(parentPath);
-        // This'll throw if the dir isn't empty.
-        file.rmdir(parentPath);
-      }
-    }
-    catch (err) {}
-  },
-
-  // Initializes the root by reading the backing file.
-  read: function JsonStore_read() {
-    try {
-      let str = file.read(this.filename);
-
-      // Ideally we'd log the parse error with console.error(), but logged
-      // errors cause tests to fail.  Supporting "known" errors in the test
-      // harness appears to be non-trivial.  Maybe later.
-      this.root = JSON.parse(str);
-    }
-    catch (err) {
-      this.root = {};
-    }
-  },
-
-  // If the store is under quota, writes the root to the backing file.
-  // Otherwise quota observers are notified and nothing is written.
-  write: function JsonStore_write() {
-    if (this.quotaUsage > 1)
-      this.onOverQuota(this);
-    else
-      this._write();
-  },
-
-  // Cleans up on unload.  If unloading because of uninstall, the store is
-  // purged; otherwise it's written.
-  unload: function JsonStore_unload(reason) {
-    timer.clearInterval(this.writeTimer);
-    this.writeTimer = null;
-
-    if (reason === "uninstall")
-      this.purge();
-    else
-      this._write();
-  },
-
-  // True if the root is an empty object.
-  get _isEmpty() {
-    if (this.root && typeof(this.root) === "object") {
-      let empty = true;
-      for (let key in this.root) {
-        empty = false;
-        break;
-      }
-      return empty;
-    }
-    return false;
-  },
-
-  // Writes the root to the backing file, notifying write observers when
-  // complete.  If the store is over quota or if it's empty and the store has
-  // never been written, nothing is written and write observers aren't notified.
-  _write: function JsonStore__write() {
-    // If the store is empty and the file doesn't yet exist, don't write.
-    if (this._isEmpty && !file.exists(this.filename))
-      return;
-
-    // If the store is over quota, don't write.  The current under-quota state
-    // should persist.
-    if (this.quotaUsage > 1)
-      return;
-
-    // Finally, write.
-    let stream = file.open(this.filename, "w");
-    try {
-      stream.writeAsync(JSON.stringify(this.root), function writeAsync(err) {
-        if (err)
-          console.error("Error writing simple storage file: " + this.filename);
-        else if (this.onWrite)
-          this.onWrite(this);
-      }.bind(this));
-    }
-    catch (err) {
-      // writeAsync closes the stream after it's done, so only close on error.
-      stream.close();
-    }
-  }
-};
-
-
-// This manages a JsonStore singleton and tailors its use to simple storage.
-// The root of the JsonStore is lazy-loaded:  The backing file is only read the
-// first time the root's gotten.
-let manager = Trait.compose(EventEmitter, Trait.compose({
-  jsonStore: null,
-
-  // The filename of the store, based on the profile dir and extension ID.
-  get filename() {
-    let storeFile = Cc["@mozilla.org/file/directory_service;1"].
-                    getService(Ci.nsIProperties).
-                    get("ProfD", Ci.nsIFile);
-    storeFile.append("jetpack");
-    storeFile.append(jpSelf.id);
-    storeFile.append("simple-storage");
-    file.mkpath(storeFile.path);
-    storeFile.append("store.json");
-    return storeFile.path;
-  },
-
-  get quotaUsage() {
-    return this.jsonStore.quotaUsage;
-  },
-
-  get root() {
-    if (!this.rootInited) {
-      this.jsonStore.read();
-      this.rootInited = true;
-    }
-    return this.jsonStore.root;
-  },
-
-  set root(val) {
-    let rv = this.jsonStore.root = val;
-    this.rootInited = true;
-    return rv;
-  },
-
-  unload: function manager_unload() {
-    this._removeAllListeners("OverQuota");
-    this._removeAllListeners("error");
-  },
-
-  // Must be called before use.
-  constructor: function manager_constructor() {
-    // Log unhandled errors.
-    this.on("error", console.exception.bind(console));
-    unload.ensure(this);
-
-    let fname = this.filename;
-    this.jsonStore = new JsonStore({
-      filename: fname,
-      writePeriod: prefs.get(WRITE_PERIOD_PREF, WRITE_PERIOD_DEFAULT),
-      quota: prefs.get(QUOTA_PREF, QUOTA_DEFAULT),
-      onOverQuota: this._emit.bind(this, "OverQuota", exports)
-    });
-  }
-}))();
-
-exports.on = manager.on;
-exports.removeListener = manager.removeListener;
-
deleted file mode 100644
--- a/packages/addon-kit/lib/tabs.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is Mozilla.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Dietrich Ayala <dietrich@mozilla.com> (Original author)
- *   Felipe Gomes <felipc@gmail.com>
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-"use strict";
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The tabs module currently supports only Firefox.  In the future ",
-    "we would like it to support other applications, however.  Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=560716 for more information."
-  ].join(""));
-}
-
-const { browserWindows } = require("windows");
-const { tabs } = require("windows/tabs");
-
-Object.defineProperties(tabs, {
-  open: { value: function open(options) {
-    if (options.inNewWindow)
-        // `tabs` option is under review and may be removed.
-        return browserWindows.open({ tabs: [ options ] });
-    // Open in active window if new window was not required.
-    return browserWindows.activeWindow.tabs.open(options);
-  }}
-});
-// It's a hack but we will be able to remove it once will implemnet CommonJS
-// feature that would allow us to override exports.
-exports.__proto__ = tabs;
deleted file mode 100644
--- a/packages/addon-kit/lib/widget.js
+++ /dev/null
@@ -1,611 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Dietrich Ayala <dietrich@mozilla.com> (Original Author)
- *   Drew Willcoxon <adw@mozilla.com>
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-const {Cc, Ci} = require("chrome");
-
-// Widget content types
-const CONTENT_TYPE_URI    = 1;
-const CONTENT_TYPE_HTML   = 2;
-const CONTENT_TYPE_IMAGE  = 3;
-
-const ERR_CONTENT = "No content or contentURL property found. Widgets must "
-                         + "have one or the other.",
-      ERR_LABEL = "The widget must have a non-empty label property.";
-
-// Supported events, mapping from DOM event names to our event names
-const EVENTS = {
-  "click": "click",
-  "mouseover": "mouseover",
-  "mouseout": "mouseout",
-};
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The widget module currently supports only Firefox.  In the future ",
-    "it will support other applications. Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=560716 for more information."
-  ].join(""));
-}
-
-const { validateOptions } = require("api-utils");
-const panels = require("panel");
-const { EventEmitter } = require("events");
-const { Trait } = require("traits");
-const { Loader, Symbiont } = require("content");
-
-const valid = {
-  number: { is: ["null", "undefined", "number"] },
-  string: { is: ["null", "undefined", "string"] },
-  label: {
-    is: ["string"],
-    ok: function (v) v.length > 0,
-    msg: ERR_LABEL
-  },
-  panel: {
-    is: ["null", "undefined", "object"],
-    ok: function(v) !v || v instanceof panels.Panel
-  }
-}
-
-function validate(name, suspect, validation) {
-  let $1 = {}
-  $1[name] = suspect
-  let $2 = {}
-  $2[name] = validation
-  return validateOptions($1, $2)[name]
-}
-
-const eventBus = Trait.compose(EventEmitter, Trait.compose({
-  constructor: function EventBus() this
-}))();
-
-// The widget object.
-const Widget = Trait.compose(Loader, Trait.compose({
-  constructor: function Widget(options) {
-
-    eventBus.on('event', this._onEvent.bind(this));
-    this.on('error', this._defaultErrorHandler.bind(this));
-
-    this._label = validate("label", options.label, valid.label);
-
-    this.tooltip = "tooltip" in options ? options.tooltip : this._label
-
-    if ("width" in options)
-      this.width = options.width;
-    if ("panel" in options)
-      this.panel = options.panel;
-
-    if ("onClick" in options)
-      this.on("click", options.onClick);
-    if ("onMouseover" in options)
-      this.on("mouseover", options.onMouseover);
-    if ("onMouseout" in options)
-      this.on("mouseout", options.onMouseout);
-    if ("content" in options)
-      this._content = options.content;
-    if ("contentURL" in options)
-      this.contentURL = options.contentURL;
-
-    if ("contentScriptWhen" in options)
-      this.contentScriptWhen = options.contentScriptWhen;
-    if ("contentScriptFile" in options)
-      this.contentScriptFile = options.contentScriptFile;
-    if ("contentScript" in options)
-      this.contentScript = options.contentScript;
-    if ("allow" in options)
-      this.allow = options.allow;
-    if ("onError" in options)
-      this.on("error", options.onError);
-    if ("onMessage" in options)
-        this.on("message", options.onMessage);
-
-    if (!(this._content || this.contentURL))
-      throw new Error(ERR_CONTENT);
-
-    let self = this;
-    this.on('propertyChange', function(change) {
-      if ('contentURL' in change)
-        browserManager.updateItem(self._public, "contentURL", self.contentURL);
-    });
-
-    browserManager.addItem(this._public);
-  },
-
-  _defaultErrorHandler: function Widget__defaultErrorHandler(e) {
-    if (1 == this._listeners('error').length)
-      console.exception(e)
-  },
-
-  _onEvent: function Widget__onEvent(type, target, eventData, domNode) {
-    if (target === this._public) {
-      this._emit(type, this._public, eventData);
-
-      // Special case for click events: if the widget doesn't have a click
-      // handler, but it does have a panel, display the panel.
-      if ("click" == type && !this._listeners("click").length && this.panel)
-        this.panel.show(domNode);
-    }
-  },
-
-  get label() this._label,
-  _label: null,
-
-  get width() this._width,
-  set width(value) {
-    value = validate("width", value, valid.number);
-    if (null === value || undefined === value) value = 16;
-    if (value !== this._width)
-      browserManager.updateItem(this._public, "width", this._width = value);
-  },
-  _width: 16,
-
-  get tooltip() this._tooltip,
-  set tooltip(value) {
-    value = validate("tooltip", value, valid.string);
-    if (value !== this._tooltip)
-      browserManager.updateItem(this._public, "tooltip", this._tooltip = value);
-  },
-  _tooltip: null,
-
-  get content() this._content,
-  set content(value) {
-    value = validate("content", value, valid.string);
-    if (value !== this._content)
-      browserManager.updateItem(this._public, "content", this._content = value);
-  },
-  _content: null,
-
-  get panel() this._panel,
-  set panel(value) {
-    value = validate("panel", value, valid.panel);
-    if (value !== this._panel)
-      this._panel = value;
-  },
-  _panel: null,
-
-  destroy: function Widget_destroy() {
-    browserManager.removeItem(this._public);
-  }
-}));
-exports.Widget = function(options) Widget(options);
-exports.Widget.prototype = Widget.prototype;
-
-// Keeps track of all browser windows.
-// Exposes methods for adding/removing/updating widgets
-// across all open windows (and future ones).
-let browserManager = {
-  items: [],
-  windows: [],
-
-  // Registers the manager to listen for window openings and closings.  Note
-  // that calling this method can cause onTrack to be called immediately if
-  // there are open windows.
-  init: function () {
-    let windowTracker = new (require("window-utils").WindowTracker)(this);
-    require("unload").ensure(windowTracker);
-  },
-
-  // Registers a window with the manager.  This is a WindowTracker callback.
-  onTrack: function browserManager_onTrack(window) {
-    if (this._isBrowserWindow(window)) {
-      let win = new BrowserWindow(window);
-      win.addItems(this.items);
-      this.windows.push(win);
-    }
-  },
-
-  // Unregisters a window from the manager.  It's told to undo all 
-  // modifications.  This is a WindowTracker callback.  Note that when
-  // WindowTracker is unloaded, it calls onUntrack for every currently opened
-  // window.  The browserManager therefore doesn't need to specially handle
-  // unload itself, since unloading the browserManager means untracking all
-  // currently opened windows.
-  onUntrack: function browserManager_onUntrack(window) {
-    if (this._isBrowserWindow(window)) {
-      for (let i = 0; i < this.windows.length; i++) {
-        if (this.windows[i].window == window) {
-          let win = this.windows.splice(i, 1)[0];
-          win.destroy();
-          return;
-        }
-      }
-    }
-  },
-
-  // Registers an item with the manager. It's added to the add-on bar of
-  // all currently registered windows, and when new windows are registered it
-  // will be added to them, too.
-  addItem: function browserManager_addItem(item) {
-    let idx = this.items.indexOf(item);
-    if (idx > -1)
-      throw new Error("The widget " + item + " has already been added.");
-    this.items.push(item);
-    this.windows.forEach(function (w) w.addItems([item]));
-  },
-
-  // Updates the content of an item registered with the manager,
-  // propagating the change to all windows.
-  updateItem: function browserManager_updateItem(item, property, value) {
-    let idx = this.items.indexOf(item);
-    if (idx != -1)
-      this.windows.forEach(function (w) w.updateItem(item, property, value));
-  },
-
-  // Unregisters an item from the manager.  It's removed from the addon-bar
-  // of all windows that are currently registered.
-  removeItem: function browserManager_removeItem(item) {
-    let idx = this.items.indexOf(item);
-    if (idx > -1) {
-      this.items.splice(idx, 1);
-      if (item.panel)
-        item.panel.destroy();
-      this.windows.forEach(function (w) w.removeItems([item]));
-    }
-  },
-
-  _isBrowserWindow: function browserManager__isBrowserWindow(win) {
-    let winType = win.document.documentElement.getAttribute("windowtype");
-    return winType === "navigator:browser";
-  }
-};
-
-// Keeps track of a single browser window.  Responsible for providing a
-// description of the window's current context and determining whether an item
-// matches the current context.
-//
-// This is where the core of how a widget's content is added to a window lives.
-//
-// TODO: If other apps besides Firefox want to support the add-on bar in
-// whatever way is appropriate for them, plugging in a substitute for this class
-// should be the way to do it.  Make it easy for them.  See bug 560716.
-function BrowserWindow(window) {
-  this.window = window;
-  this.doc = window.document;
-  this._init();
-}
-
-BrowserWindow.prototype = {
-
-  _init: function BW__init() {
-    // Array of objects:
-    // {
-    //   widget: widget object,
-    //   node: dom node,
-    //   eventListeners: hash of event listeners
-    //   symbiont: contentSymbiont
-    // }
-    this._items = [];
-
-    // Add keypress listener
-    this.window.addEventListener("keypress", this, false);
-  },
-
-  // nsIDOMEventListener
-  handleEvent: function BW_handleEvent(aEvent) {
-    switch (aEvent.type) {
-      case "keypress":
-        this._onKeyPress(aEvent);
-        break;
-    }
-  },
-
-  _onKeyPress: function BW__onKeyPress(aEvent) {
-    let accelKey = /^Mac/.test(this.window.navigator.platform) ?
-                   aEvent.metaKey : aEvent.ctrlKey;
-    let nonAccelKey = /^Mac/.test(this.window.navigator.platform) ?
-                            aEvent.ctrlKey : aEvent.metaKey;
-    if (aEvent.which == aEvent.DOM_VK_U && aEvent.shiftKey &&
-        accelKey && !nonAccelKey && !aEvent.altKey) {
-      this._onToggleUI();
-      // Work around bug 582052 by preventing the (nonexistent) default action.
-      aEvent.preventDefault();
-    }
-  },
-
-  get container() {
-    if (!this._container) {
-      // If being run in a version of Firefox <4, create a separate
-      // addon bar. TODO: just use the status bar?
-      let container = this.doc.getElementById("addon-bar");
-      if (!container) {
-        let toolbox = this.doc.createElement("toolbox");
-
-        // Share browser's palette.
-        let browserToolbox = this.doc.getElementById("navigator-toolbox");
-        toolbox.palette = browserToolbox.palette;
-
-        container = this.doc.createElement("toolbar");
-        container.setAttribute("id", "addon-bar");
-        container.setAttribute("customizable", "true");
-        // TODO: needs localization
-        container.setAttribute("toolbarname", "Add-ons Toolbar");
-
-        container.setAttribute("align", "right");
-        container.style.minHeight = "18px";
-        container.style.padding = "2px";
-        container.style.margin = "0px";
-
-        toolbox.appendChild(container);
-
-        let statusbar = this.doc.getElementById("status-bar");
-        statusbar.parentNode.insertBefore(toolbox, statusbar);
-      }
-
-      this._container = container;
-    }
-    return this._container;
-  },
-
-  // Hide container
-  _hideContainer: function BW__hideContainer() {
-    if (this._container)
-      this._container.collapsed = true;
-  },
-
-  // Update the visibility state for the addon bar.
-  _onToggleUI: function BW__onToggleUI() {
-    this.container.collapsed = !this.container.collapsed;
-  },
-
-  // Adds an array of items to the window.
-  addItems: function BW_addItems(items) {
-    items.forEach(this._addItemToWindow, this);
-  },
-
-  // Update a property of a widget.
-  updateItem: function BW_updateItem(updatedItem, property, value) {
-    let item = this._items.filter(function(item) item.widget == updatedItem).shift();
-    if (item) {
-      switch(property) {
-        case "contentURL":
-        case "content":
-          this.setContent(item);
-          break;
-        case "width":
-          item.node.style.minWidth = value + "px";
-          item.node.querySelector("iframe").style.width = value + "px";
-          break;
-        case "tooltip":
-          item.node.setAttribute("tooltiptext", value);
-          break;
-      }
-    }
-  },
-
-  // Add a widget to this window.
-  _addItemToWindow: function BW__addItemToWindow(widget) {
-    // XUL element container for widget
-    let node = this.doc.createElement("toolbaritem");
-    let guid = require("xpcom").makeUuid().toString();
-    let id = "widget:" + guid;
-    node.setAttribute("id", id);
-    node.setAttribute("label", widget.label);
-    node.setAttribute("tooltiptext", widget.tooltip);
-
-    // TODO move into a stylesheet, configurable by consumers.
-    // Either widget.style, exposing the style object, or a URL
-    // (eg, can load local stylesheet file).
-    node.setAttribute("style", [
-        "overflow: hidden; margin: 1px 2px 1px 2px; padding: 0px;",
-        "min-height: 16px; max-height: 16px;",
-    ].join(""));
-
-    node.style.minWidth = widget.width + "px";
-
-    // Add to the customization palette
-    let toolbox = this.doc.getElementById("navigator-toolbox");
-    let palette = toolbox.palette;
-    palette.appendChild(node);
-
-    // Add the item to the toolbar
-    this.container.insertItem(id, null, null, false);
-
-    let item = {widget: widget, node: node};
-
-    this._fillItem(item);
-
-    this._items.push(item);
-
-    if (this.container.collapsed)
-      this._onToggleUI();
-  },
-
-  // Initial population of a widget's content.
-  _fillItem: function BS__fillItem(item) {
-    // Create element
-    var iframe = this.doc.createElement("iframe");
-    iframe.setAttribute("type", "content");
-    iframe.setAttribute("transparent", "transparent");
-    iframe.style.overflow = "hidden";
-    iframe.style.height = "16px";
-    iframe.style.width = item.widget.width + "px";
-    iframe.setAttribute("flex", "1");
-    iframe.style.border = "none";
-    iframe.style.padding = "0px";
-    
-    // Do this early, because things like contentWindow are null
-    // until the node is attached to a document.
-    item.node.appendChild(iframe);
-
-    // add event handlers
-    this.addEventHandlers(item);
-
-    // set content
-    this.setContent(item);
-  },
-
-  // Get widget content type.
-  getContentType: function BW_getContentType(widget) {
-    if (widget.content)
-      return CONTENT_TYPE_HTML;
-    return (widget.contentURL && /\.(jpg|gif|png|ico)$/.test(widget.contentURL))
-      ? CONTENT_TYPE_IMAGE : CONTENT_TYPE_URI;
-  },
-
-  // Set widget content.
-  setContent: function BW_setContent(item) {
-    let type = this.getContentType(item.widget);
-    let contentURL = null;
-
-    switch (type) {
-      case CONTENT_TYPE_HTML:
-        contentURL = "data:text/html," + encodeURI(item.widget.content);
-        break;
-      case CONTENT_TYPE_URI:
-        contentURL = item.widget.contentURL;
-        break;
-      case CONTENT_TYPE_IMAGE:
-        let imageURL = item.widget.contentURL;
-        contentURL = "data:text/html,<html><body><img src='" +
-                     encodeURI(imageURL) + "'></body></html>";
-        break;
-      default:
-        throw new Error("The widget's type cannot be determined.");
-    }
-
-    let iframe = item.node.firstElementChild;
-
-    item.symbiont = Symbiont({
-      frame: iframe,
-      contentURL: contentURL,
-      contentScriptFile: item.widget.contentScriptFile,
-      contentScript: item.widget.contentScript,
-      contentScriptWhen: item.widget.contentScriptWhen,
-      allow: item.widget.allow,
-      onMessage: function(message) {
-        require("timer").setTimeout(function() {
-          eventBus._emit("event", "message", item.widget, message);
-        }, 0);
-      }
-    });
-  },
-
-  // Set up all supported events for a widget.
-  addEventHandlers: function BW_addEventHandlers(item) {
-    let contentType = this.getContentType(item.widget);
-
-    // Detect if document consists of a single image.
-    function isImageDoc(doc) {
-      return doc.body.childNodes.length == 1 &&
-             doc.body.firstElementChild &&
-             doc.body.firstElementChild.tagName == "IMG";
-    }
-
-    let listener = function(e) {
-      // Ignore event firings that target the iframe
-      if (e.target == item.node.firstElementChild)
-        return;
-
-      // Proxy event to the widget
-      require("timer").setTimeout(function() {
-        eventBus._emit("event", EVENTS[e.type], item.widget, null, item.node);
-      }, 0);
-    };
-
-    item.eventListeners = {};
-    let iframe = item.node.firstElementChild;
-    for (let [type, method] in Iterator(EVENTS)) {
-      iframe.addEventListener(type, listener, true, true);
-
-      // Store listeners for later removal
-      item.eventListeners[type] = listener;
-    }
-    
-    // On document load, make modifications required for nice default
-    // presentation.
-    function loadListener(e) {
-      // Ignore event firings that target the iframe
-      if (e.target == iframe)
-        return;
-      // Ignore about:blank loads
-      if (e.type == "load" && e.target.location == "about:blank")
-        return;
-      let doc = e.target;
-      if (contentType == CONTENT_TYPE_IMAGE || isImageDoc(doc)) {
-        // Force image content to size.
-        // Add-on authors must size their images correctly.
-        doc.body.firstElementChild.style.width = item.widget.width + "px";
-        doc.body.firstElementChild.style.height = "16px";
-      }
-
-      // Allow all content to fill the box by default.
-      doc.body.style.margin = "0";
-    }
-    iframe.addEventListener("load", loadListener, true, true);
-    item.eventListeners["load"] = loadListener;
-  },
-
-  // Removes an array of items from the window.
-  removeItems: function BW_removeItems(removedItems) {
-    removedItems.forEach(function(removedItem) {
-      let entry = this._items.filter(function(entry) entry.widget == removedItem).shift();
-      if (entry) {
-        // remove event listeners
-        for (let [type, listener] in Iterator(entry.eventListeners))
-          entry.node.firstElementChild.removeEventListener(type, listener, true);
-        // remove dom node
-        this.container.removeChild(entry.node);
-        // remove entry
-        this._items.splice(this._items.indexOf(entry), 1);
-      }
-    }, this);
-
-    // remove the add-on bar if no more items
-    if (this._items.length == 0)
-      this._hideContainer();
-  },
-
-  // Undoes all modifications to the window. The BrowserWindow
-  // should not be used afterward.
-  destroy: function BW_destroy() {
-    // Remove all items from the panel
-    let len = this._items.length;
-    for (let i = 0; i < len; i++)
-      this.removeItems([this._items[0].widget]);
-
-    this.window.removeEventListener("keypress", this, false);
-  }
-};
-
-// Init the browserManager only after setting prototypes and such above, because
-// it will cause browserManager.onTrack to be called immediately if there are
-// open windows.
-browserManager.init();
deleted file mode 100644
--- a/packages/addon-kit/lib/windows.js
+++ /dev/null
@@ -1,237 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is Mozilla.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Felipe Gomes <felipc@gmail.com> (Original author)
- *   Irakli Gozalishvili <gozala@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-"use strict";
-
-if (!require("xul-app").is("Firefox")) {
-  throw new Error([
-    "The windows module currently supports only Firefox. In the future",
-    " we would like it to support other applications, however.  Please see ",
-    "https://bugzilla.mozilla.org/show_bug.cgi?id=571449 for more information."
-  ].join(""));
-}
-
-const { Cc, Ci } = require('chrome'),
-      { Trait } = require('traits'),
-      { List } = require('list'),
-      { EventEmitter } = require('events'),
-      { WindowTabs, WindowTabTracker } = require('windows/tabs'),
-      { WindowDom } = require('windows/dom'),
-      { WindowLoader } = require('windows/loader'),
-      { WindowTrackerTrait } = require('window-utils'),
-      { Options } = require('tabs/tab'),
-      // { Sidebars } = require('window/sidebars');
-      { utils } = require('xpcom'),
-      apiUtils = require('api-utils'),
-      unload = require('unload'),
-
-      WM = Cc['@mozilla.org/appshell/window-mediator;1'].
-        getService(Ci.nsIWindowMediator),
-
-      BROWSER = 'navigator:browser';
-
-/**
- * Window trait composes safe wrappers for browser window that are I10S
- * compatible.
- */
-const BrowserWindowTrait = Trait.compose(
-  EventEmitter,
-  WindowDom.resolve({ close: '_close' }),
-  WindowTabs,
-  WindowTabTracker,
-  WindowLoader,
-  /* WindowSidebars, */
-  Trait.compose({
-    _emit: Trait.required,
-    _close: Trait.required,
-    _load: Trait.required,
-    /**
-     * Constructor returns wrapper of the specified chrome window.
-     * @param {nsIWindow} window
-     */
-    constructor: function BrowserWindow(options) {
-      // make sure we don't have unhandled errors
-      this.on('error', console.exception.bind(console));
-
-      if ('onOpen' in options)
-        this.on('open', options.onOpen);
-      if ('onClose' in options)
-        this.on('close', options.onClose);
-      if ('window' in options)
-        this._window = options.window;
-      if ('tabs' in options) {
-        this._tabOptions = Array.isArray(options.tabs) ?
-                           options.tabs.map(Options) :
-                           [ Options(options.tabs) ];
-      }
-      else if ('url' in options) {
-        this._tabOptions = [ Options(options.url) ];
-      }
-      this._load();
-      return this;
-    },
-    _tabOptions: [],
-    _onLoad: function() {
-      try {
-        this._initWindowTabTracker();
-      } catch(e) {
-        this._emit('error', e)
-      }
-      this._emit('open', this._public);
-    },
-    _onUnload: function() {
-      // Need to remove all the tabs before window listener are notified.
-      this._destroyWindowTabTracker();
-      this._emit('close', this._public);
-      this._window = null;
-      // Removing reference from the windows array.
-      windows.splice(windows.indexOf(this), 1);
-      this._removeAllListeners('close');
-      this._removeAllListeners('open');
-      this._removeAllListeners('ready');
-    },
-    close: function close(callback) {
-      // maybe we should deprecate this with message ?
-      if (callback) this.on('close', callback);
-      return this._close();
-    }
-  })
-);
-/**
- * Wrapper for `BrowserWindowTrait`. Creates new instance if wrapper for
- * window doesn't exists yet. If wrapper already exists then returns it
- * instead.
- * @params {Object} options
- *    Options that are passed to the the `BrowserWindowTrait`
- * @returns {BrowserWindow}
- * @see BrowserWindowTrait
- */
-function BrowserWindow(options) {
-  let chromeWindow = options.window;
-  for each (let window in windows) {
-    if (chromeWindow == window._window)
-      return window._public
-  }
-  let window = BrowserWindowTrait(options);
-  windows.push(window);
-  return window._public;
-}
-// to have proper `instanceof` behavior will go away when #596248 is fixed.
-BrowserWindow.prototype = BrowserWindowTrait.prototype;
-exports.BrowserWindow = BrowserWindow
-const windows = [];
-/**
- * `BrowserWindows` trait is composed out of `List` trait and it represents
- * "live" list of currently open browser windows. Instance mutates itself
- * whenever new browser window gets opened / closed.
- */
-// Very stupid to resolve all `toStrings` but this will be fixed by #596248
-const browserWindows = Trait.resolve({ toString: null }).compose(
-  List.resolve({ constructor: '_initList' }),
-  EventEmitter.resolve({ toString: null }),
-  WindowTrackerTrait.resolve({ constructor: '_initTracker', toString: null }),
-  Trait.compose({
-    _emit: Trait.required,
-    _add: Trait.required,
-    _remove: Trait.required,
-
-    // public API
-
-    /**
-     * Constructor creates instance of `Windows` that represents live list of open
-     * windows.
-     */
-    constructor: function BrowserWindows() {
-      this._trackedWindows = [];
-      this._initList();
-      this._initTracker();
-      unload.when(this._destructor.bind(this));
-    },
-    _destructor: function _destructor() {
-      this._removeAllListeners('open');
-      this._removeAllListeners('close');
-    },
-    /**
-     * This property represents currently active window.
-     * Property is non-enumerable, in order to preserve array like enumeration.
-     * @type {Window|null}
-     */
-    get activeWindow() {
-      let window = WM.getMostRecentWindow(BROWSER);
-      return this._isBrowser(window) ? BrowserWindow({ window: window }) : null;
-    },
-    open: function open(options) {
-      if (typeof options === "string")
-        // `tabs` option is under review and may be removed.
-        options = { tabs: [Options(options)] };
-      return BrowserWindow(options);
-    },
-    /**
-     * Returns true if specified window is a browser window.
-     * @param {nsIWindow} window
-     * @returns {Boolean}
-     */
-    _isBrowser: function _isBrowser(window)
-      BROWSER === window.document.documentElement.getAttribute("windowtype")
-    ,
-     /**
-      * Internal listener which is called whenever new window gets open.
-      * Creates wrapper and adds to this list.
-      * @param {nsIWindow} chromeWindow
-      */
-    _onTrack: function _onTrack(chromeWindow) {
-      if (!this._isBrowser(chromeWindow)) return;
-      let window = BrowserWindow({ window: chromeWindow });
-      this._add(window);
-      this._emit('open', window);
-    },
-    /**
-     * Internal listener which is called whenever window gets closed.
-     * Cleans up references and removes wrapper from this list.
-     * @param {nsIWindow} window
-     */
-    _onUntrack: function _onUntrack(chromeWindow) {
-      if (!this._isBrowser(chromeWindow)) return;
-      let window = BrowserWindow({ window: chromeWindow });
-      // `_onUnload` method of the `BrowserWindow` will remove `chromeWindow`
-      // from the `windows` array.
-      this._remove(window);
-      this._emit('close', window);
-    }
-  }).resolve({ toString: null })
-)();
-exports.browserWindows = browserWindows;
-
deleted file mode 100644
--- a/packages/addon-kit/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "name": "addon-kit",
-    "description": "Add-on development made easy.",
-    "keywords": ["javascript", "engine", "platform", "xulrunner"],
-    "author": "Atul Varma (http://toolness.com/) <atul@mozilla.com>",
-    "contributors": [
-        "Myk Melez (http://melez.com/) <myk@mozilla.org>",
-        "Daniel Aquino <mr.danielaquino@gmail.com>"
-    ],
-    "version": "1.0b1",
-    "license": "MPL 1.1/GPL 2.0/LGPL 2.1",
-    "dependencies": ["api-utils"]
-}
deleted file mode 100644
--- a/packages/addon-kit/tests/pagemod-test-helpers.js
+++ /dev/null
@@ -1,48 +0,0 @@
-"use strict";
-
-const {Cc,Ci} = require("chrome");
-
-/**
- * A helper function that creates a PageMod, then opens the specified URL
- * and checks the effect of the page mod on 'onload' event via testCallback.
- */
-exports.testPageMod = function testPageMod(test, testURL, pageModOptions,
-                                           testCallback) {
-  var xulApp = require("xul-app");
-  if (!xulApp.versionInRange(xulApp.platformVersion, "1.9.3a3", "*") &&
-      !xulApp.versionInRange(xulApp.platformVersion, "1.9.2.7", "1.9.2.*")) {
-    test.pass("Note: not testing PageMod, as it doesn't work on this platform version");
-    return;
-  }
-
-  var wm = Cc['@mozilla.org/appshell/window-mediator;1']
-           .getService(Ci.nsIWindowMediator);
-  var browserWindow = wm.getMostRecentWindow("navigator:browser");
-  if (!browserWindow) {
-    test.pass("page-mod tests: could not find the browser window, so " +
-              "will not run. Use -a firefox to run the pagemod tests.")
-    return;
-  }
-
-  test.waitUntilDone();
-  let loader = test.makeSandboxedLoader();
-  let pageMod = loader.require("page-mod");
-
-  var pageMods = [new pageMod.PageMod(opts) for each(opts in pageModOptions)];
-
-  var tabBrowser = browserWindow.gBrowser;
-  var newTab = tabBrowser.addTab(testURL);
-  tabBrowser.selectedTab = newTab;
-  var b = tabBrowser.getBrowserForTab(newTab);
-
-  function onPageLoad() {
-    b.removeEventListener("load", onPageLoad, true);
-    testCallback(b.contentWindow.wrappedJSObject, function done() {
-      pageMods.forEach(function(mod) mod.destroy());
-      // XXX leaks reported if we don't close the tab?
-      tabBrowser.removeTab(newTab);
-      test.done();
-    });
-  }
-  b.addEventListener("load", onPageLoad, true);
-}
deleted file mode 100644
--- a/packages/addon-kit/tests/test-clipboard.js
+++ /dev/null
@@ -1,55 +0,0 @@
-
-// Test the typical use case, setting & getting with no flavors specified
-exports.testWithNoFlavor = function(test) {
-  var contents = "hello there";
-  var flavor = "text";
-  var fullFlavor = "text/unicode";
-  var clip = require("clipboard");
-  // Confirm we set the clipboard
-  test.assert(clip.set(contents));
-  // Confirm flavor is set
-  test.assertEqual(clip.currentFlavors[0], flavor);
-  // Confirm we set the clipboard
-  test.assertEqual(clip.get(), contents);
-  // Confirm we can get the clipboard using the flavor
-  test.assertEqual(clip.get(flavor), contents);
-  // Confirm we can still get the clipboard using the full flavor
-  test.assertEqual(clip.get(fullFlavor), contents);
-};
-
-// Test the slightly less common case where we specify the flavor
-exports.testWithFlavor = function(test) {
-  var contents = "<b>hello there</b>";
-  var flavor = "html";
-  var fullFlavor = "text/html";
-  var clip = require("clipboard");
-  test.assert(clip.set(contents, flavor));
-  test.assertEqual(clip.currentFlavors[0], flavor);
-  // Confirm default flavor returns null
-  test.assertEqual(clip.get(), null);
-  test.assertEqual(clip.get(flavor), contents);
-  test.assertEqual(clip.get(fullFlavor), contents);
-};
-
-// Test that the typical case still works when we specify the flavor to set
-exports.testWithRedundantFlavor = function(test) {
-  var contents = "<b>hello there</b>";
-  var flavor = "text";
-  var fullFlavor = "text/unicode";
-  var clip = require("clipboard");
-  test.assert(clip.set(contents, flavor));
-  test.assertEqual(clip.currentFlavors[0], flavor);
-  test.assertEqual(clip.get(), contents);
-  test.assertEqual(clip.get(flavor), contents);
-  test.assertEqual(clip.get(fullFlavor), contents);
-};
-
-exports.testNotInFlavor = function(test) {
-  var contents = "hello there";
-  var flavor = "html";
-  var clip = require("clipboard");
-  test.assert(clip.set(contents));
-  // If there's nothing on the clipboard with this flavor, should return null
-  test.assertEqual(clip.get(flavor), null);
-};
-// TODO: Test error cases.
deleted file mode 100644
--- a/packages/addon-kit/tests/test-context-menu.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!-- ***** BEGIN LICENSE BLOCK *****
-   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
-   -
-   - The contents of this file are subject to the Mozilla Public License Version
-   - 1.1 (the "License"); you may not use this file except in compliance with
-   - the License. You may obtain a copy of the License at
-   - http://www.mozilla.org/MPL/
-   -
-   - Software distributed under the License is distributed on an "AS IS" basis,
-   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-   - for the specific language governing rights and limitations under the
-   - License.
-   -
-   - The Original Code is Jetpack.
-   -
-   - The Initial Developer of the Original Code is
-   - the Mozilla Foundation.
-   - Portions created by the Initial Developer are Copyright (C) 2010
-   - the Initial Developer. All Rights Reserved.
-   -
-   - Contributor(s):
-   -   Drew Willcoxon <adw@mozilla.com> (Original Author)
-   -
-   - Alternatively, the contents of this file may be used under the terms of
-   - either the GNU General Public License Version 2 or later (the "GPL"), or
-   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-   - in which case the provisions of the GPL or the LGPL are applicable instead
-   - of those above. If you wish to allow use of your version of this file only
-   - under the terms of either the GPL or the LGPL, and not to allow others to
-   - use your version of this file under the terms of the MPL, indicate your
-   - decision by deleting the provisions above and replace them with the notice
-   - and other provisions required by the LGPL or the GPL. If you do not delete
-   - the provisions above, a recipient may use your version of this file under
-   - the terms of any one of the MPL, the GPL or the LGPL.
-   -
-   - ***** END LICENSE BLOCK ***** -->
-
-<html>
-  <head>
-    <title>Context menu test</title>
-  </head>
-  <body>
-    <p>
-      <img id="image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==">
-    </p>
-
-    <p>
-      <a id="link" href="">
-        A simple link.
-      </a>
-    </p>
-
-    <p>
-      <a href="">
-        <span id="span-link">
-          A span inside a link.
-        </span>
-      </a>
-    </p>
-
-    <p id="text">
-      Some text.
-    </p>
-  </body>
-</html>
deleted file mode 100644
--- a/packages/addon-kit/tests/test-context-menu.js
+++ /dev/null
@@ -1,1406 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Jetpack.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Drew Willcoxon <adw@mozilla.com> (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-let {Cc,Ci} = require("chrome");
-
-// These should match the same constants in the module.