diff --git a/.gitignore b/.gitignore
index 92aa312..37ec0ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,2 @@
-./xpi/
-{8620c15f-30dc-4dba-a131-7c5d20cf4a29}
-*.xpi
.DS_Store
+web-ext-artifacts/
diff --git a/History.md b/History.md
index 5adce9c..8e0fdc7 100644
--- a/History.md
+++ b/History.md
@@ -1,3 +1,7 @@
+4.0 / TBD
+==================
+ * Rewrite extension to use the WebExtension API since the legacy XUL format is no longer supported (#235)
+
3.10 / 2017-05-16
==================
* Update maxVersions of applications in install.rdf (#238)
diff --git a/README.md b/README.md
index 4137b57..08378ed 100644
--- a/README.md
+++ b/README.md
@@ -1,44 +1,70 @@
# Nightly Tester Tools
-Nightly Tester Tools is an addon for aiding testers of nightly builds of Mozilla apps like Firefox and Thunderbird. Some features are:
-
-* Copy Build ID to Clipboard
-* Copy List of Extensions to Clipboard
-* Copy about:support to Pastebin
-* Open Profile Folder
-* Open Pushlog
-* Screenshots utility
-* Title bar customization
+
+Nightly Tester Tools (NTT) is an add-on for aiding testers of Nightly builds of Mozilla apps including Firefox.
+
+
+
+## Features
+
+* Copy the build ID or list of extensions to the clipboard using the toolbar button
+* Insert the build ID or list of extensions into a textbox using the context menu
+* Option to customize the Title Bar
+
+## Limitations
+
+There are a couple of known issues due to the limited [WebExtensions APIs](https://developer.mozilla.org/Add-ons/WebExtensions/API):
+
+* The changeset cannot be retrieved
+* The extension list does not include system add-ons
+* Some variables are not available for the custom title template
+
+The following features found in the original XUL-based extension are not yet implemented, and some of them may not be implemented again:
+
+* Copy `about:support` to Pastebin
+* Open the profile folder (Use `about:support` or `about:profile` page instead to open it)
+* Open the pushlog
+* Screenshot utility (Use [Firefox Screenshots](https://support.mozilla.org/kb/firefox-screenshots) instead)
* Crash options
-* Extension compatibility fixing
+* Extension compatibility fixer
+* Menu items under Tools
+
+## Compatibility
+
+The current WebExtension version is only compatible with Firefox. Use legacy [version 3.10](https://addons.mozilla.org/firefox/addon/nightly-tester-tools/versions/3.10) for Thunderbird and SeaMonkey.
-# Install
-You can install the latest stable NTT from [addons.mozilla.org](https://addons.mozilla.org/en-US/firefox/addon/nightly-tester-tools/). To install for development, clone the repo:
+## Install
- git clone git://github.com/mozilla/nightlytt.git
+You can install the latest stable NTT from [addons.mozilla.org](https://addons.mozilla.org/firefox/addon/nightly-tester-tools/).
-then add a file titled '{8620c15f-30dc-4dba-a131-7c5d20cf4a29}' to the "extensions" directory in your [profile folder](http://kb.mozillazine.org/Profile_folder) with the text:
+To install for development, clone the repo:
- ~/nightlytt/
+```
+git clone git://github.com/mozilla/nightlytt.git
+```
-or whatever the path to your nightlytt folder is.
+Install the [`web-ext` command line tool](https://developer.mozilla.org/Add-ons/WebExtensions/Getting_started_with_web-ext):
-To package the extension into an xpi for distribution simply `ant` and the default dev script/target will be invoked:
+```
+npm install --global web-ext
+```
- ant
+To test with Firefox:
-You can override the build number used in the filename:
+```
+web-ext run -s extension
+```
- ant -Dbuild.number=1
+To build for release:
+```
+web-ext build -s extension
+```
-To build for release (no build number in filename):
+You can also [temporarily install the extension](https://developer.mozilla.org/Add-ons/WebExtensions/Temporary_Installation_in_Firefox) in your Firefox without having to use `web-ext`.
- ant release
+## Development
-# Development
All bugs and feature requests are filed in the Nightly Tester Tools project at GitHub. You can [view the list of open issues](https://github.com/mozilla/nightlytt/issues), or you can [file a new issue](https://github.com/mozilla/nightlytt/issues/new). Check out [the wiki](https://wiki.mozilla.org/Auto-tools/Projects/NightlyTesterTools) for a list of current and proposed features and feel free to file bugs and submit patches.
-This project uses [.editorconfig](http://editorconfig.org/#overview), which sets defaults for the formatting of the code. So enjoy the use of [compatible editor](http://editorconfig.org/#download). Just download and install the corresponding plugin.
+This project uses [`.editorconfig`](http://editorconfig.org/#overview), which sets defaults for the formatting of the code. So enjoy the use of [compatible editor](http://editorconfig.org/#download). Just download and install the corresponding plugin.
-# Related Add-ons
-* [Add-on Compatibility Reporter](https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/)
-* [Screengrab (fix version)](https://addons.mozilla.org/en-US/firefox/addon/screengrab-fix-version/)
+Also, it's encouraged to use the `web-ext lint` command to [check the code](https://developer.mozilla.org/Add-ons/WebExtensions/Getting_started_with_web-ext#Checking_for_code_lint).
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 4f336a0..0000000
--- a/build.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- build.version: ${build.version}
-
-
-
diff --git a/extension/_locales/en_US/messages.json b/extension/_locales/en_US/messages.json
new file mode 100644
index 0000000..4f16a0a
--- /dev/null
+++ b/extension/_locales/en_US/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "Useful tools for the nightly tester."
+ },
+ "copy_build_info": {
+ "message": "Copy Build ID to Clipboard"
+ },
+ "insert_build_info": {
+ "message": "Insert Build ID into Textbox"
+ },
+ "insert_build_info_context": {
+ "message": "Insert Build ID"
+ },
+ "copy_extension_list": {
+ "message": "Copy List of Extensions to Clipboard"
+ },
+ "insert_extension_list": {
+ "message": "Insert List of Extensions into Textbox"
+ },
+ "insert_extension_list_context": {
+ "message": "Insert List of Extensions"
+ },
+ "open_options_page": {
+ "message": "Options…"
+ },
+ "customize_title": {
+ "message": "Customize Title Bar"
+ },
+ "enable_custom_title": {
+ "message": "Use custom title"
+ },
+ "custom_template": {
+ "message": "Custom title template:"
+ },
+ "variable_table_caption": {
+ "message": "The following variables can be used in the title (case insensitive)."
+ },
+ "variable_key": {
+ "message": "Variable"
+ },
+ "variable_desc": {
+ "message": "Description"
+ },
+ "variable_value": {
+ "message": "Value"
+ },
+ "variable_AppID": {
+ "message": "Application Identifier"
+ },
+ "variable_Vendor": {
+ "message": "Application Vendor"
+ },
+ "variable_Name": {
+ "message": "Application Name"
+ },
+ "variable_Version": {
+ "message": "Application Version"
+ },
+ "variable_AppBuildID": {
+ "message": "Application Build Identifier"
+ },
+ "variable_Changeset": {
+ "message": "Built from that changeset"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Gecko Platform Build Identifier"
+ },
+ "variable_PlatformVersion": {
+ "message": "Gecko Platform Version"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Gecko Build Identifier"
+ },
+ "variable_GeckoVersion": {
+ "message": "Gecko Version"
+ },
+ "variable_BrandName": {
+ "message": "Application Brand Name"
+ },
+ "variable_UserAgent": {
+ "message": "User Agent String"
+ },
+ "variable_Locale": {
+ "message": "Current Locale"
+ },
+ "variable_OS": {
+ "message": "Compilation OS"
+ },
+ "variable_Processor": {
+ "message": "Compilation Processor"
+ },
+ "variable_Compiler": {
+ "message": "Compiler"
+ },
+ "variable_DefaultTitle": {
+ "message": "Default Application Title"
+ },
+ "variable_TabTitle": {
+ "message": "Current Tab's Title"
+ },
+ "variable_Profile": {
+ "message": "Current Profile"
+ },
+ "variable_Toolkit": {
+ "message": "Graphics Toolkit"
+ },
+ "variable_TabsCount": {
+ "message": "Count of visible tabs"
+ }
+}
diff --git a/extension/_locales/ja/messages.json b/extension/_locales/ja/messages.json
new file mode 100644
index 0000000..d7eb7cd
--- /dev/null
+++ b/extension/_locales/ja/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "開発版のテスト利用者のための有用なツールを提供します"
+ },
+ "copy_build_info": {
+ "message": "ビルド ID をクリップボードにコピー"
+ },
+ "insert_build_info": {
+ "message": "ビルド ID をテキストボックスに挿入"
+ },
+ "insert_build_info_context": {
+ "message": "ビルド ID を挿入"
+ },
+ "copy_extension_list": {
+ "message": "アドオンの一覧をクリップボードにコピー"
+ },
+ "insert_extension_list": {
+ "message": "アドオンの一覧をテキストボックスに挿入"
+ },
+ "insert_extension_list_context": {
+ "message": "アドオンの一覧を挿入"
+ },
+ "open_options_page": {
+ "message": "オプション..."
+ },
+ "customize_title": {
+ "message": "タイトルバーのカスタマイズ"
+ },
+ "enable_custom_title": {
+ "message": "カスタマイズしたタイトルを使用する"
+ },
+ "custom_template": {
+ "message": "書式"
+ },
+ "variable_table_caption": {
+ "message": "タイトルには以下の変数が使用できます (大文字小文字は区別しません)"
+ },
+ "variable_key": {
+ "message": "変数"
+ },
+ "variable_desc": {
+ "message": "説明"
+ },
+ "variable_value": {
+ "message": "現在の値"
+ },
+ "variable_AppID": {
+ "message": "アプリケーション ID"
+ },
+ "variable_Vendor": {
+ "message": "アプリケーションのベンダー"
+ },
+ "variable_Name": {
+ "message": "アプリケーションの名称"
+ },
+ "variable_Version": {
+ "message": "アプリケーションのバージョン"
+ },
+ "variable_AppBuildID": {
+ "message": "アプリケーションのビルド ID"
+ },
+ "variable_Changeset": {
+ "message": "ビルド元のチェンジセット"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Gecko プラットフォームのビルド ID"
+ },
+ "variable_PlatformVersion": {
+ "message": "Gecko プラットフォームのバージョン"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Gecko のビルド ID"
+ },
+ "variable_GeckoVersion": {
+ "message": "Gecko のバージョン"
+ },
+ "variable_BrandName": {
+ "message": "アプリケーションのブランド名"
+ },
+ "variable_UserAgent": {
+ "message": "ユーザーエージェント文字列"
+ },
+ "variable_Locale": {
+ "message": "現在の言語"
+ },
+ "variable_OS": {
+ "message": "コンパイルの対象 OS"
+ },
+ "variable_Processor": {
+ "message": "コンパイルの対象プロセッサー"
+ },
+ "variable_Compiler": {
+ "message": "コンパイラー"
+ },
+ "variable_DefaultTitle": {
+ "message": "現在のアプリケーションのタイトル"
+ },
+ "variable_TabTitle": {
+ "message": "現在のタブのタイトル"
+ },
+ "variable_Profile": {
+ "message": "現在のプロファイル"
+ },
+ "variable_Toolkit": {
+ "message": "グラフィックツールキット"
+ },
+ "variable_TabsCount": {
+ "message": "表示されたタブの数"
+ }
+}
diff --git a/extension/_locales/pl/messages.json b/extension/_locales/pl/messages.json
new file mode 100644
index 0000000..cdf01d8
--- /dev/null
+++ b/extension/_locales/pl/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "Użyteczne narzędzia dla testerów wersji Nightly."
+ },
+ "copy_build_info": {
+ "message": "Kopiuj identyfikator kompilacji do schowka"
+ },
+ "insert_build_info": {
+ "message": "Wstaw identyfikator kompilacji do pola tekstowego"
+ },
+ "insert_build_info_context": {
+ "message": "Wstaw identyfikator kompilacji"
+ },
+ "copy_extension_list": {
+ "message": "Kopiuj listę rozszerzeń do schowka"
+ },
+ "insert_extension_list": {
+ "message": "Wstaw listę rozszerzeń do pola tekstowego"
+ },
+ "insert_extension_list_context": {
+ "message": "Wstaw listę rozszerzeń"
+ },
+ "open_options_page": {
+ "message": "Opcje…"
+ },
+ "customize_title": {
+ "message": "Dostosuj pasek tytułu"
+ },
+ "enable_custom_title": {
+ "message": "Własny tytuł"
+ },
+ "custom_template": {
+ "message": "Szablon tytułu:"
+ },
+ "variable_table_caption": {
+ "message": "Następujące zmienne mogą być użyte w tytule (wielkość liter nie ma znaczenia)."
+ },
+ "variable_key": {
+ "message": "Zmienna"
+ },
+ "variable_desc": {
+ "message": "Opis"
+ },
+ "variable_value": {
+ "message": "Wartość"
+ },
+ "variable_AppID": {
+ "message": "Identyfikator aplikacji"
+ },
+ "variable_Vendor": {
+ "message": "Organizacja"
+ },
+ "variable_Name": {
+ "message": "Nazwa"
+ },
+ "variable_Version": {
+ "message": "Wersja"
+ },
+ "variable_AppBuildID": {
+ "message": "Identyfikator kompilacji"
+ },
+ "variable_Changeset": {
+ "message": "Rewizja kompilacji"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Identyfikator kompilacji platformy Gecko"
+ },
+ "variable_PlatformVersion": {
+ "message": "Wersja platformy Gecko"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Identyfikator kompilacji Gecko"
+ },
+ "variable_GeckoVersion": {
+ "message": "Wersja Gecko"
+ },
+ "variable_BrandName": {
+ "message": "Nazwa wersji"
+ },
+ "variable_UserAgent": {
+ "message": "Identyfikator programu"
+ },
+ "variable_Locale": {
+ "message": "Wersja językowa"
+ },
+ "variable_OS": {
+ "message": "System kompilacji"
+ },
+ "variable_Processor": {
+ "message": "Procesor kompilacji"
+ },
+ "variable_Compiler": {
+ "message": "Kompilator"
+ },
+ "variable_DefaultTitle": {
+ "message": "Domyślny tytuł"
+ },
+ "variable_TabTitle": {
+ "message": "Tytuł karty"
+ },
+ "variable_Profile": {
+ "message": "Profil"
+ },
+ "variable_Toolkit": {
+ "message": "Grafika"
+ },
+ "variable_TabsCount": {
+ "message": "Liczba widocznych kart"
+ }
+}
diff --git a/extension/_locales/ru/messages.json b/extension/_locales/ru/messages.json
new file mode 100644
index 0000000..92c4f9c
--- /dev/null
+++ b/extension/_locales/ru/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "Полезные инструменты nightly-тестера."
+ },
+ "copy_build_info": {
+ "message": "Копировать Build ID в буфер обмена"
+ },
+ "insert_build_info": {
+ "message": "Вставить Build ID в текстовое поле"
+ },
+ "insert_build_info_context": {
+ "message": "Вставить Build ID"
+ },
+ "copy_extension_list": {
+ "message": "Копировать список расширений в буфер обмена"
+ },
+ "insert_extension_list": {
+ "message": "Вставить список расширений в текстовое поле"
+ },
+ "insert_extension_list_context": {
+ "message": "Вставить список расширений"
+ },
+ "open_options_page": {
+ "message": "Настройки…"
+ },
+ "customize_title": {
+ "message": "Настроить заголовок"
+ },
+ "enable_custom_title": {
+ "message": "Использовать свой заголовок"
+ },
+ "custom_template": {
+ "message": "Шаблон заголовка:"
+ },
+ "variable_table_caption": {
+ "message": "Следующие переменные могут быть использованы в заголовке (регистронезависимо)."
+ },
+ "variable_key": {
+ "message": "Переменная"
+ },
+ "variable_desc": {
+ "message": "Описание"
+ },
+ "variable_value": {
+ "message": "Значение"
+ },
+ "variable_AppID": {
+ "message": "Идентификатор приложения"
+ },
+ "variable_Vendor": {
+ "message": "Поставщик приложения"
+ },
+ "variable_Name": {
+ "message": "Имя приложения"
+ },
+ "variable_Version": {
+ "message": "Версия приложения"
+ },
+ "variable_AppBuildID": {
+ "message": "Идентификатор сборки приложения"
+ },
+ "variable_Changeset": {
+ "message": "Собрано из этого changeset"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Идентификатор сборки платформы Gecko"
+ },
+ "variable_PlatformVersion": {
+ "message": "Версия платформы Gecko"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Идентификатор сборки Gecko"
+ },
+ "variable_GeckoVersion": {
+ "message": "Версия Gecko"
+ },
+ "variable_BrandName": {
+ "message": "Имя бренда приложения"
+ },
+ "variable_UserAgent": {
+ "message": "User Agent String"
+ },
+ "variable_Locale": {
+ "message": "Текущая локаль"
+ },
+ "variable_OS": {
+ "message": "Целевая ОСь"
+ },
+ "variable_Processor": {
+ "message": "Целевой процессор"
+ },
+ "variable_Compiler": {
+ "message": "Компилятор"
+ },
+ "variable_DefaultTitle": {
+ "message": "Заголовок по-умолчанию"
+ },
+ "variable_TabTitle": {
+ "message": "Заголовок текущей вкладки"
+ },
+ "variable_Profile": {
+ "message": "Текущий профиль"
+ },
+ "variable_Toolkit": {
+ "message": "Graphics Toolkit"
+ },
+ "variable_TabsCount": {
+ "message": "Количество видимых вкладок"
+ }
+}
diff --git a/extension/_locales/sv_SE/messages.json b/extension/_locales/sv_SE/messages.json
new file mode 100644
index 0000000..493fdae
--- /dev/null
+++ b/extension/_locales/sv_SE/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "Användbara verktyg för Nightly-testaren."
+ },
+ "copy_build_info": {
+ "message": "Kopiera byggets ID till Urklipp"
+ },
+ "insert_build_info": {
+ "message": "Infoga byggets ID i textruta"
+ },
+ "insert_build_info_context": {
+ "message": "Infoga byggets ID"
+ },
+ "copy_extension_list": {
+ "message": "Kopiera lista över tillägg till Urklipp"
+ },
+ "insert_extension_list": {
+ "message": "Infoga lista över tillägg i textruta"
+ },
+ "insert_extension_list_context": {
+ "message": "Infoga lista över tillägg"
+ },
+ "open_options_page": {
+ "message": "Alternativ…"
+ },
+ "customize_title": {
+ "message": "Anpassa namnlisten"
+ },
+ "enable_custom_title": {
+ "message": "Använd egen rubrik"
+ },
+ "custom_template": {
+ "message": "Mall för egen rubrik:"
+ },
+ "variable_table_caption": {
+ "message": "Följande variabler kan användas i rubriken (ej skiftlägeskänsligt)."
+ },
+ "variable_key": {
+ "message": "Variabel"
+ },
+ "variable_desc": {
+ "message": "Beskrivning"
+ },
+ "variable_value": {
+ "message": "Värde"
+ },
+ "variable_AppID": {
+ "message": "Programmets identifierare"
+ },
+ "variable_Vendor": {
+ "message": "Programmets leverantör"
+ },
+ "variable_Name": {
+ "message": "Programmets namn"
+ },
+ "variable_Version": {
+ "message": "Programversion"
+ },
+ "variable_AppBuildID": {
+ "message": "Programbyggets identifierare"
+ },
+ "variable_Changeset": {
+ "message": "Byggt utifrån den här ändringsuppsättningen"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Gecko-plattformsbyggets identifierare"
+ },
+ "variable_PlatformVersion": {
+ "message": "Gecko-plattformens version"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Geckobyggets identifierare"
+ },
+ "variable_GeckoVersion": {
+ "message": "Geckoversion"
+ },
+ "variable_BrandName": {
+ "message": "Programmets märkesnamn"
+ },
+ "variable_UserAgent": {
+ "message": "Sträng för användaragenten"
+ },
+ "variable_Locale": {
+ "message": "Aktuell språkkonvention"
+ },
+ "variable_OS": {
+ "message": "Kompileringens operativsystem"
+ },
+ "variable_Processor": {
+ "message": "Kompileringsprocessor"
+ },
+ "variable_Compiler": {
+ "message": "Kompilerare"
+ },
+ "variable_DefaultTitle": {
+ "message": "Standardprogramrubrik"
+ },
+ "variable_TabTitle": {
+ "message": "Rubrik för aktuell flik"
+ },
+ "variable_Profile": {
+ "message": "Aktuell profil"
+ },
+ "variable_Toolkit": {
+ "message": "Grafikverktyg"
+ },
+ "variable_TabsCount": {
+ "message": "Count of visible tabs"
+ }
+}
diff --git a/extension/_locales/zh_CN/messages.json b/extension/_locales/zh_CN/messages.json
new file mode 100644
index 0000000..3c4d828
--- /dev/null
+++ b/extension/_locales/zh_CN/messages.json
@@ -0,0 +1,113 @@
+{
+ "extension_name": {
+ "message": "Nightly Tester Tools"
+ },
+ "extension_description": {
+ "message": "nightly 测试者的实用工具集。"
+ },
+ "copy_build_info": {
+ "message": "复制 Build ID 到剪贴板"
+ },
+ "insert_build_info": {
+ "message": "插入 Build ID 到文本框"
+ },
+ "insert_build_info_context": {
+ "message": "插入 Build ID"
+ },
+ "copy_extension_list": {
+ "message": "复制扩展列表到剪贴板"
+ },
+ "insert_extension_list": {
+ "message": "插入扩展列表到文本框"
+ },
+ "insert_extension_list_context": {
+ "message": "插入扩展列表"
+ },
+ "open_options_page": {
+ "message": "选项…"
+ },
+ "customize_title": {
+ "message": "定制标题栏"
+ },
+ "enable_custom_title": {
+ "message": "使用自定义标题"
+ },
+ "custom_template": {
+ "message": "自定义标题模板:"
+ },
+ "variable_table_caption": {
+ "message": "下列变量可以用在标题中(大小写敏感)。"
+ },
+ "variable_key": {
+ "message": "变量"
+ },
+ "variable_desc": {
+ "message": "描述"
+ },
+ "variable_value": {
+ "message": "值"
+ },
+ "variable_AppID": {
+ "message": "应用程序标识符"
+ },
+ "variable_Vendor": {
+ "message": "应用程序供应商"
+ },
+ "variable_Name": {
+ "message": "应用程序名称"
+ },
+ "variable_Version": {
+ "message": "应用程序版本"
+ },
+ "variable_AppBuildID": {
+ "message": "应用程序构建标识符"
+ },
+ "variable_Changeset": {
+ "message": "由此变更集构建"
+ },
+ "variable_PlatformBuildID": {
+ "message": "Gecko 平台构建标识符"
+ },
+ "variable_PlatformVersion": {
+ "message": "Gecko 平台版本"
+ },
+ "variable_GeckoBuildID": {
+ "message": "Gecko 构建标识符"
+ },
+ "variable_GeckoVersion": {
+ "message": "Gecko 版本"
+ },
+ "variable_BrandName": {
+ "message": "应用程序商标名称"
+ },
+ "variable_UserAgent": {
+ "message": "用户代理字符串"
+ },
+ "variable_Locale": {
+ "message": "当前语言区域"
+ },
+ "variable_OS": {
+ "message": "编译操作系统"
+ },
+ "variable_Processor": {
+ "message": "编译处理器"
+ },
+ "variable_Compiler": {
+ "message": "编译器"
+ },
+ "variable_DefaultTitle": {
+ "message": "默认应用程序标题"
+ },
+ "variable_TabTitle": {
+ "message": "当前标签标题"
+ },
+ "variable_Profile": {
+ "message": "当前配置文件"
+ },
+ "variable_Toolkit": {
+ "message": "图形工具包"
+ },
+ "variable_TabsCount": {
+ "message": "Count of visible tabs"
+ }
+}
diff --git a/extension/background.js b/extension/background.js
new file mode 100644
index 0000000..156de54
--- /dev/null
+++ b/extension/background.js
@@ -0,0 +1,95 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Update the title bar prefix of each window.
+ */
+const update_titlebar = async () => {
+ const windows = await browser.windows.getAll();
+ const values = await get_variable_values();
+ let pref;
+ let prefix = ' '; // An empty string doesn't work
+
+ try {
+ pref = await browser.storage.local.get();
+ } catch (ex) {
+ return;
+ }
+
+ if (pref.enable_custom_title && pref.custom_template) {
+ prefix = pref.custom_template.replace(/\$\{(\w+)\}/g, (match, key) => find_value(values, key)) + ' — ';
+ }
+
+ windows.forEach(async win => {
+ await browser.windows.update(win.id, { titlePreface: prefix });
+ });
+};
+
+/**
+ * Find a value from the variable list by its key in a case-insensitive fashion.
+ * @param {Object.} values - The current variable list.
+ * @param {String} key - A key to retrieve the value.
+ * @return {String} The value or an empty string if not found.
+ */
+const find_value = (values, key) => {
+ key = key.toLowerCase();
+
+ for (const [_key, value] of Object.entries(values)) {
+ if (_key.toLowerCase() === key) {
+ return value;
+ }
+ }
+
+ return '';
+};
+
+/**
+ * @todo Add the following Tools menu items once Bug 1272869 is solved.
+browser.menus.create({
+ contexts: ['tools_menu'],
+ title: browser.i18n.getMessage('copy_build_info'),
+ onclick: () => handle_command('copy_build_info'),
+});
+
+browser.menus.create({
+ contexts: ['tools_menu'],
+ title: browser.i18n.getMessage('copy_extension_list'),
+ onclick: () => handle_command('copy_extension_list'),
+});
+
+browser.menus.create({
+ contexts: ['tools_menu'],
+ type: 'separator',
+});
+
+browser.menus.create({
+ contexts: ['tools_menu'],
+ title: browser.i18n.getMessage('insert_build_info'),
+ onclick: () => handle_command('insert_build_info'),
+});
+
+browser.menus.create({
+ contexts: ['tools_menu'],
+ title: browser.i18n.getMessage('insert_extension_list'),
+ onclick: () => handle_command('insert_extension_list'),
+});
+ */
+
+browser.menus.create({
+ contexts: ['editable'],
+ title: browser.i18n.getMessage('insert_build_info_context'),
+ onclick: () => handle_command('insert_build_info'),
+});
+
+browser.menus.create({
+ contexts: ['editable'],
+ title: browser.i18n.getMessage('insert_extension_list_context'),
+ onclick: () => handle_command('insert_extension_list'),
+});
+
+browser.storage.onChanged.addListener(async () => await update_titlebar());
+browser.windows.onCreated.addListener(async () => await update_titlebar());
+browser.windows.onRemoved.addListener(async () => await update_titlebar());
+browser.tabs.onCreated.addListener(async () => await update_titlebar());
+browser.tabs.onRemoved.addListener(async () => await update_titlebar());
diff --git a/extension/chrome.manifest b/extension/chrome.manifest
deleted file mode 100644
index 0a94fc7..0000000
--- a/extension/chrome.manifest
+++ /dev/null
@@ -1,42 +0,0 @@
-content nightly chrome/content/
-skin nightly classic/1.0 chrome/skin/
-
-locale nightly en-US chrome/locale/en-US/
-locale nightly ja chrome/locale/ja/
-locale nightly ja-JP-mac chrome/locale/ja-JP-mac/
-locale nightly pl chrome/locale/pl/
-locale nightly ru-RU chrome/locale/ru-RU/
-locale nightly sv-SE chrome/locale/sv-SE/
-locale nightly zh-CN chrome/locale/zh-CN/
-
-resource nightly modules/
-
-# about page
-component {4cec494a-d33a-4ee7-83d6-461925b5d84b} components/aboutNightly.js
-contract @mozilla.org/network/protocol/about;1?what=nightly {4cec494a-d33a-4ee7-83d6-461925b5d84b}
-
-# addon compatiblity component
-component {126c18c5-386c-4c13-b59f-dc909e78aea0} components/nttAddonCompatibilityService.js
-contract @mozilla.com/nightly/addoncompatibility;1 {126c18c5-386c-4c13-b59f-dc909e78aea0}
-
-# Shared chrome
-override chrome://nightly/content/platform.js chrome://nightly/content/winPlatform.js os=winnt
-
-style chrome://browser/content/browser.xul chrome://nightly/skin/browser.css
-style chrome://messenger/content/messenger.xul chrome://nightly/skin/browser.css
-style chrome://navigator/content/navigator.xul chrome://nightly/skin/browser.css
-style chrome://global/content/customizeToolbar.xul chrome://nightly/skin/browser.css
-
-
-# Firefox chrome
-overlay chrome://browser/content/browser.xul chrome://nightly/content/browserOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-
-# Thunderbird chrome
-overlay chrome://messenger/content/messenger.xul chrome://nightly/content/messengerOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-
-# Suiterunner chrome
-overlay chrome://navigator/content/navigator.xul chrome://nightly/content/suiteOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-
-# Songbird chrome
-overlay chrome://songbird/content/xul/layoutBaseOverlay.xul chrome://nightly/content/songbirdOverlay.xul application=songbird@songbirdnest.com
-override chrome://nightly/skin/aboutNightly/aboutNightly.css chrome://nightly/skin/aboutNightly/aboutNightly-sb.css application=songbird@songbirdnest.com
diff --git a/extension/chrome/content/aboutNightly/aboutNightly.js b/extension/chrome/content/aboutNightly/aboutNightly.js
deleted file mode 100644
index 4c60d38..0000000
--- a/extension/chrome/content/aboutNightly/aboutNightly.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-const ADDON_ID = "{8620c15f-30dc-4dba-a131-7c5d20cf4a29}";
-
-
-function init() {
- window.removeEventListener("load", init, false);
-
- try {
- var { AddonManager: manager } = Cu.import("resource://gre/modules/AddonManager.jsm");
- } catch (e) {
- var manager = ExtensionManager;
- }
-
- manager.getAddonByID(ADDON_ID, fillContributorsCallback);
-}
-
-function fillContributorsCallback(aAddon) {
- appendToList("about", "about", [ aAddon.creator ], "label");
- appendToList("contributors", "contributorsList", aAddon.contributors, "li");
-}
-
-var ExtensionManager = {
- getAddonByID: function (aID, aCallback) {
- if (!aID || typeof aID !== "string") {
- throw Components.Exception("aID must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
- }
-
- if (typeof aCallback !== "function") {
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
- }
-
- function EM_NS(aProperty) {
- return "http://www.mozilla.org/2004/em-rdf#" + aProperty;
- }
-
- var em = Cc['@mozilla.org/extensions/manager;1']
- .getService(Ci.nsIExtensionManager);
- var rdfs = Cc["@mozilla.org/rdf/rdf-service;1"]
- .getService(Ci.nsIRDFService);
- var ds = em.datasource;
- var extension = rdfs.GetResource("urn:mozilla:item:" + aID);
-
- var addon = { creator: {}, contributors: [] };
-
- arc = rdfs.GetResource(EM_NS("creator"));
- var creator = ds.GetTarget(extension, arc, true);
- if (creator) {
- addon.creator.name = creator.QueryInterface(Ci.nsIRDFLiteral).Value;
- }
-
- arc = rdfs.GetResource(EM_NS("contributor"));
- var contributors = ds.GetTargets(extension, arc, true);
- if (contributors.hasMoreElements()) {
- while (contributors.hasMoreElements()) {
- addon.contributors.push({
- name: contributors.getNext().QueryInterface(Ci.nsIRDFLiteral).Value
- });
- }
- }
-
- aCallback(addon);
- }
-}
-
-function appendToList(aHeaderId, aNodeId, aItems, aEType) {
- var header = document.getElementById(aHeaderId);
- var node = document.getElementById(aNodeId);
-
- if (!aItems || aItems.length === 0) {
- header.hidden = true;
- return 0;
- }
-
- aItems.forEach(function (aCurrentItem) {
- var url = aCurrentItem.url;
- var listElem = document.createElement(aEType);
- var textContainer = listElem;
- if (url) {
- textContainer = document.createElement("a");
- listElem.appendChild(textContainer);
- textContainer.href = url;
- }
- textContainer.textContent = aCurrentItem.name;
- node.appendChild(listElem);
- });
-
- return aItems.length;
-}
-
-
-window.addEventListener("load", init, false);
diff --git a/extension/chrome/content/aboutNightly/aboutNightly.xhtml b/extension/chrome/content/aboutNightly/aboutNightly.xhtml
deleted file mode 100644
index 9b7dc39..0000000
--- a/extension/chrome/content/aboutNightly/aboutNightly.xhtml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
- %htmlDTD;
-
- %brandDTD;
-
- %securityPrefsDTD;
-
- %aboutRightsDTD;
-]>
-
-
-
-
-
-
- About Nightly Test Tools
-
-
-
-
-
- About Nightly Tester Tools
-
-
-
-
-
-
-
Features
-
-
- - Copy Build ID to Clipboard
- - Copy List of Extensions to Clipboard
- - Copy about:support to Pastebin
- - Open Profile Folder
- - Open Pushlog
- - Screenshots utility
- - Title bar customization
- - Crash options
- - Extension compatibility fixing
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/brand/icon.png b/extension/chrome/content/brand/icon.png
deleted file mode 100644
index 00886a6..0000000
Binary files a/extension/chrome/content/brand/icon.png and /dev/null differ
diff --git a/extension/chrome/content/brand/logo.png b/extension/chrome/content/brand/logo.png
deleted file mode 100644
index 18c58bb..0000000
Binary files a/extension/chrome/content/brand/logo.png and /dev/null differ
diff --git a/extension/chrome/content/browser.js b/extension/chrome/content/browser.js
deleted file mode 100644
index b79f8c9..0000000
--- a/extension/chrome/content/browser.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyApp = {
-
-storedTitle: document.documentElement.getAttribute("titlemodifier"),
-
-get defaultTitle() {
- var tabbrowser = document.getElementById("content");
- return tabbrowser.getWindowTitleForBrowser(tabbrowser.mCurrentBrowser);
-},
-
-get tabsCount() {
- var tabbrowser = document.getElementById("content");
- return tabbrowser.visibleTabs ? tabbrowser.visibleTabs.length : tabbrowser.browsers.length;
-},
-get tabTitle() {
- var tabbrowser = document.getElementById("content");
- return tabbrowser.mCurrentBrowser.contentTitle;
-},
-
-init: function()
-{
- var brandbundle = document.getElementById("bundle_brand");
- if (nightly.variables.name==null)
- {
- nightly.variables.name=brandbundle.getString("brandShortName");
- }
- nightly.variables.brandname=brandbundle.getString("brandFullName");
- nightly.variables.defaulttitle=nightlyApp.storedTitle;
-
- var tabbrowser = document.getElementById("content");
- nightlyApp.oldUpdateTitlebar = tabbrowser.updateTitlebar;
-
- tabbrowser.updateTitlebar = nightly.updateTitlebar;
- tabbrowser.addEventListener("DOMTitleChanged", nightly.updateTitlebar, false);
-},
-
-openURL: function(url)
-{
- gBrowser.selectedTab = gBrowser.addTab(url);
-},
-
-openNotification: function(id, message, label, accessKey, callback) {
- var action = {
- label: label,
- callback: callback,
- accessKey: accessKey
- };
- if (typeof PopupNotifications != "undefined") {
- var options = {
- timeout: Date.now() + 10000
- };
-
- PopupNotifications.show(gBrowser.selectedBrowser, id,
- message, "urlbar", action, null, options);
- } else {
- let nb = gBrowser.getNotificationBox();
-
- nb.appendNotification(
- message, id,
- "chrome://nightly/content/brand/icon.png",
- nb.PRIORITY_INFO_HIGH, [ action ]);
- }
-},
-
-setCustomTitle: function(title)
-{
- document.getElementById("content").ownerDocument.title = title;
-},
-
-setStandardTitle: function()
-{
- var tabbrowser = document.getElementById("content");
- nightlyApp.oldUpdateTitlebar.call(tabbrowser);
-},
-
-}
diff --git a/extension/chrome/content/browserOverlay.xul b/extension/chrome/content/browserOverlay.xul
deleted file mode 100644
index 476403b..0000000
--- a/extension/chrome/content/browserOverlay.xul
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-%nightlyDTD;
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/crashme.js b/extension/chrome/content/crashme.js
deleted file mode 100644
index 49e4c23..0000000
--- a/extension/chrome/content/crashme.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Code borrowed from crash me now (simple) extension:
- * https://addons.mozilla.org/addon/crash-me-now-simple/ */
-
-Components.utils.import("resource://gre/modules/ctypes.jsm");
-
-
-var crashme = {
- CHROME: 'chrome',
- CONTENT: 'content',
-
- onMenuItemCommand: function(event, how=this.CHROME) {
- switch(how) {
- case(this.CHROME):
- this.crash();
- break;
- case(this.CONTENT):
- this.crash_content()
- }
- },
-
- crash: function() {
- // ctypes checks for NULL pointer derefs, so just go near-NULL.
- var zero = new ctypes.intptr_t(8);
- var badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
- var crash = badptr.contents;
- },
-
- crash_content: function() {
- let wm = Cc["@mozilla.org/appshell/window-mediator;1"].
- getService(Ci.nsIWindowMediator);
- let win = wm.getMostRecentWindow("navigator:browser");
- let browser = win.gBrowser.selectedBrowser;
- if (browser.isRemoteBrowser) {
- browser.messageManager.loadFrameScript("chrome://nightly/content/crashmeContent.js", true);
- } else {
- // Could try harder and force-load an e10s window or something.
- }
- },
-};
diff --git a/extension/chrome/content/crashmeContent.js b/extension/chrome/content/crashmeContent.js
deleted file mode 100644
index afe5438..0000000
--- a/extension/chrome/content/crashmeContent.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Code borrowed from crash me now (simple) extension:
- * https://addons.mozilla.org/addon/crash-me-now-simple/ */
-
-// Just a sanity check
-let appInfo = Components.classes["@mozilla.org/xre/app-info;1"];
-if (appInfo && appInfo.getService(Components.interfaces.nsIXULRuntime)
- .processType != Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
- Components.utils.import("resource://gre/modules/ctypes.jsm");
- var zero = new ctypes.intptr_t(8);
- var badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
- var crash = badptr.contents;
-}
diff --git a/extension/chrome/content/messenger.js b/extension/chrome/content/messenger.js
deleted file mode 100644
index 7321513..0000000
--- a/extension/chrome/content/messenger.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyApp = {
-
-savedTabmailSetDocumentTitle: null,
-tabmailSetDocumentTitle: null,
-
-get defaultTitle() {
- var tabmail = document.getElementById("tabmail");
- return nightlyApp.getWindowTitleForMessenger(tabmail.currentTabInfo);
-},
-
-get tabsCount() {
- var tabmail = document.getElementById("tabmail");
- return tabmail.tabInfo.length;
-},
-get tabTitle() {
- var tabmail = document.getElementById("tabmail");
- return tabmail.currentTabInfo.title;
-},
-
-init: function()
-{
- var brandbundle = document.getElementById("bundle_brand");
- if (nightly.variables.name==null)
- {
- nightly.variables.name=brandbundle.getString("brandShortName");
- }
- nightly.variables.defaulttitle=brandbundle.getString("brandShortName");
- nightly.variables.brandname=brandbundle.getString("brandFullName");
-
- var tabmail = document.getElementById("tabmail");
- if (tabmail && typeof(tabmail.setDocumentTitle) === "function")
- {
- nightlyApp.savedTabmailSetDocumentTitle=tabmail.setDocumentTitle;
- }
-},
-
-openURL: function(url, event)
-{
- var uri = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService)
- .newURI(url, null, null);
-
- var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService);
- protocolSvc.loadUrl(uri);
-},
-
-customTabmailSetDocumentTitle: function(aTab)
-{
- document.title = nightly.generateText(nightly.getTemplate("title"));
-},
-
-updateTitle: function()
-{
- if (nightlyApp.savedTabmailSetDocumentTitle) {
- var tabmail = document.getElementById("tabmail");
- if (tabmail.setDocumentTitle != nightlyApp.tabmailSetDocumentTitle)
- tabmail.setDocumentTitle = nightlyApp.tabmailSetDocumentTitle;
-
- nightlyApp.tabmailSetDocumentTitle(window.document.getElementById("tabmail").currentTabInfo);
- }
-},
-
-setCustomTitle: function(title)
-{
- nightlyApp.tabmailSetDocumentTitle=nightlyApp.customTabmailSetDocumentTitle;
- nightlyApp.updateTitle();
-},
-
-setStandardTitle: function()
-{
- nightlyApp.tabmailSetDocumentTitle=nightlyApp.savedTabmailSetDocumentTitle;
- nightlyApp.updateTitle();
-},
-
-/**
- * Calculates the title like tabmail's setDocumentTitle(), but doesn't set.
- * See Bug 502389 for the details.
- */
-getWindowTitleForMessenger: function(aTab)
-{
- let docTitle = aTab.title;
-
- let platformIsMac = AppConstants.platform == "macosx";
-
- if (docTitle && !platformIsMac)
- docTitle += document.documentElement
- .getAttribute("titlemenuseparator");
-
- if (!docTitle || !platformIsMac)
- docTitle += document.documentElement
- .getAttribute("titlemodifier");
-
- return docTitle;
-},
-
-openAboutNightly: function () {
- var tabmail = document.getElementById("tabmail");
- tabmail.openTab("contentTab", { contentPage: "about:nightly" });
-},
-
-}
diff --git a/extension/chrome/content/messengerOverlay.xul b/extension/chrome/content/messengerOverlay.xul
deleted file mode 100644
index 817fd38..0000000
--- a/extension/chrome/content/messengerOverlay.xul
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-%nightlyDTD;
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/nightly.js b/extension/chrome/content/nightly.js
deleted file mode 100644
index 75cbb9c..0000000
--- a/extension/chrome/content/nightly.js
+++ /dev/null
@@ -1,563 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightly = {
-
-variables: {
- _appInfo: null,
- get appInfo() {
- if (!this._appInfo) {
- this._appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULAppInfo)
- .QueryInterface(Components.interfaces.nsIXULRuntime);
- }
- return this._appInfo;
- },
-
- get appid() this.appInfo.ID,
- get vendor() {
- // Fix for vendor not being set in Mozilla Thunderbird
- return this.appInfo.name == "Thunderbird" && this.appInfo.vendor == "" ? "Mozilla" : this.appInfo.vendor;
- },
- get name() this.appInfo.name,
- get version() this.appInfo.version,
- get appbuildid() this.appInfo.appBuildID,
- get platformbuildid() this.appInfo.platformBuildID,
- get platformversion() this.appInfo.platformVersion,
- get geckobuildid() this.appInfo.platformBuildID,
- get geckoversion() this.appInfo.platformVersion,
- get changeset() { return nightly.getChangeset(); },
- brandname: null,
- get useragent() navigator.userAgent,
- get locale() {
- var registry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Components.interfaces.nsIXULChromeRegistry);
- return registry.getSelectedLocale("global");
- },
- get os() this.appInfo.OS,
- get processor() this.appInfo.XPCOMABI.split("-")[0],
- get compiler() this.appInfo.XPCOMABI.split(/-(.*)$/)[1],
- get defaulttitle() { return nightlyApp.defaultTitle; },
- get tabscount() { return nightlyApp.tabsCount; },
- get tabtitle() { return nightlyApp.tabTitle; },
- profile: null,
- toolkit: "cairo",
- flags: ""
-},
-
-templates: {
-},
-
-getString: function(name, format) {
- if (format) {
- return document.getElementById("nightlyBundle").getFormattedString(name, format);
- }
- else {
- return document.getElementById("nightlyBundle").getString(name);
- }
-},
-
-preferences: null,
-
-/**
- * A helper function for nsIPromptService.confirmEx().
- * Popping up an alert("Hello!") is as simple as nightly.showConfirmEx({text: "Hello!"});
- *
- * @see https://developer.mozilla.org/docs/XPCOM_Interface_Reference/nsIPromptService#confirmEx%28%29
- *
- * @param {Object} aOptions
- * @param {String} aOptions.text
- * @param {Number} aOptions.buttonFlags
- * @param {String} aOptions.button0Title
- * @param {String} aOptions.button1Title
- * @param {String} aOptions.button2Title
- *
- * @returns {Number} Index of the button pressed (0..2)
- */
-showConfirmEx: function (aOptions) {
- var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
- var options = aOptions || {};
- var buttonFlags = options.buttonFlags || promptService.BUTTON_TITLE_OK * promptService.BUTTON_POS_0;
-
- return promptService.confirmEx(null, "Nightly Tester Tools", options.text,
- buttonFlags, options.button0Title, options.button1Title, options.button2Title,
- null, {});
-},
-
-showAlert: function(id, args) {
- var text = nightly.getString(id, args);
- nightly.showConfirmEx({text: text});
-},
-
-init: function() {
- window.removeEventListener("load", nightly.init, false);
- var prefs = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- nightly.preferences = prefs.getBranch("nightly.")
- .QueryInterface(Components.interfaces.nsIPrefBranchInternal);
- nightly.preferences.addObserver("", nightly, false);
-
- var profd = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("ProfD", Components.interfaces.nsILocalFile);
- var profservice = Components.classes["@mozilla.org/toolkit/profile-service;1"]
- .getService(Components.interfaces.nsIToolkitProfileService);
- var profiles = profservice.profiles;
- while (profiles.hasMoreElements()) {
- var profile = profiles.getNext().QueryInterface(Components.interfaces.nsIToolkitProfile);
- if (profile.rootDir.path == profd.path) {
- nightly.variables.profile = profile.name;
- break;
- }
- }
-
- if (!nightly.variables.profile)
- nightly.variables.profile = profd.leafName;
-
- nightlyApp.init();
- nightly.prefChange("idtitle");
-
- var changeset = nightly.getChangeset();
- var currChangeset = nightly.preferences.getCharPref("currChangeset");
- if (!currChangeset || changeset != currChangeset) {
- // keep track of previous nightly's changeset for pushlog
- nightly.preferences.setCharPref("prevChangeset", currChangeset);
- nightly.preferences.setCharPref("currChangeset", changeset);
- }
-},
-
-unload: function(pref) {
- window.removeEventListener("unload",nightly.unload,false);
- nightly.preferences.removeObserver("",nightly);
-},
-
-prefChange: function(pref) {
- if ((pref == "idtitle") || (pref == "templates.title"))
- nightly.updateTitlebar();
-},
-
-updateTitlebar: function() {
- if (nightly.preferences.getBoolPref("idtitle")) {
- var title = nightly.getTemplate("title");
- nightlyApp.setCustomTitle(nightly.generateText(title));
- }
- else {
- nightlyApp.setStandardTitle();
- }
-},
-
-observe: function(prefBranch, subject, pref) {
- nightly.prefChange(pref);
-},
-
-getStoredItem: function(type, name) {
- name = name.toLowerCase();
- var value = null;
- try {
- return nightly.preferences.getCharPref(type+"."+name);
- }
- catch (e) {}
-
- if (nightly[type].hasOwnProperty(name)) {
- value = nightly[type][name];
- if (value === undefined || value === null) {
- value = nightly.getString("nightly.variables.nullvalue");
- }
- return value;
- }
-
- return undefined;
-},
-
-getVariable: function(name) {
- return nightly.getStoredItem("variables",name);
-},
-
-getTemplate: function(name) {
- return nightly.getStoredItem("templates",name);
-},
-
-generateText: function(template) {
- var start = 0;
- var pos = template.indexOf("${",start);
- while (pos >= 0) {
- if ((pos == 0) || (template.charAt(pos - 1) != "$")) {
- var endpos = template.indexOf("}", pos + 2);
- if (endpos >= 0) {
- var varname = template.substring(pos+2,endpos);
- var varvalue = nightly.getVariable(varname);
- if (varvalue !== null && varvalue !== undefined) {
- template = template.substring(0, pos) + varvalue +
- template.substring(endpos + 1, template.length);
- start = pos + varvalue.length;
- }
- else {
- start = pos + 2;
- }
- }
- else {
- start = pos + 2;
- }
- }
- else {
- start = pos + 2;
- }
- pos = template.indexOf("${", start);
- }
- return template;
-},
-
-copyText: function(text) {
- var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"].
- getService(Components.interfaces.nsIClipboardHelper);
- clipboard.copyString(text);
-},
-
-copyTemplate: function(template) {
- nightly.copyText(nightly.generateText(nightly.getTemplate(template)));
-},
-
-pastebin: function (content) {
- var postdata = "paste_code=" + encodeURIComponent(content);
- var request = new XMLHttpRequest();
- request.open("POST","http://pastebin.com/api_public.php", true);
- request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- request.setRequestHeader("Content-length", postdata.length);
-
- request.onreadystatechange = function() {
- if (request.readyState == 4 ) {
- if (request.status==200)
- nightlyApp.openURL(request.responseText);
- }
- };
- request.send(postdata);
-},
-
-parseHTML: function(url, callback) {
- var frame = document.getElementById("sample-frame");
- if (!frame)
- frame = document.createElement("iframe");
-
- frame.setAttribute("id", "sample-frame");
- frame.setAttribute("name", "sample-frame");
- frame.setAttribute("type", "content");
- frame.setAttribute("collapsed", "true");
- document.getElementById("main-window").appendChild(frame);
-
- frame.addEventListener("load", function (event) {
- var doc = event.originalTarget;
- if (doc.location.href == "about:blank" || doc.defaultView.frameElement)
- return;
-
- setTimeout(function () { // give enough time for js to populate page
- callback(doc);
- }, 800);
- }, true);
- frame.contentDocument.location.href = url;
-},
-
-pastebinAboutSupport: function() {
- nightly.parseHTML("about:support", function(doc) {
- var contents = doc.getElementById("contents");
- var text = nightlyPPrint.createTextForElement(contents);
- nightly.pastebin(text);
- });
-},
-
-menuPopup: function(event, menupopup) {
- if (menupopup == event.target) {
- var attext = false;
-
- var element = document.commandDispatcher.focusedElement;
- if (element) {
- var type = element.localName.toLowerCase();
- attext = ((type == "input") || (type == "textarea"))
- }
-
- var node=menupopup.firstChild;
- while (node) {
- if (node.id.indexOf("-insert") != -1)
- node.hidden = !attext;
- if (node.id.indexOf("-copy") != -1)
- node.hidden = attext;
- if (node.id == 'nightly-pushlog-lasttocurrent')
- node.disabled = !nightly.preferences.getCharPref("prevChangeset");
- if (node.id == 'nightly-compatibility')
- node.setAttribute("checked", nightly.preferences.getBoolPref("disableCheckCompatibility"));
- node=node.nextSibling;
- }
- }
-},
-
-insertTemplate: function(template) {
- var element = document.commandDispatcher.focusedElement;
- if (element) {
- var type = element.localName.toLowerCase();
- if ((type == "input") || (type == "textarea")) {
- var text = nightly.generateText(nightly.getTemplate(template));
- var newpos = element.selectionStart+text.length;
- var value = element.value;
- element.value = value.substring(0, element.selectionStart) + text +
- value.substring(element.selectionEnd);
- element.selectionStart = newpos;
- element.selectionEnd = newpos;
- return;
- }
- }
-
- // no usable element was found
- const psButtonFlags = Components.interfaces.nsIPromptService;
- var promptOptions = {};
- promptOptions.text = nightly.getString("nightly.notextbox.message") + "\n" +
- nightly.getString("nightly.notextbox.clipboardInstead.message");
- promptOptions.buttonFlags = psButtonFlags.BUTTON_POS_0 * psButtonFlags.BUTTON_TITLE_IS_STRING +
- psButtonFlags.BUTTON_POS_1 * psButtonFlags.BUTTON_TITLE_CANCEL;
-
- promptOptions.button0Title = nightly.getString("nightly.copyButton.message");
-
- var buttonPressed = nightly.showConfirmEx(promptOptions);
- if (buttonPressed == 0) {
- nightly.copyTemplate(template);
- }
-},
-
-insensitiveSort: function(a, b) {
- a = a.toLowerCase();
- b = b.toLowerCase();
- if (a < b)
- return -1
- if (a > b)
- return 1
- // a must be equal to b
- return 0
-},
-
-getExtensionList: function(callback) {
- try {
- Components.utils.import("resource://gre/modules/AddonManager.jsm");
-
- AddonManager.getAddonsByTypes(['extension'], function(addons) {
- if (!addons.length)
- nightly.showAlert("nightly.noextensions.message", []);
-
- var strings = addons.map(function(addon) {
- return addon.name + " " + addon.version
- + (addon.userDisabled || addon.appDisabled ? " [DISABLED]" : "");
- });
- strings.sort(nightly.insensitiveSort);
- callback(strings);
- });
- } catch(e) {
- // old extension manager API - take out after Firefox 3.6 support dropped
- var em = Components.classes["@mozilla.org/extensions/manager;1"]
- .getService(Components.interfaces.nsIExtensionManager);
-
- var items = em.getItemList(Components.interfaces.nsIUpdateItem.TYPE_EXTENSION, {});
-
- if (items.length == 0) {
- nightly.showAlert("nightly.noextensions.message", []);
- return null;
- }
-
- var rdfS = Components.classes["@mozilla.org/rdf/rdf-service;1"]
- .getService(Components.interfaces.nsIRDFService);
- var ds = em.datasource;
- var disabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#disabled");
- var isDisabledResource = rdfS.GetResource("http://www.mozilla.org/2004/em-rdf#isDisabled");
- var text = [];
- for (var i = 0; i < items.length; i++) {
- text[i] = items[i].name + " " + items[i].version;
- var source = rdfS.GetResource("urn:mozilla:item:" + items[i].id);
- var disabled = ds.GetTarget(source, disabledResource, true);
- if (!disabled)
- disabled = ds.GetTarget(source, isDisabledResource, true);
- try {
- disabled=disabled.QueryInterface(Components.interfaces.nsIRDFLiteral);
- if (disabled.Value=="true")
- text[i]+=" [DISABLED]";
- }
- catch (e) { }
- }
- text.sort(nightly.insensitiveSort);
- callback(text);
- }
-},
-
-insertExtensions: function() {
- var element = document.commandDispatcher.focusedElement;
- if (element) {
- var type = element.localName.toLowerCase();
- if ((type == "input") || (type == "textarea")) {
- // Input fields don't support new lines, so fallback to a comma separated list
- var separator = (type == "input") ? ", " : "\n";
- nightly.getExtensionList(function(text) {
- var newpos = element.selectionStart + text.length;
- var value = element.value;
- element.value = value.substring(0, element.selectionStart) + text.join(separator) +
- value.substring(element.selectionEnd);
- element.selectionStart = newpos;
- element.selectionEnd = newpos;
- });
- return;
- }
- }
- nightly.showAlert("nightly.notextbox.message",[]);
-},
-
-copyExtensions: function() {
- nightly.getExtensionList(function(text) {
- if (text)
- nightly.copyText(text.join("\n"));
- });
-},
-
-openProfileDir: function() {
- var stream = Components.classes["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Components.interfaces.nsIFileInputStream);
- var directoryService = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties);
-
- var profile = directoryService.get("ProfD",Components.interfaces.nsILocalFile);
- try {
- profile.reveal();
- }
- catch (ex) {
- var uri = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService)
- .newFileURI(profile);
- var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService);
- protocolSvc.loadUrl(uri);
- }
-},
-
-alertType: function(type) {
- var directoryService = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties);
-
- var dir = directoryService.get(type, Components.interfaces.nsIFile);
- window.alert(dir.path);
-},
-
-getScreenshot: function() {
- window.openDialog("chrome://nightly/content/screenshot/screenshot.xul", "_blank", "chrome,all,dialog=no");
-},
-
-openCustomize: function() {
- var wm = Components.classes['@mozilla.org/appshell/window-mediator;1']
- .getService(Components.interfaces.nsIWindowMediator);
-
- var win = wm.getMostRecentWindow("NightlyTester:Customize");
- if (win) {
- win.focus();
- return;
- }
-
- var features;
- try {
- var prefservice = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- var instantApply = prefservice.getBoolPref("browser.preferences.instantApply");
- features = "chrome,titlebar,toolbar,centerscreen,resizable" + (instantApply ? ",dialog=no" : ",modal");
- }
- catch (e) {
- features = "chrome,titlebar,toolbar,centerscreen,resizable,modal";
- }
- openDialog("chrome://nightly/content/titlebar/customize.xul", "", features);
-},
-
-getAppIniString : function(section, key) {
- var directoryService = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties);
- var inifile = directoryService.get("GreD", Components.interfaces.nsIFile);
- inifile.append("application.ini");
-
- if (!inifile.exists()) {
- inifile = directoryService.get("CurProcD", Components.interfaces.nsIFile);
- inifile.append("application.ini");
- }
-
- var iniParser = Components.manager.getClassObjectByContractID(
- "@mozilla.org/xpcom/ini-parser-factory;1",
- Components.interfaces.nsIINIParserFactory)
- .createINIParser(inifile);
- try {
- return iniParser.getString(section, key);
- } catch (e) {
- return undefined;
- }
-},
-
-getRepo: function() {
- return nightly.getAppIniString("App", "SourceRepository");
-},
-
-getChangeset: function() {
- return nightly.getAppIniString("App", "SourceStamp");
-},
-
-openPushlog: function(fromChange, toChange) {
- if (fromChange) {
- var pushlogUrl = nightly.getRepo() + "/pushloghtml?fromchange=" + fromChange;
- if (toChange)
- pushlogUrl += "&tochange=" + toChange;
- nightlyApp.openURL(pushlogUrl);
- }
-},
-
-openPushlogToCurrentBuild: function() {
- var prevChangeset = nightly.preferences.getCharPref("prevChangeset");
- var currChangeset = nightly.getChangeset();
- nightly.openPushlog(prevChangeset, currChangeset);
-},
-
-openPushlogSinceCurrentBuild: function() {
- var currChangeset = nightly.getChangeset();
- nightly.openPushlog(currChangeset);
-},
-
-toggleCompatibility: function() {
- var forceCompat = nightly.preferences.getBoolPref("disableCheckCompatibility");
- if (nightlyApp.openNotification) {
- var obs = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
- var restartObserver = {
- observe: function (subject, topic, data) {
- obs.removeObserver(restartObserver, "_nttACS");
- var parsedData = JSON.parse(data);
- if (parsedData && parsedData.restart) {
- nightlyApp.openNotification("nightly-compatibility-restart",
- nightly.getString("nightly.restart.message"),
- nightly.getString("nightly.restart.label"),
- nightly.getString("nightly.restart.accesskey"),
- function() { nightly.restart(); });
- }
- }
- };
- obs.addObserver(restartObserver, "_nttACS", false);
- }
- nightly.preferences.setBoolPref("disableCheckCompatibility", !forceCompat);
-},
-
-restart: function()
-{
- var acs = Components.classes["@mozilla.com/nightly/addoncompatibility;1"]
- .getService().wrappedJSObject;
- acs.restart();
-},
-
-}
-
-
-// register addon pref listeners
-try {
- Components.classes["@mozilla.com/nightly/addoncompatibility;1"].createInstance();
-}
-catch(e) {}
-
-
-window.addEventListener("load", nightly.init, false);
-window.addEventListener("unload", nightly.unload, false);
diff --git a/extension/chrome/content/platform.js b/extension/chrome/content/platform.js
deleted file mode 100644
index 9140108..0000000
--- a/extension/chrome/content/platform.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyplatform = {
- eol: "\n"
-}
diff --git a/extension/chrome/content/pprint.js b/extension/chrome/content/pprint.js
deleted file mode 100644
index b8a001d..0000000
--- a/extension/chrome/content/pprint.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyPPrint = {
-
-// Return the plain text representation of an element. Do a little bit
-// of pretty-printing to make it human-readable.
-createTextForElement : function(elem) {
- // Generate the initial text.
- let textFragmentAccumulator = [];
- nightlyPPrint.generateTextForElement(elem, "", textFragmentAccumulator);
- let text = textFragmentAccumulator.join("");
-
- // Trim extraneous whitespace before newlines, then squash extraneous
- // blank lines.
- text = text.replace(/[ \t]+\n/g, "\n");
- text = text.replace(/\n\n\n+/g, "\n\n");
-
- return text;
-},
-
-generateTextForElement : function(elem, indent, textFragmentAccumulator) {
- // Add a little extra spacing around most elements.
- if (elem.tagName != "td")
- textFragmentAccumulator.push("\n");
-
- // Generate the text representation for each child node.
- let node = elem.firstChild;
- while (node) {
-
- if (node.nodeType == Node.TEXT_NODE) {
- // Text belonging to this element uses its indentation level.
- nightlyPPrint.generateTextForTextNode(node, indent, textFragmentAccumulator);
- }
- else if (node.nodeType == Node.ELEMENT_NODE) {
- // Recurse on the child element with an extra level of indentation.
- nightlyPPrint.generateTextForElement(node, indent + " ", textFragmentAccumulator);
- }
-
- // Advance!
- node = node.nextSibling;
- }
-},
-
-generateTextForTextNode : function(node, indent, textFragmentAccumulator) {
- // If the text node is the first of a run of text nodes, then start
- // a new line and add the initial indentation.
- let prevNode = node.previousSibling;
- if (!prevNode || prevNode.nodeType == Node.TEXT_NODE)
- textFragmentAccumulator.push("\n" + indent);
-
- // Trim the text node's text content and add proper indentation after
- // any internal line breaks.
- let text = node.textContent.trim().replace("\n", "\n" + indent, "g");
- textFragmentAccumulator.push(text);
-}
-
-}
\ No newline at end of file
diff --git a/extension/chrome/content/screenshot/multipartFormData.js b/extension/chrome/content/screenshot/multipartFormData.js
deleted file mode 100644
index 3224651..0000000
--- a/extension/chrome/content/screenshot/multipartFormData.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-
-
-function NTT_MakeStream(data)
-{
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(data, data.length);
- return stream;
-}
-
-const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
-
-function NTT_decode64(input)
-{
- var output = "";
- var chr1, chr2, chr3;
- var enc1, enc2, enc3, enc4;
- var i = 0;
-
- // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- do
- {
- enc1 = keyStr.indexOf(input.charAt(i++));
- enc2 = keyStr.indexOf(input.charAt(i++));
- enc3 = keyStr.indexOf(input.charAt(i++));
- enc4 = keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- output = output + String.fromCharCode(chr1);
-
- if (enc3 != 64)
- {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64)
- {
- output = output + String.fromCharCode(chr3);
- }
- }
- while (i < input.length);
-
- return output;
-}
-
-function MultipartFormData()
-{
- this.boundary = "hsdluicmwos";
- this.controls = [];
- this.files = [];
- this.postdata = "";
-}
-
-MultipartFormData.prototype = {
-
-boundary: null,
-controls: null,
-files: null,
-length: null,
-postdata: null,
-
-getPostData: function()
-{
- if (this.postdata)
- return this.postdata;
-
- var data = "";
-
- for (var name in this.controls)
- {
- data+="\r\n--"+this.boundary+"\r\n";
- data+="Content-Disposition: form-data; name=\""+name+"\"\r\n\r\n";
- data+=this.controls[name];
- }
-
- for (var name in this.files)
- {
- var filedata = this.files[name];
- data+="\r\n--"+this.boundary+"\r\n";
- data+="Content-Disposition: form-data; name=\""+name+"\"; filename=\""+filedata.filename+"\"\r\n";
- data+="Content-Type: "+filedata.contenttype+"\r\n";
- if (filedata.source)
- {
- data+="Content-Transfer-Encoding: base64\r\n\r\n";
-
- var fis = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- fis.init(filedata.source, 1, 384, Ci.nsIFileInputStream.CLOSE_ON_EOF);
-
- var bis = Cc["@mozilla.org/binaryinputstream;1"]
- .createInstance(Ci.nsIBinaryInputStream);
- bis.setInputStream(fis);
-
- // TODO this isnt needed as yet
- }
- else
- {
- data+="Content-Transfer-Encoding: binary\r\n\r\n";
- if (filedata.encoding == "base64")
- {
- data+=NTT_decode64(filedata.data);
- }
- else if (filedata.encoding == "binary")
- {
- data+=filedata.data;
- }
- }
- }
- data+="\r\n--"+this.boundary+"--\r\n";
-
- this.length = data.length-2;
- this.postdata = data;
-
- return data;
-},
-
-getPostDataStream: function()
-{
- return NTT_MakeStream(this.getPostData());
-},
-
-getHeaders: function()
-{
- if (!this.length)
- this.getPostData();
-
- var headers = "";
- headers+="Content-Type: "+this.getContentType()+"\r\n";
- headers+="Content-Length: "+this.length+"\r\n";
- return headers;
-},
-
-getHeaderStream: function()
-{
- return NTT_MakeStream(this.getHeaders());
-},
-
-getContentType: function()
-{
- return "multipart/form-data; boundary=\""+this.boundary+"\"";
-},
-
-addControl: function(name, value)
-{
- this.controls[name]=value;
- this.postdata = null;
- this.length = null;
-},
-
-addFile: function(name, contenttype, file)
-{
- throw Components.results.NS_NOT_IMPLEMENTED;
- var filedata = {
- filename: file.leafName,
- contenttype: contenttype,
- source: file
- };
- this.files[name] = filedata;
- this.postdata = null;
- this.length = null;
-},
-
-addFileData: function(name, filename, contenttype, encoding, data)
-{
- var filedata = {
- filename: filename,
- contenttype: contenttype,
- encoding: encoding,
- data: data
- };
- this.files[name] = filedata;
- this.postdata = null;
- this.length = null;
-},
-}
\ No newline at end of file
diff --git a/extension/chrome/content/screenshot/providers.js b/extension/chrome/content/screenshot/providers.js
deleted file mode 100644
index 0d54d40..0000000
--- a/extension/chrome/content/screenshot/providers.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Providers = {
- _providers: [],
- _selected: null,
-
- addProvider: function(provider)
- {
- this._providers.push(provider);
- if (this._selected == null)
- this._selected = provider;
- },
-
- selectProvider: function(provider)
- {
- this._selected = provider;
- },
-
- getSelectedProvider: function()
- {
- return this._selected;
- },
-
- getProviders: function()
- {
- return this._providers;
- }
-}
-
-var ImageShack = {
- addFormFields: function(formdata)
- {
- formdata.addControl("uploadtype", "on");
- formdata.addControl("url", "paste image url here");
- formdata.addControl("MAX_FILE_SIZE", "3145728");
- formdata.addControl("refer", "");
- formdata.addControl("brand", "");
- formdata.addControl("optsize", "320x320");
- },
-
- getFileFormField: function()
- {
- return "fileupload";
- },
-
- getReferer: function()
- {
- return "http://imageshack.us/";
- },
-
- getSubmissionURL: function()
- {
- return "http://imageshack.us/";
- }
-}
-
-Providers.addProvider(ImageShack);
diff --git a/extension/chrome/content/screenshot/screenshot.js b/extension/chrome/content/screenshot/screenshot.js
deleted file mode 100644
index 2b6d9b9..0000000
--- a/extension/chrome/content/screenshot/screenshot.js
+++ /dev/null
@@ -1,312 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-
-var shotWindow = window.opener;
-
-var timer = 0;
-
-var canvas = null;
-var bundle = null;
-
-var windows = [];
-
-function init(event)
-{
- canvas = document.getElementById("canvas");
- drawScreenshot();
- //canvas.parentNode.addEventListener("mousedown", startAreaSelect, true);
-
- buildWinPopup()
-
- var winlist = document.getElementById("winlist");
- winlist.addEventListener("ValueChange", winChange, false);
-
- var winpopup = document.getElementById("winpopup");
- winpopup.addEventListener("popupshowing", buildWinPopup, false);
-
- bundle = document.getElementById("bundle");
-
- try
- {
- var win = getTopWin();
- var webnav = win.content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation);
- if (webnav.loadURI)
- document.getElementById("imgsubmit").hidden = false;
- }
- catch (e)
- {
- }
-}
-
-function getTopWin()
-{
- var windowManager = Cc['@mozilla.org/appshell/window-mediator;1']
- .getService(Ci.nsIWindowMediator);
- return windowManager.getMostRecentWindow("navigator:browser");
-}
-
-function timedCapture()
-{
- if (timer==0)
- {
- timer = 5;
- var button = document.getElementById("timerbtn");
- button.checked = true;
- window.setTimeout(captureTimer, 1000);
- }
-}
-
-function captureTimer()
-{
- var button = document.getElementById("timerbtn");
- timer--;
- if (timer==0)
- {
- drawScreenshot();
- button.setAttribute("label", bundle.getFormattedString("screenshot.timer.label", [5]));
- button.checked = false;
- }
- else
- {
- button.setAttribute("label", bundle.getFormattedString("screenshot.timer.label", [timer]));
- window.setTimeout(captureTimer, 1000);
- }
-}
-
-function submitScreenshot()
-{
- var fileService = ImageShack;
-
- var data = canvas.toDataURL("image/png");
- var pos = data.indexOf(";",5);
- var contenttype = data.substring(5,pos);
- var npos = data.indexOf(",",pos+1);
- var encoding = data.substring(pos+1,npos);
- data = data.substring(npos+1);
-
- var fd = new MultipartFormData();
- fileService.addFormFields(fd);
- fd.addFileData(fileService.getFileFormField(), "screenshot.png", contenttype, encoding, data);
-
- var ioService = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService);
-
- var referer = ioService.newURI(fileService.getReferer(), "UTF8", null);
-
- var win = getTopWin();
- win.gBrowser.selectedTab = win.gBrowser.addTab("about:blank");
- var webnav = win.content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation);
- webnav.loadURI(fileService.getSubmissionURL(), Ci.nsIWebNavigation.LOAD_FLAGS_NONE
- , referer, fd.getPostDataStream(), fd.getHeaderStream());
-}
-
-function saveScreenshot()
-{
- var fp = Cc["@mozilla.org/filepicker;1"]
- .createInstance(Ci.nsIFilePicker);
- fp.init(window, bundle.getString("screenshot.filepicker.title"), fp.modeSave);
- fp.appendFilter(bundle.getString("screenshot.filepicker.filterPNG"), "*.png");
- fp.appendFilter(bundle.getString("screenshot.filepicker.filterJPG"), "*.jpg");
- fp.filterIndex = 0;
- fp.defaultExtension="png";
- fp.defaultString="screenshot." + fp.defaultExtension;
-
- var fpCallback = {
- done: function fpCallback_done(aResult) {
- if (aResult !== fp.returnCancel) {
- var file = fp.file;
- var mimetype = "image/png";
- var options = "";
- var extension = "png";
- if (fp.filterIndex === 1)
- {
- extension = "jpg";
- mimetype = "image/jpeg";
- options = "quality=80";
- }
-
- if (file.leafName.indexOf(".") < 0)
- file.leafName += "." + extension;
-
- var ioService = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService);
-
- var source = ioService.newURI(canvas.toDataURL(mimetype, options), "UTF8", null);
- var target = ioService.newFileURI(file)
-
- var persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
- .createInstance(Ci.nsIWebBrowserPersist);
-
- persist.persistFlags = Ci.nsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES;
- persist.persistFlags |= Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
-
- var privacyContext = null;
- if ("nsILoadContext" in Ci) {
- privacyContext = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
- }
-
- var tr = Cc["@mozilla.org/transfer;1"]
- .createInstance(Ci.nsITransfer);
-
- tr.init(source, target, "", null, null, null, persist, false);
- persist.progressListener = tr;
- persist.saveURI(source, null, null, null, null, file, privacyContext);
- }
- }
- }
-
- if (fp.open) {
- fp.open(fpCallback);
- } else {
- fpCallback.done(fp.show());
- }
-}
-
-function copyScreenshot()
-{
- var image = document.getElementById("previewImage");
- var docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
- var edit = docshell.contentViewer.QueryInterface(Ci.nsIContentViewerEdit);
- document.popupNode = image;
- edit.copyImage(Ci.nsIContentViewerEdit.COPY_IMAGE_DATA);
-}
-
-function buildWinPopup(event)
-{
- var winlist = document.getElementById("winlist");
- var winpopup = document.getElementById("winpopup");
-
- windows = [];
- while (winpopup.firstChild)
- winpopup.removeChild(winpopup.firstChild);
-
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
- .getService(Ci.nsIWindowMediator);
- var wins = wm.getEnumerator(null);
- var pos = 0;
- while (wins.hasMoreElements())
- {
- var win = wins.getNext().QueryInterface(Ci.nsIDOMWindow);
- if (win != window)
- {
- windows[pos] = win;
- var item = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
- if (win.document.title)
- item.setAttribute("label", win.document.title);
- else
- item.setAttribute("label", win.document.location.href);
- item.setAttribute("value", pos);
- winpopup.appendChild(item);
-
- if (!event && win==shotWindow)
- winlist.value=pos;
-
- pos++;
- }
- }
-}
-
-function winChange(event)
-{
- var winlist = document.getElementById("winlist");
- shotWindow = windows[winlist.value];
- drawScreenshot();
-}
-
-function drawScreenshot()
-{
- var width = shotWindow.innerWidth;
- var height = shotWindow.innerHeight;
- canvas.width = width;
- canvas.height = height;
- canvas.style.width = width + "px";
- canvas.style.minWidth = width + "px";
- canvas.style.maxWidth = width + "px";
- canvas.style.height = height + "px";
- canvas.style.minHeight = height + "px";
- canvas.style.maxHeight = height + "px";
-
- var ctx = canvas.getContext("2d");
-
- var winbo = shotWindow.document.getBoxObjectFor(shotWindow.document.documentElement);
- var winx = winbo.screenX;
- var winy = winbo.screenY;
-
- // This draws the main window
- try
- {
- ctx.drawWindow(shotWindow, shotWindow.scrollX, shotWindow.scrollY,
- shotWindow.innerWidth, shotWindow.innerHeight,
- "rgba(255,255,255,255)");
- }
- catch (e)
- {
- }
-
- // Must also draw inner windows as inner-content from chrome are not included
- var docshell = shotWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
- var shells = docshell.getDocShellEnumerator(Ci.nsIDocShellTreeItem.typeAll, Ci.nsIDocShell.ENUMERATE_FORWARDS);
- while (shells.hasMoreElements())
- {
- var shell = shells.getNext().QueryInterface(Ci.nsIDocShell);
- try
- {
- if (shell == docshell)
- continue;
-
- shell.QueryInterface(Ci.nsIBaseWindow);
- if (!shell.visibility)
- continue;
-
- var shellwin = shell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
- var shellbo = shellwin.document.getBoxObjectFor(shellwin.document.documentElement);
-
- ctx.save();
- try
- {
- ctx.translate(shellbo.screenX - winx + shellwin.scrollX,
- shellbo.screenY - winy + shellwin.scrollY);
- ctx.drawWindow(shellwin, shellwin.scrollX, shellwin.scrollY,
- shellwin.innerWidth, shellwin.innerHeight,
- "rgba(255,255,255,255)");
- }
- catch (e)
- {
- }
- ctx.restore();
- }
- catch (e)
- {
- }
- }
-
- var url = canvas.toDataURL();
- var oldImage = document.getElementById("previewImage");
- if (oldImage)
- oldImage.parentNode.removeChild(oldImage);
-
- var image = document.createElementNS("http://www.w3.org/1999/xhtml", "img");
- image.id = "previewImage";
- document.getElementById("container").appendChild(image);
-
- image.style.width = width + "px";
- image.style.height = height + "px";
- image.width = width;
- image.height = height;
- image.src = url;
-}
-
-window.addEventListener("load", init, false);
diff --git a/extension/chrome/content/screenshot/screenshot.xul b/extension/chrome/content/screenshot/screenshot.xul
deleted file mode 100644
index 466d122..0000000
--- a/extension/chrome/content/screenshot/screenshot.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/songbird.js b/extension/chrome/content/songbird.js
deleted file mode 100644
index 8d494fa..0000000
--- a/extension/chrome/content/songbird.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyApp = {
-
-storedTitle: document.documentElement.getAttribute("titlemodifier"),
-
-init: function()
-{
- // var brandbundle = document.getElementById("bundle_brand");
- var bundleSvc = Components.classes["@mozilla.org/intl/stringbundle;1"]
- .getService(Components.interfaces.nsIStringBundleService);
- var brandbundle = bundleSvc.
- createBundle("chrome://branding/locale/brand.properties");
-
- if (nightly.variables.name==null)
- {
- nightly.variables.name=brandbundle.GetStringFromName("brandShortName");
- }
- nightly.variables.brandname=brandbundle.GetStringFromName("brandFullName");
- nightly.variables.defaulttitle=nightlyApp.storedTitle;
-},
-
-openURL: function(url, event)
-{
- openUILink(url, event, false, true);
-},
-
-setCustomTitle: function(title)
-{
- var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
- titlebar.setAttribute("value", title);
-},
-
-setBlankTitle: function()
-{
- var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
- titlebar.setAttribute("value", "");
-},
-
-setStandardTitle: function()
-{
- var titlebar = document.getElementsByTagName("sb-sys-titlebar")[0];
- titlebar.setAttribute("value", nightlyApp.storedTitle);
-}
-
-}
-
-// songbird doesn't appear to initialize XPCOM components at startup
-try {
- Components.classes["@mozilla.com/nightly/addoncompatibility;1"].createInstance();
-} catch(e) {}
-
diff --git a/extension/chrome/content/songbirdOverlay.xul b/extension/chrome/content/songbirdOverlay.xul
deleted file mode 100644
index 291c963..0000000
--- a/extension/chrome/content/songbirdOverlay.xul
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-%nightlyDTD;
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/suite.js b/extension/chrome/content/suite.js
deleted file mode 100644
index cd64179..0000000
--- a/extension/chrome/content/suite.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyApp = {
-
-_oldUpdateTitlebar: null,
-debugQATitleModifierWorkaround: null,
-
-get oldUpdateTitlebar() {
- if (!nightlyApp._oldUpdateTitlebar) {
- var { WARN, LOG, ERROR } = Components.utils.import("resource://nightly/Logging.jsm", {});
- WARN("No suitable title bar function was found! Title bar customization is incomplete! Please file a bug!");
- }
- return nightlyApp._oldUpdateTitlebar;
-},
-
-set oldUpdateTitlebar(aParam) {
- nightlyApp._oldUpdateTitlebar = aParam;
-},
-
-get defaultTitle() {
- if (nightlyApp.oldUpdateTitlebar) {
- return nightlyApp.getWindowTitleForNavigator.call(gBrowser);
- }
-},
-
-get tabsCount() {
- return gBrowser.browsers.length;
-},
-get tabTitle() {
- if (nightlyApp.oldUpdateTitlebar) {
- return gBrowser.contentTitle;
- }
-},
-
-init: function()
-{
- var brandbundle = document.getElementById("bundle_brand");
- if (nightly.variables.name==null)
- {
- nightly.variables.name=brandbundle.getString("brandShortName");
- }
- nightly.variables.brandname=brandbundle.getString("brandFullName");
-
- if ("gBrowser" in window && typeof(gBrowser.updateTitlebar) === "function") {
- nightlyApp.oldUpdateTitlebar = gBrowser.updateTitlebar;
-
- gBrowser.updateTitlebar = nightly.updateTitlebar;
- gBrowser.addEventListener("DOMTitleChanged", nightly.updateTitlebar, false);
-
- var debugQABundle = document.getElementById("debugQANavigatorBundle");
- if (debugQABundle) {
- var debugQAModifier = debugQABundle.getFormattedString("titlemodifier",
- [nightly.variables.name,
- nightly.variables.appbuildid]);
-
- var docModifier = document.documentElement.getAttribute("titlemodifier");
- if (docModifier === debugQAModifier) {
- nightlyApp.debugQATitleModifierWorkaround = nightly.variables.name;
- }
- }
- }
-},
-
-openURL: function(url, event)
-{
- openTopWin(url);
-},
-
-setCustomTitle: function(title)
-{
- if (nightlyApp.oldUpdateTitlebar) {
- gBrowser.ownerDocument.title = title;
- }
-},
-
-setStandardTitle: function()
-{
- if (nightlyApp.oldUpdateTitlebar) {
- nightlyApp.oldUpdateTitlebar.call(gBrowser);
- }
-},
-
-/**
- * This is mostly a copy of tabbrowser's updateTitlebar():
- * - calculates the title (like updateTitlebar())
- * - returns the value (in opposite to updateTitlebar() which sets it to window directly)
- * - is enhanced to work seamlessly with SeaMonkey Debug and QA UI addon
- *
- * See related Bug 457548 and suite/browser/tabbrowser.xml for details.
- */
-getWindowTitleForNavigator: function () {
- var newTitle = "";
- var docTitle;
- var docElement = document.documentElement;
- var sep = docElement.getAttribute("titlemenuseparator");
- var modifier = "";
-
- Components.utils.import("resource://gre/modules/AppConstants.jsm");
- var platformIsMac = AppConstants.platform == "macosx";
-
- if (!platformIsMac) {
- modifier = nightlyApp.debugQATitleModifierWorkaround ||
- docElement.getAttribute("titlemodifier");
- }
-
- /**
- * TODO Explain this check
- */
- if (this.docShell.contentViewer)
- /**
- * Strip out any null bytes in the content title, since the
- * underlying widget implementations of nsWindow::SetTitle pass
- * null-terminated strings to system APIs.
- */
- docTitle = this.contentTitle.replace("\0", "");
-
- if (!docTitle && !modifier) {
- docTitle = this.getTitleForURI(this.currentURI);
- if (!docTitle) {
- /**
- * Here we actually override contenttitlesetting, because we
- * don't want the titledefault value.
- */
- docTitle = this.mStringBundle.getString("tabs.untitled");
- }
- }
-
- if (docTitle) {
- newTitle += docElement.getAttribute("titlepreface") + docTitle;
- if (modifier)
- newTitle += sep;
- }
- newTitle += modifier;
-
- /**
- * If location bar is hidden and the URL type supports a host,
- * add the scheme and host to the title to prevent spoofing.
- * XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
- * (only for schemes that support a host)
- */
- try {
- if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
- var uri = this.mURIFixup.createExposableURI(
- this.currentURI);
- if (uri.schemeIs("about"))
- newTitle = uri.spec + sep + newTitle;
- else if (uri.host)
- newTitle = uri.prePath + sep + newTitle;
- }
- } catch (e) {
- }
-
- return newTitle;
-},
-
-openNotification: function(id, message, label, accessKey, callback) {
- var action = {
- label: label,
- callback: callback,
- accessKey: accessKey
- };
- if (typeof PopupNotifications != "undefined") {
- var options = {
- timeout: Date.now() + 10000
- };
-
- PopupNotifications.show(gBrowser.selectedBrowser, id,
- message, "urlbar", action, null, options);
- } else {
- let nb = gBrowser.getNotificationBox();
-
- nb.appendNotification(
- message, id,
- "chrome://nightly/content/brand/icon.png",
- nb.PRIORITY_INFO_HIGH, [ action ]);
- }
-},
-
-}
diff --git a/extension/chrome/content/suiteOverlay.xul b/extension/chrome/content/suiteOverlay.xul
deleted file mode 100644
index c02de51..0000000
--- a/extension/chrome/content/suiteOverlay.xul
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-%nightlyDTD;
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/titlebar/customize.js b/extension/chrome/content/titlebar/customize.js
deleted file mode 100644
index 3b49db2..0000000
--- a/extension/chrome/content/titlebar/customize.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function arrayBasedTreeView(treeViewData) {
- this.data = treeViewData;
-}
-
-arrayBasedTreeView.prototype = {
- data: [],
-
- get rowCount() {
- return this.data.length;
- },
-
- getCellText: function (aRow, aColumn) {
- return this.data[aRow][aColumn.id];
- },
-
- setTree: function (aTreebox) {
- this.treebox = aTreebox;
- },
-
- isContainer: function (aRow) {
- return false;
- },
-
- isSeparator: function (aRow) {
- return false;
- },
-
- isSorted: function () {
- return false;
- },
-
- getLevel: function (aRow) {
- return 0;
- },
-
- getImageSrc: function (aRow, aCol) {
- return null;
- },
-
- getRowProperties: function (aRow, aProps) {
- return "";
- },
-
- getCellProperties: function (aRow, aCol, aProps) {
- return "";
- },
-
- getColumnProperties: function (aColID, aCol, aProps) {
- return "";
- },
-
- cycleHeader: function (aCol) {
- },
-};
-
-
-var paneTitle = {
-
-bundle: null,
-variables: [],
-
-init: function(aEvent)
-{
- aEvent.originalTarget.defaultView.removeEventListener("load", paneTitle.init, false);
-
- var mediator = Components.classes['@mozilla.org/appshell/window-mediator;1']
- .getService(Components.interfaces.nsIWindowMediator);
- var window = mediator.getMostRecentWindow("navigator:browser");
- if (!window)
- window=mediator.getMostRecentWindow("mail:3pane");
- if (!window)
- window=mediator.getMostRecentWindow("calendarMainWindow");
- if (!window)
- window=mediator.getMostRecentWindow("Songbird:Main");
- if (window)
- paneTitle.nightly=window.nightly;
-
- paneTitle.toggled();
-
- paneTitle.bundle=document.getElementById("variablesBundle");
-
- paneTitle.addVariable("AppBuildID");
- paneTitle.addVariable("AppID");
- paneTitle.addVariable("BrandName");
- paneTitle.addVariable("Changeset");
- paneTitle.addVariable("Compiler");
- paneTitle.addVariable("DefaultTitle");
- paneTitle.addVariable("GeckoVersion");
- paneTitle.addVariable("Locale");
- paneTitle.addVariable("Name");
- paneTitle.addVariable("OS");
- paneTitle.addVariable("PlatformBuildID");
- paneTitle.addVariable("PlatformVersion");
- paneTitle.addVariable("Processor");
- paneTitle.addVariable("Profile");
- paneTitle.addVariable("TabsCount");
- paneTitle.addVariable("TabTitle");
- paneTitle.addVariable("Toolkit");
- paneTitle.addVariable("UserAgent");
- paneTitle.addVariable("Vendor");
- paneTitle.addVariable("Version");
- paneTitle.setupTree();
-},
-
-addVariable: function(name)
-{
- var text = null;
- try
- {
- var text = paneTitle.bundle.getString("variable."+name+".description");
- } catch (e) { }
- if (text==null)
- {
- text="";
- }
- var value = paneTitle.nightly.getVariable(name);
- paneTitle.variables.push({variable: "${"+name+"}", description: text, value: value});
-},
-
-toggled: function()
-{
- var checkbox = document.getElementById("enableTitleBar");
- var text = document.getElementById("customTitle");
- text.disabled=!checkbox.checked;
-},
-
-setupTree: function () {
- var tree = document.getElementById("variableTree");
- tree.view = new arrayBasedTreeView(paneTitle.variables);
- tree.addEventListener("click", treeOnClickListener, true);
-},
-}
-
-function treeOnClickListener(aEvent) {
- if (aEvent.originalTarget.tagName === "treechildren") {
- var tree = aEvent.originalTarget.parentNode;
- var tbo = tree.treeBoxObject;
-
- // get the row, col and child element at the point
- var row = { }, col = { }, child = { };
- tbo.getCellAt(aEvent.clientX, aEvent.clientY, row, col, child);
-
- // a workaround to skip extraneous clicks
- if (tree.view.selection.currentIndex === row.value) {
- var titlebox = document.getElementById("customTitle");
- var template = titlebox.value + " " + paneTitle.variables[row.value]["variable"];
- titlebox.value = template;
- // manually set pref, pref change isn't triggered if we just set the value
- paneTitle.nightly.preferences.setCharPref("templates.title", template);
- }
- }
-}
-
-window.addEventListener("load",paneTitle.init,false);
diff --git a/extension/chrome/content/titlebar/customize.xul b/extension/chrome/content/titlebar/customize.xul
deleted file mode 100644
index b2273cc..0000000
--- a/extension/chrome/content/titlebar/customize.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- &nightly.variables.description;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/content/winPlatform.js b/extension/chrome/content/winPlatform.js
deleted file mode 100644
index c528d81..0000000
--- a/extension/chrome/content/winPlatform.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var nightlyplatform = {
- eol: "\r\n"
-}
diff --git a/extension/chrome/locale/en-US/customize.dtd b/extension/chrome/locale/en-US/customize.dtd
deleted file mode 100644
index 9c50adc..0000000
--- a/extension/chrome/locale/en-US/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/en-US/nightly.dtd b/extension/chrome/locale/en-US/nightly.dtd
deleted file mode 100644
index 3371552..0000000
--- a/extension/chrome/locale/en-US/nightly.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/en-US/nightly.properties b/extension/chrome/locale/en-US/nightly.properties
deleted file mode 100644
index 8846944..0000000
--- a/extension/chrome/locale/en-US/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=Useful tools for the nightly tester.
-nightly.notextbox.message=You must select a text box before using this function.
-nightly.notextbox.clipboardInstead.message=Or you could copy it to the Clipboard now.
-nightly.copyButton.message=Copy to Clipboard
-nightly.noextensions.message=No extensions were found.
-nightly.restart.message=Addon compatibility has changed, restart to affect currently installed addons
-nightly.restart.label=Restart
-nightly.restart.accesskey=R
-nightly.variables.nullvalue=Undefined
diff --git a/extension/chrome/locale/en-US/screenshot.dtd b/extension/chrome/locale/en-US/screenshot.dtd
deleted file mode 100644
index cda39b0..0000000
--- a/extension/chrome/locale/en-US/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/en-US/screenshot.properties b/extension/chrome/locale/en-US/screenshot.properties
deleted file mode 100644
index dfac7dd..0000000
--- a/extension/chrome/locale/en-US/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=Save Screenshot As...
-screenshot.filepicker.filterJPG=JPG files. (*.jpg)
-screenshot.filepicker.filterPNG=PNG files. (*.png)
-screenshot.timer.label=Capture in: %S
diff --git a/extension/chrome/locale/en-US/variables.properties b/extension/chrome/locale/en-US/variables.properties
deleted file mode 100644
index 57d4d01..0000000
--- a/extension/chrome/locale/en-US/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=Application Identifier
-variable.Vendor.description=Application Vendor
-variable.Name.description=Application Name
-variable.Version.description=Application Version
-variable.AppBuildID.description=Application Build Identifier
-variable.Changeset.description=Built from that changeset
-variable.PlatformBuildID.description=XUL Platform Build Identifier
-variable.PlatformVersion.description=XUL Platform Version
-variable.GeckoBuildID.description=Gecko Build Identifier
-variable.GeckoVersion.description=Gecko Version
-variable.BrandName.description=Application Brand Name
-variable.UserAgent.description=User Agent String
-variable.Locale.description=Current Locale
-variable.OS.description=Compilation OS
-variable.Processor.description=Compilation Processor
-variable.Compiler.description=Compiler
-variable.DefaultTitle.description=Default Application Title
-variable.TabTitle.description=Current Tab's Title
-variable.Profile.description=Current Profile
-variable.Toolkit.description=Graphics Toolkit
-variable.TabsCount.description=Count of visible tabs
diff --git a/extension/chrome/locale/ja-JP-mac/customize.dtd b/extension/chrome/locale/ja-JP-mac/customize.dtd
deleted file mode 100644
index 4d94d89..0000000
--- a/extension/chrome/locale/ja-JP-mac/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja-JP-mac/nightly.dtd b/extension/chrome/locale/ja-JP-mac/nightly.dtd
deleted file mode 100644
index f147fdc..0000000
--- a/extension/chrome/locale/ja-JP-mac/nightly.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja-JP-mac/nightly.properties b/extension/chrome/locale/ja-JP-mac/nightly.properties
deleted file mode 100644
index c5c5280..0000000
--- a/extension/chrome/locale/ja-JP-mac/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=開発版のテスト利用者のための有用なツールを提供します
-nightly.notextbox.message=この機能を使用する前にテキストボックスを選択する必要があります
-nightly.notextbox.clipboardInstead.message=あるいは、クリップボードにコピーすることもできます
-nightly.copyButton.message=クリップボードにコピー
-nightly.noextensions.message=アドオンが見つかりません
-nightly.restart.message=アドオンの互換性確認が変更されました。再起動して変更を適用してください
-nightly.restart.label=再起動
-nightly.restart.accesskey=R
-nightly.variables.nullvalue=未定義
diff --git a/extension/chrome/locale/ja-JP-mac/screenshot.dtd b/extension/chrome/locale/ja-JP-mac/screenshot.dtd
deleted file mode 100644
index f677391..0000000
--- a/extension/chrome/locale/ja-JP-mac/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja-JP-mac/screenshot.properties b/extension/chrome/locale/ja-JP-mac/screenshot.properties
deleted file mode 100644
index 8efaa4c..0000000
--- a/extension/chrome/locale/ja-JP-mac/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=スクリーンショットを別名で保存...
-screenshot.filepicker.filterJPG=JPG ファイル (*.jpg)
-screenshot.filepicker.filterPNG=PNG ファイル (*.png)
-screenshot.timer.label=%S 秒後に撮影
diff --git a/extension/chrome/locale/ja-JP-mac/variables.properties b/extension/chrome/locale/ja-JP-mac/variables.properties
deleted file mode 100644
index 973727a..0000000
--- a/extension/chrome/locale/ja-JP-mac/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=アプリケーション ID
-variable.Vendor.description=アプリケーションのベンダー
-variable.Name.description=アプリケーションの名称
-variable.Version.description=アプリケーションのバージョン
-variable.AppBuildID.description=アプリケーションのビルド ID
-variable.Changeset.description=ビルド元のチェンジセット
-variable.PlatformBuildID.description=XUL プラットフォームのビルド ID
-variable.PlatformVersion.description=XUL プラットフォームのバージョン
-variable.GeckoBuildID.description=Gecko のビルド ID
-variable.GeckoVersion.description=Gecko のバージョン
-variable.BrandName.description=アプリケーションのブランド名
-variable.UserAgent.description=ユーザーエージェント文字列
-variable.Locale.description=現在の言語
-variable.OS.description=コンパイルの対象 OS
-variable.Processor.description=コンパイルの対象プロセッサー
-variable.Compiler.description=コンパイラー
-variable.DefaultTitle.description=現在のアプリケーションのタイトル
-variable.TabTitle.description=現在のタブのタイトル
-variable.Profile.description=現在のプロファイル
-variable.Toolkit.description=グラフィックツールキット
-variable.TabsCount.description=表示されたタブの数
diff --git a/extension/chrome/locale/ja/customize.dtd b/extension/chrome/locale/ja/customize.dtd
deleted file mode 100644
index 4d94d89..0000000
--- a/extension/chrome/locale/ja/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja/nightly.dtd b/extension/chrome/locale/ja/nightly.dtd
deleted file mode 100644
index f147fdc..0000000
--- a/extension/chrome/locale/ja/nightly.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja/nightly.properties b/extension/chrome/locale/ja/nightly.properties
deleted file mode 100644
index c5c5280..0000000
--- a/extension/chrome/locale/ja/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=開発版のテスト利用者のための有用なツールを提供します
-nightly.notextbox.message=この機能を使用する前にテキストボックスを選択する必要があります
-nightly.notextbox.clipboardInstead.message=あるいは、クリップボードにコピーすることもできます
-nightly.copyButton.message=クリップボードにコピー
-nightly.noextensions.message=アドオンが見つかりません
-nightly.restart.message=アドオンの互換性確認が変更されました。再起動して変更を適用してください
-nightly.restart.label=再起動
-nightly.restart.accesskey=R
-nightly.variables.nullvalue=未定義
diff --git a/extension/chrome/locale/ja/screenshot.dtd b/extension/chrome/locale/ja/screenshot.dtd
deleted file mode 100644
index e73129b..0000000
--- a/extension/chrome/locale/ja/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ja/screenshot.properties b/extension/chrome/locale/ja/screenshot.properties
deleted file mode 100644
index 352c1b8..0000000
--- a/extension/chrome/locale/ja/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=スクリーンショットを名前を付けて保存...
-screenshot.filepicker.filterJPG=JPG ファイル (*.jpg)
-screenshot.filepicker.filterPNG=PNG ファイル (*.png)
-screenshot.timer.label=%S 秒後に撮影
diff --git a/extension/chrome/locale/ja/variables.properties b/extension/chrome/locale/ja/variables.properties
deleted file mode 100644
index 973727a..0000000
--- a/extension/chrome/locale/ja/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=アプリケーション ID
-variable.Vendor.description=アプリケーションのベンダー
-variable.Name.description=アプリケーションの名称
-variable.Version.description=アプリケーションのバージョン
-variable.AppBuildID.description=アプリケーションのビルド ID
-variable.Changeset.description=ビルド元のチェンジセット
-variable.PlatformBuildID.description=XUL プラットフォームのビルド ID
-variable.PlatformVersion.description=XUL プラットフォームのバージョン
-variable.GeckoBuildID.description=Gecko のビルド ID
-variable.GeckoVersion.description=Gecko のバージョン
-variable.BrandName.description=アプリケーションのブランド名
-variable.UserAgent.description=ユーザーエージェント文字列
-variable.Locale.description=現在の言語
-variable.OS.description=コンパイルの対象 OS
-variable.Processor.description=コンパイルの対象プロセッサー
-variable.Compiler.description=コンパイラー
-variable.DefaultTitle.description=現在のアプリケーションのタイトル
-variable.TabTitle.description=現在のタブのタイトル
-variable.Profile.description=現在のプロファイル
-variable.Toolkit.description=グラフィックツールキット
-variable.TabsCount.description=表示されたタブの数
diff --git a/extension/chrome/locale/pl/customize.dtd b/extension/chrome/locale/pl/customize.dtd
deleted file mode 100644
index dc8a7b0..0000000
--- a/extension/chrome/locale/pl/customize.dtd
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/pl/nightly.dtd b/extension/chrome/locale/pl/nightly.dtd
deleted file mode 100644
index 1fe7682..0000000
--- a/extension/chrome/locale/pl/nightly.dtd
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/pl/nightly.properties b/extension/chrome/locale/pl/nightly.properties
deleted file mode 100644
index 8a12da1..0000000
--- a/extension/chrome/locale/pl/nightly.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=Użyteczne narzędzia dla testerów wersji Nightly.
-
-nightly.notextbox.message=Musisz zaznaczyć pole tekstowe, zanim użyjesz tej funkcji.
-nightly.notextbox.clipboardInstead.message=Możesz też skopiować do schowka.
-nightly.copyButton.message=Kopiuj
-nightly.noextensions.message=Nie znaleziono rozszerzeń.
-nightly.restart.message=Zmieniono ustawienia zgodności dodatków. Uruchom ponownie program, aby zmiany zostały zastosowane do zainstalowanych dodatków.
-nightly.restart.label=Uruchom ponownie
-nightly.restart.accesskey=U
-nightly.variables.nullvalue=Niezdefiniowany
diff --git a/extension/chrome/locale/pl/screenshot.dtd b/extension/chrome/locale/pl/screenshot.dtd
deleted file mode 100644
index 9e69d3f..0000000
--- a/extension/chrome/locale/pl/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/pl/screenshot.properties b/extension/chrome/locale/pl/screenshot.properties
deleted file mode 100644
index 93ae4bc..0000000
--- a/extension/chrome/locale/pl/screenshot.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-screenshot.filepicker.title=Zapisywanie zrzutu
-screenshot.filepicker.filterJPG=Pliki JPG. (*.jpg)
-screenshot.filepicker.filterPNG=Pliki PNG. (*.png)
-
-screenshot.timer.label=Zrzut za: %S
diff --git a/extension/chrome/locale/pl/variables.properties b/extension/chrome/locale/pl/variables.properties
deleted file mode 100644
index 5890ad5..0000000
--- a/extension/chrome/locale/pl/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-variable.AppID.description=Identyfikator aplikacji
-variable.Vendor.description=Organizacja
-variable.Name.description=Nazwa
-variable.Version.description=Wersja
-variable.AppBuildID.description=Identyfikator kompilacji
-variable.Changeset.description=Rewizja kompilacji
-variable.PlatformBuildID.description=Identyfikator kompilacji platformy XUL
-variable.PlatformVersion.description=Wersja platformy XUL
-variable.GeckoBuildID.description=Identyfikator kompilacji Gecko
-variable.GeckoVersion.description=Wersja Gecko
-variable.BrandName.description=Nazwa wersji
-variable.UserAgent.description=Identyfikator programu
-variable.Locale.description=Wersja językowa
-variable.OS.description=System kompilacji
-variable.Processor.description=Procesor kompilacji
-variable.Compiler.description=Kompilator
-variable.DefaultTitle.description=Domyślny tytuł
-variable.TabTitle.description=Tytuł karty
-variable.Profile.description=Profil
-variable.Toolkit.description=Grafika
-variable.TabsCount.description=Liczba widocznych kart
diff --git a/extension/chrome/locale/ru-RU/customize.dtd b/extension/chrome/locale/ru-RU/customize.dtd
deleted file mode 100644
index d5e0cd6..0000000
--- a/extension/chrome/locale/ru-RU/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ru-RU/nightly.dtd b/extension/chrome/locale/ru-RU/nightly.dtd
deleted file mode 100644
index f8577c0..0000000
--- a/extension/chrome/locale/ru-RU/nightly.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ru-RU/nightly.properties b/extension/chrome/locale/ru-RU/nightly.properties
deleted file mode 100644
index d0843ba..0000000
--- a/extension/chrome/locale/ru-RU/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=Полезные инструменты nightly-тестера.
-nightly.notextbox.message=Следует выбрать текстовое поле перед использованием этой функции.
-nightly.notextbox.clipboardInstead.message=Можно скопировать в буфер обмена прямо сейчас.
-nightly.copyButton.message=Копировать в буфер обмена
-nightly.noextensions.message=Расширения не найдены.
-nightly.restart.message=Совместимость расширений изменена, перезапустите, чтобы подействовало на установленные дополнения
-nightly.restart.label=Перезапустить
-nightly.restart.accesskey=R
-nightly.variables.nullvalue=Undefined
diff --git a/extension/chrome/locale/ru-RU/screenshot.dtd b/extension/chrome/locale/ru-RU/screenshot.dtd
deleted file mode 100644
index 667b7fb..0000000
--- a/extension/chrome/locale/ru-RU/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/ru-RU/screenshot.properties b/extension/chrome/locale/ru-RU/screenshot.properties
deleted file mode 100644
index 914a8b4..0000000
--- a/extension/chrome/locale/ru-RU/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=Cохранить скриншот как...
-screenshot.filepicker.filterJPG=JPG файлы. (*.jpg)
-screenshot.filepicker.filterPNG=PNG файлы. (*.png)
-screenshot.timer.label=Захват через: %S
diff --git a/extension/chrome/locale/ru-RU/variables.properties b/extension/chrome/locale/ru-RU/variables.properties
deleted file mode 100644
index 3420776..0000000
--- a/extension/chrome/locale/ru-RU/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=Идентификатор приложения
-variable.Vendor.description=Поставщик приложения
-variable.Name.description=Имя приложения
-variable.Version.description=Версия приложения
-variable.AppBuildID.description=Идентификатор сборки приложения
-variable.Changeset.description=Собрано из этого changeset
-variable.PlatformBuildID.description=Идентификатор сборки платформы XUL
-variable.PlatformVersion.description=Версия платформы XUL
-variable.GeckoBuildID.description=Идентификатор сборки Gecko
-variable.GeckoVersion.description=Версия Gecko
-variable.BrandName.description=Имя бренда приложения
-variable.UserAgent.description=User Agent String
-variable.Locale.description=Текущая локаль
-variable.OS.description=Целевая ОСь
-variable.Processor.description=Целевой процессор
-variable.Compiler.description=Компилятор
-variable.DefaultTitle.description=Заголовок по-умолчанию
-variable.TabTitle.description=Заголовок текущей вкладки
-variable.Profile.description=Текущий профиль
-variable.Toolkit.description=Graphics Toolkit
-variable.TabsCount.description=Количество видимых вкладок
diff --git a/extension/chrome/locale/sv-SE/customize.dtd b/extension/chrome/locale/sv-SE/customize.dtd
deleted file mode 100644
index fecd461..0000000
--- a/extension/chrome/locale/sv-SE/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/sv-SE/nightly.dtd b/extension/chrome/locale/sv-SE/nightly.dtd
deleted file mode 100644
index f4e45dd..0000000
--- a/extension/chrome/locale/sv-SE/nightly.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/sv-SE/nightly.properties b/extension/chrome/locale/sv-SE/nightly.properties
deleted file mode 100644
index 7f55912..0000000
--- a/extension/chrome/locale/sv-SE/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=Användbara verktyg för Nightly-testaren.
-nightly.notextbox.message=Du måste markera en textruta innan du kan använda den här funktionen.
-nightly.notextbox.clipboardInstead.message=Om du vill kan du istället kopiera den till Urklipp.
-nightly.copyButton.message=Kopiera till Urklipp
-nightly.noextensions.message=Det gick inte att hitta några tillägg.
-nightly.restart.message=Tilläggskompatibiliteten har ändrats, starta om för att påverka de för närvarande installerade tilläggen.
-nightly.restart.label=Starta om
-nightly.restart.accesskey=S
-nightly.variables.nullvalue=Odefinierad
diff --git a/extension/chrome/locale/sv-SE/screenshot.dtd b/extension/chrome/locale/sv-SE/screenshot.dtd
deleted file mode 100644
index c32a0e0..0000000
--- a/extension/chrome/locale/sv-SE/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/sv-SE/screenshot.properties b/extension/chrome/locale/sv-SE/screenshot.properties
deleted file mode 100644
index 4bd2112..0000000
--- a/extension/chrome/locale/sv-SE/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=Spara skärmbild som …
-screenshot.filepicker.filterJPG=JPG-filer. (*.jpg)
-screenshot.filepicker.filterPNG=PNG-filer. (*.png)
-screenshot.timer.label=Fånga in om: %S
diff --git a/extension/chrome/locale/sv-SE/variables.properties b/extension/chrome/locale/sv-SE/variables.properties
deleted file mode 100644
index 32cfaf5..0000000
--- a/extension/chrome/locale/sv-SE/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=Programmets identifierare
-variable.Vendor.description=Programmets leverantör
-variable.Name.description=Programmets namn
-variable.Version.description=Programversion
-variable.AppBuildID.description=Programbyggets identifierare
-variable.Changeset.description=Byggt utifrån den här ändringsuppsättningen
-variable.PlatformBuildID.description=XUL-plattformsbyggets identifierare
-variable.PlatformVersion.description=XUL-plattformens version
-variable.GeckoBuildID.description=Geckobyggets identifierare
-variable.GeckoVersion.description=Geckoversion
-variable.BrandName.description=Programmets märkesnamn
-variable.UserAgent.description=Sträng för användaragenten
-variable.Locale.description=Aktuell språkkonvention
-variable.OS.description=Kompileringens operativsystem
-variable.Processor.description=Kompileringsprocessor
-variable.Compiler.description=Kompilerare
-variable.DefaultTitle.description=Standardprogramrubrik
-variable.TabTitle.description=Rubrik för aktuell flik
-variable.Profile.description=Aktuell profil
-variable.Toolkit.description=Grafikverktyg
-variable.TabsCount.description=Count of visible tabs
diff --git a/extension/chrome/locale/zh-CN/customize.dtd b/extension/chrome/locale/zh-CN/customize.dtd
deleted file mode 100644
index c14ac5b..0000000
--- a/extension/chrome/locale/zh-CN/customize.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/zh-CN/nightly.dtd b/extension/chrome/locale/zh-CN/nightly.dtd
deleted file mode 100644
index 582ce3f..0000000
--- a/extension/chrome/locale/zh-CN/nightly.dtd
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/zh-CN/nightly.properties b/extension/chrome/locale/zh-CN/nightly.properties
deleted file mode 100644
index abc0c1b..0000000
--- a/extension/chrome/locale/zh-CN/nightly.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description=nightly 测试者的实用工具集。
-nightly.notextbox.message=在使用此功能前你必须选择一个文本框。
-nightly.notextbox.clipboardInstead.message=Or you could copy it to the Clipboard now.
-nightly.copyButton.message=Copy to Clipboard
-nightly.noextensions.message=未发现扩展。
-nightly.restart.message=附加组件兼容性已更改,重新启动来应用到当前安装的附加组件
-nightly.restart.label=重新启动
-nightly.restart.accesskey=R
-nightly.variables.nullvalue=Undefined
diff --git a/extension/chrome/locale/zh-CN/screenshot.dtd b/extension/chrome/locale/zh-CN/screenshot.dtd
deleted file mode 100644
index f67dfd6..0000000
--- a/extension/chrome/locale/zh-CN/screenshot.dtd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extension/chrome/locale/zh-CN/screenshot.properties b/extension/chrome/locale/zh-CN/screenshot.properties
deleted file mode 100644
index 00f8644..0000000
--- a/extension/chrome/locale/zh-CN/screenshot.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-screenshot.filepicker.title=保存屏幕截图为...
-screenshot.filepicker.filterJPG=JPG 文件。(*.jpg)
-screenshot.filepicker.filterPNG=PNG 文件。(*.png)
-screenshot.timer.label=延迟捕获:%S
diff --git a/extension/chrome/locale/zh-CN/variables.properties b/extension/chrome/locale/zh-CN/variables.properties
deleted file mode 100644
index 034de4f..0000000
--- a/extension/chrome/locale/zh-CN/variables.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-variable.AppID.description=应用程序标识符
-variable.Vendor.description=应用程序供应商
-variable.Name.description=应用程序名称
-variable.Version.description=应用程序版本
-variable.AppBuildID.description=应用程序构建标识符
-variable.Changeset.description=由此变更集构建
-variable.PlatformBuildID.description=XUL 平台构建标识符
-variable.PlatformVersion.description=XUL 平台版本
-variable.GeckoBuildID.description=Gecko 构建标识符
-variable.GeckoVersion.description=Gecko 版本
-variable.BrandName.description=应用程序商标名称
-variable.UserAgent.description=用户代理字符串
-variable.Locale.description=当前语言区域
-variable.OS.description=编译操作系统
-variable.Processor.description=编译处理器
-variable.Compiler.description=编译器
-variable.DefaultTitle.description=默认应用程序标题
-variable.TabTitle.description=当前标签标题
-variable.Profile.description=当前配置文件
-variable.Toolkit.description=图形工具包
-variable.TabsCount.description=Count of visible tabs
diff --git a/extension/chrome/skin/aboutNightly/aboutNightly-sb.css b/extension/chrome/skin/aboutNightly/aboutNightly-sb.css
deleted file mode 100644
index 3d17287..0000000
--- a/extension/chrome/skin/aboutNightly/aboutNightly-sb.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-html {
- background: -moz-Dialog;
- padding: 0 1em;
- font: message-box;
-}
-
-body {
- color: -moz-FieldText;
- position: relative;
- min-width: 330px;
- max-width: 50em;
- margin: 4em auto;
- border: 1px solid ThreeDShadow;
- -moz-border-radius: 10px;
- padding: 3em;
- -moz-padding-start: 30px;
- background: -moz-Field;
-}
-
-h1 {
- margin-top: 0;
-}
-
-.aboutPageWideContainer {
- max-width: 80%;
-}
-
-#aboutLogoContainer {
- border: 1px solid ThreeDLightShadow;
- width: 300px;
- margin-bottom: 2em;
-}
-
-img {
- border: 0;
-}
-
-#version {
- font-weight: bold;
- color: #909090;
- margin: -24px 0 9px 17px;
-}
-
-ul {
- margin: 0;
- -moz-margin-start: 1.5em;
- padding: 0;
- list-style: square;
-}
-
-ul > li {
- margin-top: .5em;
-}
-
-th, td {
- padding: 0 5px;
-}
diff --git a/extension/chrome/skin/aboutNightly/aboutNightly.css b/extension/chrome/skin/aboutNightly/aboutNightly.css
deleted file mode 100644
index 1bd4e89..0000000
--- a/extension/chrome/skin/aboutNightly/aboutNightly.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-h1 {
- margin-top: 0;
-}
diff --git a/extension/chrome/skin/browser.css b/extension/chrome/skin/browser.css
deleted file mode 100644
index 7b714da..0000000
--- a/extension/chrome/skin/browser.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#nightly-tester-enter {
- list-style-image: url("chrome://nightly/skin/idlarge.png");
-}
-
-toolbar[iconsize="small"] #nightly-tester-enter {
- list-style-image: url("chrome://nightly/skin/idsmall.png");
-}
-
-.popup-notification-icon[popupid="nightly-compatibility-restart"] {
- list-style-image: url("chrome://nightly/content/brand/logo.png");
-}
diff --git a/extension/chrome/skin/idlarge.png b/extension/chrome/skin/idlarge.png
deleted file mode 100644
index 6136b79..0000000
Binary files a/extension/chrome/skin/idlarge.png and /dev/null differ
diff --git a/extension/chrome/skin/idsmall.png b/extension/chrome/skin/idsmall.png
deleted file mode 100644
index 97f6e61..0000000
Binary files a/extension/chrome/skin/idsmall.png and /dev/null differ
diff --git a/extension/chrome/skin/screenshot/screenshot.css b/extension/chrome/skin/screenshot/screenshot.css
deleted file mode 100644
index 1c742eb..0000000
--- a/extension/chrome/skin/screenshot/screenshot.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-window {
-}
-
-scrollbox {
- overflow: auto;
-}
diff --git a/extension/chrome/skin/titlebar/titlebar.css b/extension/chrome/skin/titlebar/titlebar.css
deleted file mode 100644
index 2491978..0000000
--- a/extension/chrome/skin/titlebar/titlebar.css
+++ /dev/null
@@ -1,11 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#variableTree {
- height: 17em;
-}
-
-#NightlyTesterOptions {
- width: 42.75em;
-}
diff --git a/extension/components/aboutNightly.js b/extension/components/aboutNightly.js
deleted file mode 100644
index 8a6b510..0000000
--- a/extension/components/aboutNightly.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function AboutNightly() {}
-AboutNightly.prototype = {
- classDescription: "about:nightly",
- contractID: "@mozilla.org/network/protocol/about;1?what=nightly",
- classID: Components.ID("{4cec494a-d33a-4ee7-83d6-461925b5d84b}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
-
- getURIFlags: function(aURI) {
- return Ci.nsIAboutModule.ALLOW_SCRIPT;
- },
-
- newChannel: function(aURI) {
- let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
- let channel = ios.newChannel("chrome://nightly/content/aboutNightly/aboutNightly.xhtml",
- null, null);
- channel.originalURI = aURI;
- return channel;
- }
-};
-
-
-var components = [AboutNightly];
-
-if (XPCOMUtils.generateNSGetFactory)
- var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
-else
- var NSGetModule = XPCOMUtils.generateNSGetModule(components);
diff --git a/extension/components/nttAddonCompatibilityService.js b/extension/components/nttAddonCompatibilityService.js
deleted file mode 100644
index 7756d85..0000000
--- a/extension/components/nttAddonCompatibilityService.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const PREF_FORCE_COMPAT = "nightly.disableCheckCompatibility";
-const PREF_CHECK_COMPAT_PREFIX = "extensions.checkCompatibility.";
-const PREF_CHECK_COMPAT_NIGHTLY = "extensions.checkCompatibility.nightly";
-
-
-function nttAddonCompatibilityService() {
- this.prefService = Cc['@mozilla.org/preferences-service;1']
- .getService(Ci.nsIPrefBranch2);
-
- this.prefService.addObserver(PREF_FORCE_COMPAT, this, false);
-
- this.appinfo = Cc["@mozilla.org/xre/app-info;1"]
- .getService(Ci.nsIXULAppInfo);
-
- this.obs = Cc["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService);
-
- this.version = this.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/i, "$1");
-
- if (this.prefService.getBoolPref(PREF_FORCE_COMPAT)) {
- this.setCompatPrefs();
- }
-
- this.wrappedJSObject = this;
-}
-
-nttAddonCompatibilityService.prototype = {
- classDescription: "Nightly Tester Tools Addon Compatibility",
- classID: Components.ID("{126c18c5-386c-4c13-b59f-dc909e78aea0}"),
- contractID: "@mozilla.com/nightly/addoncompatibility;1",
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
-
- // nsIObserver
- observe : function (subject, topic, data) {
- if (topic == "nsPref:changed") {
- switch (data) {
- case PREF_FORCE_COMPAT:
- this.setCompatPrefsHelper();
- break;
- default:
- break;
- }
- }
- },
-
- setCompatPrefsHelper : function () {
- let self = this;
- let notifyObject = { restart: true };
- function sendNotification(options) {
- let { count } = options;
- let startCount = count();
- self.setCompatPrefs();
- notifyObject.restart = startCount !== count();
- self.obs.notifyObservers(null, "_nttACS", JSON.stringify(notifyObject));
- }
- try {
- Cu.import("resource://gre/modules/AddonManager.jsm");
- AddonManager.getAddonsByTypes(null, function (aAddons) {
- function count() {
- return aAddons.filter(function isPendingAddon(aAddon) {
- return (aAddon.pendingOperations & AddonManager.PENDING_ENABLE) != 0 ||
- (aAddon.pendingOperations & AddonManager.PENDING_DISABLE) != 0
- ;
- }).length;
- }
- sendNotification({count: count});
- });
- } catch (e) {
- // old extension manager API
- let counter = 0;
- function count() {
- // Feel free to write the real count() for the old EM API,
- // but now it's always returning a different number
- return counter++;
- }
- sendNotification({count: count});
- }
- },
-
- setCompatPrefs : function () {
- var prefs = [];
-
- switch (this.appinfo.name) {
- case "Songbird":
- /**
- * Excluding Songbird because it is based on Gecko 1.9.2
- * and "extensions.checkCompatibility.nightly" preference
- * introduced in Gecko 7.
- *
- * @see http://kb.mozillazine.org/Extensions.checkCompatibility
- * @see http://www.oxymoronical.com/blog/2011/05/How-to-disable-extension-compatibility-checking-on-Nightly-builds-of-Firefox
- */
- break;
- default:
- prefs.push(PREF_CHECK_COMPAT_NIGHTLY);
- break;
- }
- prefs.push(PREF_CHECK_COMPAT_PREFIX + this.version);
-
- var enable = !this.prefService.getBoolPref(PREF_FORCE_COMPAT);
- for (var i = 0; i < prefs.length; i++) {
- this.prefService.setBoolPref(prefs[i], enable);
- }
- },
-
- restart : function () {
- let canceled = Cc["@mozilla.org/supports-PRBool;1"]
- .createInstance(Ci.nsISupportsPRBool);
- this.obs.notifyObservers(canceled, "quit-application-requested", "restart");
-
- if (canceled.data) {
- return false; // somebody canceled our quit request
- }
-
- // restart
- Cc['@mozilla.org/toolkit/app-startup;1'].getService(Ci.nsIAppStartup)
- .quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
-
- return true;
- },
-};
-
-var components = [nttAddonCompatibilityService];
-
-if (XPCOMUtils.generateNSGetFactory)
- var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
-else
- var NSGetModule = XPCOMUtils.generateNSGetModule(components);
diff --git a/extension/content.js b/extension/content.js
new file mode 100644
index 0000000..55605f5
--- /dev/null
+++ b/extension/content.js
@@ -0,0 +1,20 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Parse a message from the frontend script and execute a specified command.
+ * @param {Object.} message - A message object from frontend.
+ */
+const handle_command = message => {
+ const $active = document.activeElement;
+ const is_textbox = 'placeholder' in $active && !$active.readOnly;
+
+ if (message.command === 'insert_to_textbox' && is_textbox) {
+ $active.value += ($active.value.length ? ' ' : '') + message.value;
+ }
+};
+
+browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
+ handle_command(message);
+});
diff --git a/extension/defaults/preferences/nightlytools.js b/extension/defaults/preferences/nightlytools.js
deleted file mode 100644
index ecd5fb6..0000000
--- a/extension/defaults/preferences/nightlytools.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-pref("nightly.idtitle", true);
-
-pref("nightly.disableCheckCompatibility", false);
-
-pref("nightly.currChangeset", "");
-pref("nightly.prevChangeset", "");
-
-pref("extensions.{8620c15f-30dc-4dba-a131-7c5d20cf4a29}.description", "chrome://nightly/locale/nightly.properties");
diff --git a/extension/defaults/preferences/variables.js b/extension/defaults/preferences/variables.js
deleted file mode 100644
index cb4e87e..0000000
--- a/extension/defaults/preferences/variables.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-pref("nightly.templates.buildid", "${UserAgent} ID:${AppBuildID}${Flags} CSet: ${Changeset}");
-pref("nightly.templates.title", "${DefaultTitle} (Build ${AppBuildID})");
diff --git a/extension/icons/icon-16.png b/extension/icons/icon-16.png
new file mode 100644
index 0000000..f5baf7e
Binary files /dev/null and b/extension/icons/icon-16.png differ
diff --git a/extension/icons/icon-32.png b/extension/icons/icon-32.png
new file mode 100644
index 0000000..ee5fc4b
Binary files /dev/null and b/extension/icons/icon-32.png differ
diff --git a/extension/icons/icon-48.png b/extension/icons/icon-48.png
new file mode 100644
index 0000000..9945ce1
Binary files /dev/null and b/extension/icons/icon-48.png differ
diff --git a/extension/icons/icon-96.png b/extension/icons/icon-96.png
new file mode 100644
index 0000000..134ebb1
Binary files /dev/null and b/extension/icons/icon-96.png differ
diff --git a/extension/install.rdf b/extension/install.rdf
deleted file mode 100644
index 70a93be..0000000
--- a/extension/install.rdf
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
- {8620c15f-30dc-4dba-a131-7c5d20cf4a29}
- 3.10
- 2
- true
-
-
- Nightly Tester Tools
- Useful tools for the nightly tester.
- Automation Development
- Dave Hunt
- Dave Townsend (original author)
- Ed Morley
- FAMFAMFAM (Some icons)
- Heather Arthur
- Henrik Skupin
- Jeff Hammel
- Jesse Ruderman (Mac fixes)
- Peter van der Woude (original idea)
- Stephen Lau (Songbird port)
- Steve England (QA)
- Szabolcs Hubai
- Tony Mechelynck
- Utilu
-
- Mikael Hiort af Ornäs (sv-SE)
- Wang.H.K (zh-CN)
- KOLANICH (ru-RU)
-
- ru-RU
- Полезные инструменты для nightly-тестера.
-
- Stefan Plewako, zespół Aviary.pl (pl)
-
- pl
- Użyteczne narzędzia dla testerów wersji Nightly.
-
- Kosuke Kaizuka (ja, ja-JP-mac)
-
- ja
- 開発版のテスト利用者のための有用なツールを提供します
-
-
- chrome://nightly/content/brand/icon.png
- https://wiki.mozilla.org/Auto-tools/Automation_Development/Projects/Addons/NightlyTesterTools
-
-
-
-
- {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- 39.0
- 56.0
-
-
-
-
-
-
- {3550f703-e582-4d05-9a08-453d09bdfdc6}
- 39.0
- 56.0
-
-
-
-
-
-
- {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
- 2.38
- 2.53
-
-
-
-
-
-
-
- toolkit@mozilla.org
- 39.0
- 56.0
-
-
-
-
-
diff --git a/extension/manifest.json b/extension/manifest.json
new file mode 100644
index 0000000..a04c554
--- /dev/null
+++ b/extension/manifest.json
@@ -0,0 +1,51 @@
+{
+ "manifest_version": 2,
+ "applications": {
+ "gecko": {
+ "id": "{8620c15f-30dc-4dba-a131-7c5d20cf4a29}",
+ "strict_min_version": "56.0"
+ }
+ },
+ "name": "__MSG_extension_name__",
+ "description": "__MSG_extension_description__",
+ "version": "4.0pre20170912",
+ "author": "Automation Development, Kohei Yoshino",
+ "homepage_url": "https://wiki.mozilla.org/QA/Automation/Projects/Addons/NightlyTesterTools",
+ "default_locale": "en_US",
+ "permissions": [
+ "clipboardWrite",
+ "management",
+ "menus",
+ "storage",
+ "tabs"
+ ],
+ "icons": {
+ "48": "icons/icon-48.png",
+ "96": "icons/icon-96.png"
+ },
+ "browser_action": {
+ "browser_style": true,
+ "default_icon": {
+ "16": "icons/icon-16.png",
+ "32": "icons/icon-32.png"
+ },
+ "default_title": "__MSG_extension_name__",
+ "default_popup": "menu.html"
+ },
+ "options_ui": {
+ "browser_style": true,
+ "page": "options.html"
+ },
+ "background": {
+ "scripts": [
+ "shared.js",
+ "background.js"
+ ]
+ },
+ "content_scripts": [
+ {
+ "matches": [""],
+ "js": ["content.js"]
+ }
+ ]
+}
diff --git a/extension/menu.html b/extension/menu.html
new file mode 100644
index 0000000..573e84e
--- /dev/null
+++ b/extension/menu.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extension/menu.js b/extension/menu.js
new file mode 100644
index 0000000..9086602
--- /dev/null
+++ b/extension/menu.js
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+window.addEventListener('DOMContentLoaded', async event => {
+ localize_page();
+});
+
+document.addEventListener('click', async event => {
+ await handle_command(event.target.dataset.command);
+ window.close();
+});
diff --git a/extension/modules/Logging.jsm b/extension/modules/Logging.jsm
deleted file mode 100644
index 55eaf0a..0000000
--- a/extension/modules/Logging.jsm
+++ /dev/null
@@ -1,74 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var EXPORTED_SYMBOLS = ["LOG", "WARN", "ERROR"];
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-
-var gLoggingEnabled = false;
-
-function logMessage(text, level) {
- var caller = null;
- try {
- caller = Components.stack.caller.caller;
- }
- catch (e) { }
-
- var msg = Cc["@mozilla.org/scripterror;1"].
- createInstance(Ci.nsIScriptError);
- if (caller) {
- var filename = caller.filename;
- var sourceLine = caller.sourceLine;
- var lineNumber = caller.lineNumber;
- }
- else {
- var filename = "";
- var sourceLine = "";
- var lineNumber = 0;
- }
- msg.init(text, filename, sourceLine, lineNumber, 0,
- level, "XUL JavaScript");
-
- var console = Cc["@mozilla.org/consoleservice;1"].
- getService(Ci.nsIConsoleService);
- console.logMessage(msg);
-}
-
-function ERROR(string) {
- dump("NTT ERROR: " + string + "\n");
- logMessage("NTT: " + string, Ci.nsIScriptError.errorFlag);
-}
-
-function WARN(string) {
- dump("NTT WARN : " + string + "\n");
- logMessage("NTT: " + string, Ci.nsIScriptError.warningFlag);
-}
-
-function LOG(string) {
- if (gLoggingEnabled) {
- dump("NTT LOG : " + string + "\n");
-
- var caller = null;
- try {
- caller = Components.stack.caller;
- }
- catch (e) { }
-
- if (caller)
- string += " (" + caller.filename + ":" + caller.lineNumber + ")";
-
- var console = Cc["@mozilla.org/consoleservice;1"].
- getService(Ci.nsIConsoleService);
- console.logStringMessage("NTT: " + string);
- }
-}
-
-var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-try {
- gLoggingEnabled = prefs.getBoolPref("nightly.logging");
-}
-catch (e) { }
diff --git a/extension/options.html b/extension/options.html
new file mode 100644
index 0000000..e7ee92d
--- /dev/null
+++ b/extension/options.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extension/options.js b/extension/options.js
new file mode 100644
index 0000000..41c58b4
--- /dev/null
+++ b/extension/options.js
@@ -0,0 +1,78 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const default_template = '(Build ${AppBuildID})';
+let enable_custom_title = false;
+let custom_template = '';
+let $checkbox;
+let $input;
+let $tbody;
+
+/**
+ * Initialize the option view.
+ */
+const init_view = async () => {
+ $checkbox = document.querySelector('#enable_custom_title');
+ $input = document.querySelector('#custom_template');
+ $tbody = document.querySelector('#variable_tbody');
+
+ $checkbox.addEventListener('change', event => save_pref());
+ $input.addEventListener('input', event => save_pref());
+
+ try {
+ const pref = await browser.storage.local.get();
+
+ $checkbox.checked = enable_custom_title = pref.enable_custom_title || false;
+ $input.value = custom_template = pref.custom_template || default_template;
+ } catch (ex) {}
+
+ for (const [key, value] of Object.entries(await get_variable_values())) {
+ const $row = $tbody.insertRow();
+ const $cell_key = $row.insertCell();
+ const $cell_desc = $row.insertCell();
+ const $cell_value = $row.insertCell();
+
+ $row.addEventListener('click', event => insert_or_remove_variable(key));
+
+ $cell_key.textContent = '${' + key + '}';
+ $cell_desc.textContent = browser.i18n.getMessage(`variable_${key}`);
+ $cell_value.textContent = value || '(unknown)';
+ }
+};
+
+/**
+ * Insert a variable into the custom template when a table row is clicked. If the template already contains the
+ * variable, remove it instead.
+ * @param {String} key - A variable name.
+ */
+const insert_or_remove_variable = key => {
+ const str = '${' + key + '}';
+
+ if ($input.value.includes(str)) {
+ $input.value = $input.value.replace(str, '');
+ } else {
+ $input.value += ' ' + str;
+ }
+
+ $input.value = $input.value.trim().replace(/\s{2,}/g, ' ');
+
+ save_pref();
+};
+
+/**
+ * Save the preference and update the window title bar in background.
+ */
+const save_pref = async () => {
+ enable_custom_title = $checkbox.checked;
+ custom_template = $input.value;
+
+ try {
+ await browser.storage.local.set({ enable_custom_title, custom_template });
+ } catch (ex) {}
+};
+
+window.addEventListener('DOMContentLoaded', async event => {
+ localize_page();
+ init_view();
+});
diff --git a/extension/shared.js b/extension/shared.js
new file mode 100644
index 0000000..5e2b706
--- /dev/null
+++ b/extension/shared.js
@@ -0,0 +1,113 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Retrieve the current variable values from the runtime.
+ * @return {Object.} The values.
+ */
+const get_variable_values = async () => {
+ const browser_info = await browser.runtime.getBrowserInfo();
+ const platform_info = await browser.runtime.getPlatformInfo();
+
+ return {
+ 'AppBuildID': browser_info.buildID,
+ // 'AppID',
+ // 'BrandName',
+ // 'Changeset',
+ // 'Compiler',
+ // 'DefaultTitle': (await browser.tabs.getCurrent()).title,
+ 'GeckoVersion': browser_info.version,
+ 'Locale': browser.i18n.getUILanguage(),
+ 'Name': browser_info.name,
+ 'OS': platform_info.os,
+ 'PlatformBuildID': browser_info.buildID,
+ 'PlatformVersion': browser_info.version,
+ 'Processor': platform_info.arch,
+ // 'Profile',
+ 'TabsCount': (await browser.tabs.query({})).length,
+ // 'TabTitle': (await browser.tabs.getCurrent()).title,
+ // 'Toolkit',
+ 'UserAgent': navigator.userAgent,
+ 'Vendor': browser_info.vendor,
+ 'Version': browser_info.version,
+ };
+};
+
+/**
+ * Localize the current HTML page. Each localizable element must specify a message name with the `data-i18n` attribute.
+ */
+const localize_page = () => {
+ document.querySelectorAll('[data-i18n]').forEach($node => {
+ $node.textContent = browser.i18n.getMessage($node.dataset.i18n);
+ });
+};
+
+/**
+ * Send a message to the content script.
+ * @param {String} command - A distinguishable command name.
+ * @param {*} value - Any value to be passed to content.
+ */
+const send_message = async (command, value) => {
+ const tabs = await browser.tabs.query({ active: true, currentWindow: true });
+
+ browser.tabs.sendMessage(tabs[0].id, { command, value });
+};
+
+/**
+ * Copy a string to the system clipboard.
+ * @param {String} str - A string to be copied.
+ */
+const copy_to_clipboard = str => {
+ const $textbox = document.body.appendChild(document.createElement('textarea'));
+
+ $textbox.value = str;
+ $textbox.select();
+ document.execCommand('Copy');
+ $textbox.remove();
+};
+
+/**
+ * Insert a string into the focused textbox, either or