diff --git a/extension/LICENSE b/extension/LICENSE deleted file mode 120000 index ea5b606..0000000 --- a/extension/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE \ No newline at end of file diff --git a/extension/chrome/LICENSE b/extension/chrome/LICENSE new file mode 120000 index 0000000..30cff74 --- /dev/null +++ b/extension/chrome/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/extension/chrome/ReadMe.txt b/extension/chrome/ReadMe.txt new file mode 120000 index 0000000..fc2ea85 --- /dev/null +++ b/extension/chrome/ReadMe.txt @@ -0,0 +1 @@ +../firefox/ReadMe.txt \ No newline at end of file diff --git a/extension/chrome/_locales b/extension/chrome/_locales new file mode 120000 index 0000000..9992596 --- /dev/null +++ b/extension/chrome/_locales @@ -0,0 +1 @@ +../firefox/_locales \ No newline at end of file diff --git a/extension/chrome/common.js b/extension/chrome/common.js new file mode 120000 index 0000000..5b1350b --- /dev/null +++ b/extension/chrome/common.js @@ -0,0 +1 @@ +../firefox/common.js \ No newline at end of file diff --git a/extension/chrome/data b/extension/chrome/data new file mode 120000 index 0000000..fe0969c --- /dev/null +++ b/extension/chrome/data @@ -0,0 +1 @@ +../firefox/data \ No newline at end of file diff --git a/extension/manifest.json b/extension/chrome/manifest.json similarity index 93% rename from extension/manifest.json rename to extension/chrome/manifest.json index bac8607..ad36a02 100755 --- a/extension/manifest.json +++ b/extension/chrome/manifest.json @@ -1,12 +1,9 @@ { "manifest_version": 2, "name": "__MSG_extensionName__", - "short_name": "useragent-switcher", "version": "0.4.4", "default_locale": "en", - "description": "__MSG_extensionDescription__", - "permissions": [ "tabs", "storage", @@ -16,7 +13,6 @@ "webRequestBlocking", "contextMenus" ], - "icons": { "16": "data/icons/active/16.png", "18": "data/icons/active/18.png", diff --git a/extension/chrome/schema.json b/extension/chrome/schema.json new file mode 120000 index 0000000..73c74a7 --- /dev/null +++ b/extension/chrome/schema.json @@ -0,0 +1 @@ +../firefox/schema.json \ No newline at end of file diff --git a/extension/chrome/ua-parser.min.js b/extension/chrome/ua-parser.min.js new file mode 120000 index 0000000..3536765 --- /dev/null +++ b/extension/chrome/ua-parser.min.js @@ -0,0 +1 @@ +../firefox/ua-parser.min.js \ No newline at end of file diff --git a/extension/data/popup/browsers b/extension/data/popup/browsers deleted file mode 120000 index aca4d58..0000000 --- a/extension/data/popup/browsers +++ /dev/null @@ -1 +0,0 @@ -../../../node/browsers/ \ No newline at end of file diff --git a/extension/data/popup/map.json b/extension/data/popup/map.json deleted file mode 120000 index b2c279b..0000000 --- a/extension/data/popup/map.json +++ /dev/null @@ -1 +0,0 @@ -../../../node/map.json \ No newline at end of file diff --git a/extension/data/popup/matched.js b/extension/data/popup/matched.js deleted file mode 120000 index 543d09d..0000000 --- a/extension/data/popup/matched.js +++ /dev/null @@ -1 +0,0 @@ -../../../../_/matched/matched.js \ No newline at end of file diff --git a/extension/data/popup/matched.json b/extension/data/popup/matched.json deleted file mode 120000 index 003b56f..0000000 --- a/extension/data/popup/matched.json +++ /dev/null @@ -1 +0,0 @@ -../../../../_/matched/matched.json \ No newline at end of file diff --git a/extension/firefox/LICENSE b/extension/firefox/LICENSE new file mode 120000 index 0000000..30cff74 --- /dev/null +++ b/extension/firefox/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/extension/ReadMe.txt b/extension/firefox/ReadMe.txt similarity index 100% rename from extension/ReadMe.txt rename to extension/firefox/ReadMe.txt diff --git a/extension/_locales/en/messages.json b/extension/firefox/_locales/en/messages.json similarity index 100% rename from extension/_locales/en/messages.json rename to extension/firefox/_locales/en/messages.json diff --git a/extension/_locales/ru/messages.json b/extension/firefox/_locales/ru/messages.json similarity index 100% rename from extension/_locales/ru/messages.json rename to extension/firefox/_locales/ru/messages.json diff --git a/extension/common.js b/extension/firefox/common.js similarity index 97% rename from extension/common.js rename to extension/firefox/common.js index 09648f9..cc56f3a 100644 --- a/extension/common.js +++ b/extension/firefox/common.js @@ -495,6 +495,7 @@ const onBeforeSendHeaders = d => { return {}; } const o = (cache[tabId] || ua.object(tabId, undefined, cookieStoreId)); + const str = o ? o.userAgent : ''; if (str && requestHeaders.length) { for (let i = 0, name = requestHeaders[0].name; i < requestHeaders.length; i += 1, name = (requestHeaders[i] || {}).name) { @@ -577,6 +578,22 @@ chrome.storage.local.get({ } }); +/* message passing */ +chrome.runtime.onMessage.addListener((request, sender, response) => { + if (request.method === 'parse-ua') { + response(ua.parse(request.value)); + } + else if (request.method === 'get-ua') { + response(prefs.ua || '' || navigator.userAgent); + } + else if (request.method === 'request-update') { + if (request.delete) { + delete ua._obj[request.cookieStoreId]; + } + ua.update(request.value, undefined, request.cookieStoreId); + } +}); + /* FAQs & Feedback */ { const {management, runtime: {onInstalled, setUninstallURL, getManifest}, storage, tabs} = chrome; diff --git a/extension/data/icons/128.png b/extension/firefox/data/icons/128.png similarity index 100% rename from extension/data/icons/128.png rename to extension/firefox/data/icons/128.png diff --git a/extension/data/icons/16.png b/extension/firefox/data/icons/16.png similarity index 100% rename from extension/data/icons/16.png rename to extension/firefox/data/icons/16.png diff --git a/extension/data/icons/18.png b/extension/firefox/data/icons/18.png similarity index 100% rename from extension/data/icons/18.png rename to extension/firefox/data/icons/18.png diff --git a/extension/data/icons/19.png b/extension/firefox/data/icons/19.png similarity index 100% rename from extension/data/icons/19.png rename to extension/firefox/data/icons/19.png diff --git a/extension/data/icons/256.png b/extension/firefox/data/icons/256.png similarity index 100% rename from extension/data/icons/256.png rename to extension/firefox/data/icons/256.png diff --git a/extension/data/icons/32.png b/extension/firefox/data/icons/32.png similarity index 100% rename from extension/data/icons/32.png rename to extension/firefox/data/icons/32.png diff --git a/extension/data/icons/36.png b/extension/firefox/data/icons/36.png similarity index 100% rename from extension/data/icons/36.png rename to extension/firefox/data/icons/36.png diff --git a/extension/data/icons/38.png b/extension/firefox/data/icons/38.png similarity index 100% rename from extension/data/icons/38.png rename to extension/firefox/data/icons/38.png diff --git a/extension/data/icons/48.png b/extension/firefox/data/icons/48.png similarity index 100% rename from extension/data/icons/48.png rename to extension/firefox/data/icons/48.png diff --git a/extension/data/icons/512.png b/extension/firefox/data/icons/512.png similarity index 100% rename from extension/data/icons/512.png rename to extension/firefox/data/icons/512.png diff --git a/extension/data/icons/64.png b/extension/firefox/data/icons/64.png similarity index 100% rename from extension/data/icons/64.png rename to extension/firefox/data/icons/64.png diff --git a/extension/data/icons/active/128.png b/extension/firefox/data/icons/active/128.png similarity index 100% rename from extension/data/icons/active/128.png rename to extension/firefox/data/icons/active/128.png diff --git a/extension/data/icons/active/16.png b/extension/firefox/data/icons/active/16.png similarity index 100% rename from extension/data/icons/active/16.png rename to extension/firefox/data/icons/active/16.png diff --git a/extension/data/icons/active/18.png b/extension/firefox/data/icons/active/18.png similarity index 100% rename from extension/data/icons/active/18.png rename to extension/firefox/data/icons/active/18.png diff --git a/extension/data/icons/active/19.png b/extension/firefox/data/icons/active/19.png similarity index 100% rename from extension/data/icons/active/19.png rename to extension/firefox/data/icons/active/19.png diff --git a/extension/data/icons/active/256.png b/extension/firefox/data/icons/active/256.png similarity index 100% rename from extension/data/icons/active/256.png rename to extension/firefox/data/icons/active/256.png diff --git a/extension/data/icons/active/32.png b/extension/firefox/data/icons/active/32.png similarity index 100% rename from extension/data/icons/active/32.png rename to extension/firefox/data/icons/active/32.png diff --git a/extension/data/icons/active/36.png b/extension/firefox/data/icons/active/36.png similarity index 100% rename from extension/data/icons/active/36.png rename to extension/firefox/data/icons/active/36.png diff --git a/extension/data/icons/active/38.png b/extension/firefox/data/icons/active/38.png similarity index 100% rename from extension/data/icons/active/38.png rename to extension/firefox/data/icons/active/38.png diff --git a/extension/data/icons/active/48.png b/extension/firefox/data/icons/active/48.png similarity index 100% rename from extension/data/icons/active/48.png rename to extension/firefox/data/icons/active/48.png diff --git a/extension/data/icons/active/512.png b/extension/firefox/data/icons/active/512.png similarity index 100% rename from extension/data/icons/active/512.png rename to extension/firefox/data/icons/active/512.png diff --git a/extension/data/icons/active/64.png b/extension/firefox/data/icons/active/64.png similarity index 100% rename from extension/data/icons/active/64.png rename to extension/firefox/data/icons/active/64.png diff --git a/extension/data/icons/ignored/128.png b/extension/firefox/data/icons/ignored/128.png similarity index 100% rename from extension/data/icons/ignored/128.png rename to extension/firefox/data/icons/ignored/128.png diff --git a/extension/data/icons/ignored/16.png b/extension/firefox/data/icons/ignored/16.png similarity index 100% rename from extension/data/icons/ignored/16.png rename to extension/firefox/data/icons/ignored/16.png diff --git a/extension/data/icons/ignored/18.png b/extension/firefox/data/icons/ignored/18.png similarity index 100% rename from extension/data/icons/ignored/18.png rename to extension/firefox/data/icons/ignored/18.png diff --git a/extension/data/icons/ignored/19.png b/extension/firefox/data/icons/ignored/19.png similarity index 100% rename from extension/data/icons/ignored/19.png rename to extension/firefox/data/icons/ignored/19.png diff --git a/extension/data/icons/ignored/256.png b/extension/firefox/data/icons/ignored/256.png similarity index 100% rename from extension/data/icons/ignored/256.png rename to extension/firefox/data/icons/ignored/256.png diff --git a/extension/data/icons/ignored/32.png b/extension/firefox/data/icons/ignored/32.png similarity index 100% rename from extension/data/icons/ignored/32.png rename to extension/firefox/data/icons/ignored/32.png diff --git a/extension/data/icons/ignored/36.png b/extension/firefox/data/icons/ignored/36.png similarity index 100% rename from extension/data/icons/ignored/36.png rename to extension/firefox/data/icons/ignored/36.png diff --git a/extension/data/icons/ignored/38.png b/extension/firefox/data/icons/ignored/38.png similarity index 100% rename from extension/data/icons/ignored/38.png rename to extension/firefox/data/icons/ignored/38.png diff --git a/extension/data/icons/ignored/48.png b/extension/firefox/data/icons/ignored/48.png similarity index 100% rename from extension/data/icons/ignored/48.png rename to extension/firefox/data/icons/ignored/48.png diff --git a/extension/data/icons/ignored/512.png b/extension/firefox/data/icons/ignored/512.png similarity index 100% rename from extension/data/icons/ignored/512.png rename to extension/firefox/data/icons/ignored/512.png diff --git a/extension/data/icons/ignored/64.png b/extension/firefox/data/icons/ignored/64.png similarity index 100% rename from extension/data/icons/ignored/64.png rename to extension/firefox/data/icons/ignored/64.png diff --git a/extension/data/inject.js b/extension/firefox/data/inject.js similarity index 100% rename from extension/data/inject.js rename to extension/firefox/data/inject.js diff --git a/extension/data/options/index.css b/extension/firefox/data/options/index.css similarity index 100% rename from extension/data/options/index.css rename to extension/firefox/data/options/index.css diff --git a/extension/data/options/index.html b/extension/firefox/data/options/index.html similarity index 100% rename from extension/data/options/index.html rename to extension/firefox/data/options/index.html diff --git a/extension/data/options/index.js b/extension/firefox/data/options/index.js similarity index 100% rename from extension/data/options/index.js rename to extension/firefox/data/options/index.js diff --git a/node/browsers/android browser-android.json b/extension/firefox/data/popup/browsers/android browser-android.json similarity index 100% rename from node/browsers/android browser-android.json rename to extension/firefox/data/popup/browsers/android browser-android.json diff --git a/node/browsers/android browser-windows.json b/extension/firefox/data/popup/browsers/android browser-windows.json similarity index 100% rename from node/browsers/android browser-windows.json rename to extension/firefox/data/popup/browsers/android browser-windows.json diff --git a/node/browsers/arora-linux.json b/extension/firefox/data/popup/browsers/arora-linux.json similarity index 100% rename from node/browsers/arora-linux.json rename to extension/firefox/data/popup/browsers/arora-linux.json diff --git a/node/browsers/arora-windows.json b/extension/firefox/data/popup/browsers/arora-windows.json similarity index 100% rename from node/browsers/arora-windows.json rename to extension/firefox/data/popup/browsers/arora-windows.json diff --git a/node/browsers/avast secure browser-windows.json b/extension/firefox/data/popup/browsers/avast secure browser-windows.json similarity index 100% rename from node/browsers/avast secure browser-windows.json rename to extension/firefox/data/popup/browsers/avast secure browser-windows.json diff --git a/node/browsers/avg secure browser-windows.json b/extension/firefox/data/popup/browsers/avg secure browser-windows.json similarity index 100% rename from node/browsers/avg secure browser-windows.json rename to extension/firefox/data/popup/browsers/avg secure browser-windows.json diff --git a/node/browsers/baiduboxapp-android.json b/extension/firefox/data/popup/browsers/baiduboxapp-android.json similarity index 100% rename from node/browsers/baiduboxapp-android.json rename to extension/firefox/data/popup/browsers/baiduboxapp-android.json diff --git a/node/browsers/basilisk-windows.json b/extension/firefox/data/popup/browsers/basilisk-windows.json similarity index 100% rename from node/browsers/basilisk-windows.json rename to extension/firefox/data/popup/browsers/basilisk-windows.json diff --git a/node/browsers/bolt-windows.json b/extension/firefox/data/popup/browsers/bolt-windows.json similarity index 100% rename from node/browsers/bolt-windows.json rename to extension/firefox/data/popup/browsers/bolt-windows.json diff --git a/node/browsers/bot-misc.json b/extension/firefox/data/popup/browsers/bot-misc.json similarity index 100% rename from node/browsers/bot-misc.json rename to extension/firefox/data/popup/browsers/bot-misc.json diff --git a/node/browsers/camino-mac os.json b/extension/firefox/data/popup/browsers/camino-mac os.json similarity index 100% rename from node/browsers/camino-mac os.json rename to extension/firefox/data/popup/browsers/camino-mac os.json diff --git a/node/browsers/chimera-mac os.json b/extension/firefox/data/popup/browsers/chimera-mac os.json similarity index 100% rename from node/browsers/chimera-mac os.json rename to extension/firefox/data/popup/browsers/chimera-mac os.json diff --git a/node/browsers/chrome headless-linux.json b/extension/firefox/data/popup/browsers/chrome headless-linux.json similarity index 100% rename from node/browsers/chrome headless-linux.json rename to extension/firefox/data/popup/browsers/chrome headless-linux.json diff --git a/node/browsers/chrome webview-android.json b/extension/firefox/data/popup/browsers/chrome webview-android.json similarity index 100% rename from node/browsers/chrome webview-android.json rename to extension/firefox/data/popup/browsers/chrome webview-android.json diff --git a/node/browsers/chrome-android.json b/extension/firefox/data/popup/browsers/chrome-android.json similarity index 100% rename from node/browsers/chrome-android.json rename to extension/firefox/data/popup/browsers/chrome-android.json diff --git a/node/browsers/chrome-chromium os.json b/extension/firefox/data/popup/browsers/chrome-chromium os.json similarity index 100% rename from node/browsers/chrome-chromium os.json rename to extension/firefox/data/popup/browsers/chrome-chromium os.json diff --git a/node/browsers/chrome-debian.json b/extension/firefox/data/popup/browsers/chrome-debian.json similarity index 100% rename from node/browsers/chrome-debian.json rename to extension/firefox/data/popup/browsers/chrome-debian.json diff --git a/node/browsers/chrome-fedora.json b/extension/firefox/data/popup/browsers/chrome-fedora.json similarity index 100% rename from node/browsers/chrome-fedora.json rename to extension/firefox/data/popup/browsers/chrome-fedora.json diff --git a/node/browsers/chrome-freebsd.json b/extension/firefox/data/popup/browsers/chrome-freebsd.json similarity index 100% rename from node/browsers/chrome-freebsd.json rename to extension/firefox/data/popup/browsers/chrome-freebsd.json diff --git a/node/browsers/chrome-ios.json b/extension/firefox/data/popup/browsers/chrome-ios.json similarity index 100% rename from node/browsers/chrome-ios.json rename to extension/firefox/data/popup/browsers/chrome-ios.json diff --git a/node/browsers/chrome-linux.json b/extension/firefox/data/popup/browsers/chrome-linux.json similarity index 100% rename from node/browsers/chrome-linux.json rename to extension/firefox/data/popup/browsers/chrome-linux.json diff --git a/node/browsers/chrome-mac os.json b/extension/firefox/data/popup/browsers/chrome-mac os.json similarity index 100% rename from node/browsers/chrome-mac os.json rename to extension/firefox/data/popup/browsers/chrome-mac os.json diff --git a/node/browsers/chrome-netbsd.json b/extension/firefox/data/popup/browsers/chrome-netbsd.json similarity index 100% rename from node/browsers/chrome-netbsd.json rename to extension/firefox/data/popup/browsers/chrome-netbsd.json diff --git a/node/browsers/chrome-openbsd.json b/extension/firefox/data/popup/browsers/chrome-openbsd.json similarity index 100% rename from node/browsers/chrome-openbsd.json rename to extension/firefox/data/popup/browsers/chrome-openbsd.json diff --git a/node/browsers/chrome-slackware.json b/extension/firefox/data/popup/browsers/chrome-slackware.json similarity index 100% rename from node/browsers/chrome-slackware.json rename to extension/firefox/data/popup/browsers/chrome-slackware.json diff --git a/node/browsers/chrome-suse.json b/extension/firefox/data/popup/browsers/chrome-suse.json similarity index 100% rename from node/browsers/chrome-suse.json rename to extension/firefox/data/popup/browsers/chrome-suse.json diff --git a/node/browsers/chrome-ubuntu.json b/extension/firefox/data/popup/browsers/chrome-ubuntu.json similarity index 100% rename from node/browsers/chrome-ubuntu.json rename to extension/firefox/data/popup/browsers/chrome-ubuntu.json diff --git a/node/browsers/chrome-unix.json b/extension/firefox/data/popup/browsers/chrome-unix.json similarity index 100% rename from node/browsers/chrome-unix.json rename to extension/firefox/data/popup/browsers/chrome-unix.json diff --git a/node/browsers/chrome-windows.json b/extension/firefox/data/popup/browsers/chrome-windows.json similarity index 100% rename from node/browsers/chrome-windows.json rename to extension/firefox/data/popup/browsers/chrome-windows.json diff --git a/node/browsers/chromium-linux.json b/extension/firefox/data/popup/browsers/chromium-linux.json similarity index 100% rename from node/browsers/chromium-linux.json rename to extension/firefox/data/popup/browsers/chromium-linux.json diff --git a/node/browsers/chromium-netbsd.json b/extension/firefox/data/popup/browsers/chromium-netbsd.json similarity index 100% rename from node/browsers/chromium-netbsd.json rename to extension/firefox/data/popup/browsers/chromium-netbsd.json diff --git a/node/browsers/chromium-ubuntu.json b/extension/firefox/data/popup/browsers/chromium-ubuntu.json similarity index 100% rename from node/browsers/chromium-ubuntu.json rename to extension/firefox/data/popup/browsers/chromium-ubuntu.json diff --git a/node/browsers/chromium-windows.json b/extension/firefox/data/popup/browsers/chromium-windows.json similarity index 100% rename from node/browsers/chromium-windows.json rename to extension/firefox/data/popup/browsers/chromium-windows.json diff --git a/node/browsers/comodo dragon-linux.json b/extension/firefox/data/popup/browsers/comodo dragon-linux.json similarity index 100% rename from node/browsers/comodo dragon-linux.json rename to extension/firefox/data/popup/browsers/comodo dragon-linux.json diff --git a/node/browsers/comodo dragon-windows.json b/extension/firefox/data/popup/browsers/comodo dragon-windows.json similarity index 100% rename from node/browsers/comodo dragon-windows.json rename to extension/firefox/data/popup/browsers/comodo dragon-windows.json diff --git a/node/browsers/conkeror-debian.json b/extension/firefox/data/popup/browsers/conkeror-debian.json similarity index 100% rename from node/browsers/conkeror-debian.json rename to extension/firefox/data/popup/browsers/conkeror-debian.json diff --git a/node/browsers/conkeror-linux.json b/extension/firefox/data/popup/browsers/conkeror-linux.json similarity index 100% rename from node/browsers/conkeror-linux.json rename to extension/firefox/data/popup/browsers/conkeror-linux.json diff --git a/node/browsers/conkeror-windows.json b/extension/firefox/data/popup/browsers/conkeror-windows.json similarity index 100% rename from node/browsers/conkeror-windows.json rename to extension/firefox/data/popup/browsers/conkeror-windows.json diff --git a/node/browsers/edge-mac os.json b/extension/firefox/data/popup/browsers/edge-mac os.json similarity index 100% rename from node/browsers/edge-mac os.json rename to extension/firefox/data/popup/browsers/edge-mac os.json diff --git a/node/browsers/edge-windows phone.json b/extension/firefox/data/popup/browsers/edge-windows phone.json similarity index 100% rename from node/browsers/edge-windows phone.json rename to extension/firefox/data/popup/browsers/edge-windows phone.json diff --git a/node/browsers/edge-windows.json b/extension/firefox/data/popup/browsers/edge-windows.json similarity index 100% rename from node/browsers/edge-windows.json rename to extension/firefox/data/popup/browsers/edge-windows.json diff --git a/node/browsers/epiphany-debian.json b/extension/firefox/data/popup/browsers/epiphany-debian.json similarity index 100% rename from node/browsers/epiphany-debian.json rename to extension/firefox/data/popup/browsers/epiphany-debian.json diff --git a/node/browsers/epiphany-fedora.json b/extension/firefox/data/popup/browsers/epiphany-fedora.json similarity index 100% rename from node/browsers/epiphany-fedora.json rename to extension/firefox/data/popup/browsers/epiphany-fedora.json diff --git a/node/browsers/epiphany-freebsd.json b/extension/firefox/data/popup/browsers/epiphany-freebsd.json similarity index 100% rename from node/browsers/epiphany-freebsd.json rename to extension/firefox/data/popup/browsers/epiphany-freebsd.json diff --git a/node/browsers/epiphany-gentoo.json b/extension/firefox/data/popup/browsers/epiphany-gentoo.json similarity index 100% rename from node/browsers/epiphany-gentoo.json rename to extension/firefox/data/popup/browsers/epiphany-gentoo.json diff --git a/node/browsers/epiphany-linux.json b/extension/firefox/data/popup/browsers/epiphany-linux.json similarity index 100% rename from node/browsers/epiphany-linux.json rename to extension/firefox/data/popup/browsers/epiphany-linux.json diff --git a/node/browsers/epiphany-openbsd.json b/extension/firefox/data/popup/browsers/epiphany-openbsd.json similarity index 100% rename from node/browsers/epiphany-openbsd.json rename to extension/firefox/data/popup/browsers/epiphany-openbsd.json diff --git a/node/browsers/epiphany-solaris.json b/extension/firefox/data/popup/browsers/epiphany-solaris.json similarity index 100% rename from node/browsers/epiphany-solaris.json rename to extension/firefox/data/popup/browsers/epiphany-solaris.json diff --git a/node/browsers/epiphany-suse.json b/extension/firefox/data/popup/browsers/epiphany-suse.json similarity index 100% rename from node/browsers/epiphany-suse.json rename to extension/firefox/data/popup/browsers/epiphany-suse.json diff --git a/node/browsers/epiphany-ubuntu.json b/extension/firefox/data/popup/browsers/epiphany-ubuntu.json similarity index 100% rename from node/browsers/epiphany-ubuntu.json rename to extension/firefox/data/popup/browsers/epiphany-ubuntu.json diff --git a/node/browsers/fennec-android.json b/extension/firefox/data/popup/browsers/fennec-android.json similarity index 100% rename from node/browsers/fennec-android.json rename to extension/firefox/data/popup/browsers/fennec-android.json diff --git a/node/browsers/fennec-linux.json b/extension/firefox/data/popup/browsers/fennec-linux.json similarity index 100% rename from node/browsers/fennec-linux.json rename to extension/firefox/data/popup/browsers/fennec-linux.json diff --git a/node/browsers/fennec-mac os.json b/extension/firefox/data/popup/browsers/fennec-mac os.json similarity index 100% rename from node/browsers/fennec-mac os.json rename to extension/firefox/data/popup/browsers/fennec-mac os.json diff --git a/node/browsers/fennec-windows.json b/extension/firefox/data/popup/browsers/fennec-windows.json similarity index 100% rename from node/browsers/fennec-windows.json rename to extension/firefox/data/popup/browsers/fennec-windows.json diff --git a/node/browsers/firebird-linux.json b/extension/firefox/data/popup/browsers/firebird-linux.json similarity index 100% rename from node/browsers/firebird-linux.json rename to extension/firefox/data/popup/browsers/firebird-linux.json diff --git a/node/browsers/firebird-mac os.json b/extension/firefox/data/popup/browsers/firebird-mac os.json similarity index 100% rename from node/browsers/firebird-mac os.json rename to extension/firefox/data/popup/browsers/firebird-mac os.json diff --git a/node/browsers/firebird-solaris.json b/extension/firefox/data/popup/browsers/firebird-solaris.json similarity index 100% rename from node/browsers/firebird-solaris.json rename to extension/firefox/data/popup/browsers/firebird-solaris.json diff --git a/node/browsers/firebird-windows.json b/extension/firefox/data/popup/browsers/firebird-windows.json similarity index 100% rename from node/browsers/firebird-windows.json rename to extension/firefox/data/popup/browsers/firebird-windows.json diff --git a/node/browsers/firefox-android.json b/extension/firefox/data/popup/browsers/firefox-android.json similarity index 100% rename from node/browsers/firefox-android.json rename to extension/firefox/data/popup/browsers/firefox-android.json diff --git a/node/browsers/firefox-beos.json b/extension/firefox/data/popup/browsers/firefox-beos.json similarity index 100% rename from node/browsers/firefox-beos.json rename to extension/firefox/data/popup/browsers/firefox-beos.json diff --git a/node/browsers/firefox-centos.json b/extension/firefox/data/popup/browsers/firefox-centos.json similarity index 100% rename from node/browsers/firefox-centos.json rename to extension/firefox/data/popup/browsers/firefox-centos.json diff --git a/node/browsers/firefox-debian.json b/extension/firefox/data/popup/browsers/firefox-debian.json similarity index 100% rename from node/browsers/firefox-debian.json rename to extension/firefox/data/popup/browsers/firefox-debian.json diff --git a/node/browsers/firefox-dragonfly.json b/extension/firefox/data/popup/browsers/firefox-dragonfly.json similarity index 100% rename from node/browsers/firefox-dragonfly.json rename to extension/firefox/data/popup/browsers/firefox-dragonfly.json diff --git a/node/browsers/firefox-fedora.json b/extension/firefox/data/popup/browsers/firefox-fedora.json similarity index 100% rename from node/browsers/firefox-fedora.json rename to extension/firefox/data/popup/browsers/firefox-fedora.json diff --git a/node/browsers/firefox-freebsd.json b/extension/firefox/data/popup/browsers/firefox-freebsd.json similarity index 100% rename from node/browsers/firefox-freebsd.json rename to extension/firefox/data/popup/browsers/firefox-freebsd.json diff --git a/node/browsers/firefox-gentoo.json b/extension/firefox/data/popup/browsers/firefox-gentoo.json similarity index 100% rename from node/browsers/firefox-gentoo.json rename to extension/firefox/data/popup/browsers/firefox-gentoo.json diff --git a/node/browsers/firefox-ios.json b/extension/firefox/data/popup/browsers/firefox-ios.json similarity index 100% rename from node/browsers/firefox-ios.json rename to extension/firefox/data/popup/browsers/firefox-ios.json diff --git a/node/browsers/firefox-kubuntu.json b/extension/firefox/data/popup/browsers/firefox-kubuntu.json similarity index 100% rename from node/browsers/firefox-kubuntu.json rename to extension/firefox/data/popup/browsers/firefox-kubuntu.json diff --git a/node/browsers/firefox-linux.json b/extension/firefox/data/popup/browsers/firefox-linux.json similarity index 100% rename from node/browsers/firefox-linux.json rename to extension/firefox/data/popup/browsers/firefox-linux.json diff --git a/node/browsers/firefox-mac os.json b/extension/firefox/data/popup/browsers/firefox-mac os.json similarity index 100% rename from node/browsers/firefox-mac os.json rename to extension/firefox/data/popup/browsers/firefox-mac os.json diff --git a/node/browsers/firefox-mageia.json b/extension/firefox/data/popup/browsers/firefox-mageia.json similarity index 100% rename from node/browsers/firefox-mageia.json rename to extension/firefox/data/popup/browsers/firefox-mageia.json diff --git a/node/browsers/firefox-mandriva.json b/extension/firefox/data/popup/browsers/firefox-mandriva.json similarity index 100% rename from node/browsers/firefox-mandriva.json rename to extension/firefox/data/popup/browsers/firefox-mandriva.json diff --git a/node/browsers/firefox-mint.json b/extension/firefox/data/popup/browsers/firefox-mint.json similarity index 100% rename from node/browsers/firefox-mint.json rename to extension/firefox/data/popup/browsers/firefox-mint.json diff --git a/node/browsers/firefox-netbsd.json b/extension/firefox/data/popup/browsers/firefox-netbsd.json similarity index 100% rename from node/browsers/firefox-netbsd.json rename to extension/firefox/data/popup/browsers/firefox-netbsd.json diff --git a/node/browsers/firefox-openbsd.json b/extension/firefox/data/popup/browsers/firefox-openbsd.json similarity index 100% rename from node/browsers/firefox-openbsd.json rename to extension/firefox/data/popup/browsers/firefox-openbsd.json diff --git a/node/browsers/firefox-slackware.json b/extension/firefox/data/popup/browsers/firefox-slackware.json similarity index 100% rename from node/browsers/firefox-slackware.json rename to extension/firefox/data/popup/browsers/firefox-slackware.json diff --git a/node/browsers/firefox-solaris.json b/extension/firefox/data/popup/browsers/firefox-solaris.json similarity index 100% rename from node/browsers/firefox-solaris.json rename to extension/firefox/data/popup/browsers/firefox-solaris.json diff --git a/node/browsers/firefox-suse.json b/extension/firefox/data/popup/browsers/firefox-suse.json similarity index 100% rename from node/browsers/firefox-suse.json rename to extension/firefox/data/popup/browsers/firefox-suse.json diff --git a/node/browsers/firefox-ubuntu.json b/extension/firefox/data/popup/browsers/firefox-ubuntu.json similarity index 100% rename from node/browsers/firefox-ubuntu.json rename to extension/firefox/data/popup/browsers/firefox-ubuntu.json diff --git a/node/browsers/firefox-windows.json b/extension/firefox/data/popup/browsers/firefox-windows.json similarity index 100% rename from node/browsers/firefox-windows.json rename to extension/firefox/data/popup/browsers/firefox-windows.json diff --git a/node/browsers/flock-linux.json b/extension/firefox/data/popup/browsers/flock-linux.json similarity index 100% rename from node/browsers/flock-linux.json rename to extension/firefox/data/popup/browsers/flock-linux.json diff --git a/node/browsers/flock-mac os.json b/extension/firefox/data/popup/browsers/flock-mac os.json similarity index 100% rename from node/browsers/flock-mac os.json rename to extension/firefox/data/popup/browsers/flock-mac os.json diff --git a/node/browsers/flock-windows.json b/extension/firefox/data/popup/browsers/flock-windows.json similarity index 100% rename from node/browsers/flock-windows.json rename to extension/firefox/data/popup/browsers/flock-windows.json diff --git a/node/browsers/gobrowser-android.json b/extension/firefox/data/popup/browsers/gobrowser-android.json similarity index 100% rename from node/browsers/gobrowser-android.json rename to extension/firefox/data/popup/browsers/gobrowser-android.json diff --git a/node/browsers/gsa-ios.json b/extension/firefox/data/popup/browsers/gsa-ios.json similarity index 100% rename from node/browsers/gsa-ios.json rename to extension/firefox/data/popup/browsers/gsa-ios.json diff --git a/node/browsers/icab-mac os.json b/extension/firefox/data/popup/browsers/icab-mac os.json similarity index 100% rename from node/browsers/icab-mac os.json rename to extension/firefox/data/popup/browsers/icab-mac os.json diff --git a/node/browsers/iceape-linux.json b/extension/firefox/data/popup/browsers/iceape-linux.json similarity index 100% rename from node/browsers/iceape-linux.json rename to extension/firefox/data/popup/browsers/iceape-linux.json diff --git a/node/browsers/icecat-linux.json b/extension/firefox/data/popup/browsers/icecat-linux.json similarity index 100% rename from node/browsers/icecat-linux.json rename to extension/firefox/data/popup/browsers/icecat-linux.json diff --git a/node/browsers/icedragon-windows.json b/extension/firefox/data/popup/browsers/icedragon-windows.json similarity index 100% rename from node/browsers/icedragon-windows.json rename to extension/firefox/data/popup/browsers/icedragon-windows.json diff --git a/node/browsers/iceweasel-debian.json b/extension/firefox/data/popup/browsers/iceweasel-debian.json similarity index 100% rename from node/browsers/iceweasel-debian.json rename to extension/firefox/data/popup/browsers/iceweasel-debian.json diff --git a/node/browsers/iceweasel-gentoo.json b/extension/firefox/data/popup/browsers/iceweasel-gentoo.json similarity index 100% rename from node/browsers/iceweasel-gentoo.json rename to extension/firefox/data/popup/browsers/iceweasel-gentoo.json diff --git a/node/browsers/iceweasel-linux.json b/extension/firefox/data/popup/browsers/iceweasel-linux.json similarity index 100% rename from node/browsers/iceweasel-linux.json rename to extension/firefox/data/popup/browsers/iceweasel-linux.json diff --git a/node/browsers/iceweasel-ubuntu.json b/extension/firefox/data/popup/browsers/iceweasel-ubuntu.json similarity index 100% rename from node/browsers/iceweasel-ubuntu.json rename to extension/firefox/data/popup/browsers/iceweasel-ubuntu.json diff --git a/node/browsers/iceweasel-windows.json b/extension/firefox/data/popup/browsers/iceweasel-windows.json similarity index 100% rename from node/browsers/iceweasel-windows.json rename to extension/firefox/data/popup/browsers/iceweasel-windows.json diff --git a/node/browsers/ie-mac os.json b/extension/firefox/data/popup/browsers/ie-mac os.json similarity index 100% rename from node/browsers/ie-mac os.json rename to extension/firefox/data/popup/browsers/ie-mac os.json diff --git a/node/browsers/ie-solaris.json b/extension/firefox/data/popup/browsers/ie-solaris.json similarity index 100% rename from node/browsers/ie-solaris.json rename to extension/firefox/data/popup/browsers/ie-solaris.json diff --git a/node/browsers/ie-windows.json b/extension/firefox/data/popup/browsers/ie-windows.json similarity index 100% rename from node/browsers/ie-windows.json rename to extension/firefox/data/popup/browsers/ie-windows.json diff --git a/node/browsers/iemobile-windows phone os.json b/extension/firefox/data/popup/browsers/iemobile-windows phone os.json similarity index 100% rename from node/browsers/iemobile-windows phone os.json rename to extension/firefox/data/popup/browsers/iemobile-windows phone os.json diff --git a/node/browsers/iemobile-windows phone.json b/extension/firefox/data/popup/browsers/iemobile-windows phone.json similarity index 100% rename from node/browsers/iemobile-windows phone.json rename to extension/firefox/data/popup/browsers/iemobile-windows phone.json diff --git a/node/browsers/iridium-windows.json b/extension/firefox/data/popup/browsers/iridium-windows.json similarity index 100% rename from node/browsers/iridium-windows.json rename to extension/firefox/data/popup/browsers/iridium-windows.json diff --git a/node/browsers/iron-linux.json b/extension/firefox/data/popup/browsers/iron-linux.json similarity index 100% rename from node/browsers/iron-linux.json rename to extension/firefox/data/popup/browsers/iron-linux.json diff --git a/node/browsers/iron-mac os.json b/extension/firefox/data/popup/browsers/iron-mac os.json similarity index 100% rename from node/browsers/iron-mac os.json rename to extension/firefox/data/popup/browsers/iron-mac os.json diff --git a/node/browsers/iron-windows.json b/extension/firefox/data/popup/browsers/iron-windows.json similarity index 100% rename from node/browsers/iron-windows.json rename to extension/firefox/data/popup/browsers/iron-windows.json diff --git a/node/browsers/k-meleon-freebsd.json b/extension/firefox/data/popup/browsers/k-meleon-freebsd.json similarity index 100% rename from node/browsers/k-meleon-freebsd.json rename to extension/firefox/data/popup/browsers/k-meleon-freebsd.json diff --git a/node/browsers/k-meleon-linux.json b/extension/firefox/data/popup/browsers/k-meleon-linux.json similarity index 100% rename from node/browsers/k-meleon-linux.json rename to extension/firefox/data/popup/browsers/k-meleon-linux.json diff --git a/node/browsers/k-meleon-windows.json b/extension/firefox/data/popup/browsers/k-meleon-windows.json similarity index 100% rename from node/browsers/k-meleon-windows.json rename to extension/firefox/data/popup/browsers/k-meleon-windows.json diff --git a/node/browsers/khtml-windows.json b/extension/firefox/data/popup/browsers/khtml-windows.json similarity index 100% rename from node/browsers/khtml-windows.json rename to extension/firefox/data/popup/browsers/khtml-windows.json diff --git a/node/browsers/kindle-android.json b/extension/firefox/data/popup/browsers/kindle-android.json similarity index 100% rename from node/browsers/kindle-android.json rename to extension/firefox/data/popup/browsers/kindle-android.json diff --git a/node/browsers/kindle-linux.json b/extension/firefox/data/popup/browsers/kindle-linux.json similarity index 100% rename from node/browsers/kindle-linux.json rename to extension/firefox/data/popup/browsers/kindle-linux.json diff --git a/node/browsers/konqueror-debian.json b/extension/firefox/data/popup/browsers/konqueror-debian.json similarity index 100% rename from node/browsers/konqueror-debian.json rename to extension/firefox/data/popup/browsers/konqueror-debian.json diff --git a/node/browsers/konqueror-dragonfly.json b/extension/firefox/data/popup/browsers/konqueror-dragonfly.json similarity index 100% rename from node/browsers/konqueror-dragonfly.json rename to extension/firefox/data/popup/browsers/konqueror-dragonfly.json diff --git a/node/browsers/konqueror-fedora.json b/extension/firefox/data/popup/browsers/konqueror-fedora.json similarity index 100% rename from node/browsers/konqueror-fedora.json rename to extension/firefox/data/popup/browsers/konqueror-fedora.json diff --git a/node/browsers/konqueror-freebsd.json b/extension/firefox/data/popup/browsers/konqueror-freebsd.json similarity index 100% rename from node/browsers/konqueror-freebsd.json rename to extension/firefox/data/popup/browsers/konqueror-freebsd.json diff --git a/node/browsers/konqueror-kubuntu.json b/extension/firefox/data/popup/browsers/konqueror-kubuntu.json similarity index 100% rename from node/browsers/konqueror-kubuntu.json rename to extension/firefox/data/popup/browsers/konqueror-kubuntu.json diff --git a/node/browsers/konqueror-linux.json b/extension/firefox/data/popup/browsers/konqueror-linux.json similarity index 100% rename from node/browsers/konqueror-linux.json rename to extension/firefox/data/popup/browsers/konqueror-linux.json diff --git a/node/browsers/konqueror-netbsd.json b/extension/firefox/data/popup/browsers/konqueror-netbsd.json similarity index 100% rename from node/browsers/konqueror-netbsd.json rename to extension/firefox/data/popup/browsers/konqueror-netbsd.json diff --git a/node/browsers/konqueror-openbsd.json b/extension/firefox/data/popup/browsers/konqueror-openbsd.json similarity index 100% rename from node/browsers/konqueror-openbsd.json rename to extension/firefox/data/popup/browsers/konqueror-openbsd.json diff --git a/node/browsers/konqueror-slackware.json b/extension/firefox/data/popup/browsers/konqueror-slackware.json similarity index 100% rename from node/browsers/konqueror-slackware.json rename to extension/firefox/data/popup/browsers/konqueror-slackware.json diff --git a/node/browsers/konqueror-solaris.json b/extension/firefox/data/popup/browsers/konqueror-solaris.json similarity index 100% rename from node/browsers/konqueror-solaris.json rename to extension/firefox/data/popup/browsers/konqueror-solaris.json diff --git a/node/browsers/konqueror-suse.json b/extension/firefox/data/popup/browsers/konqueror-suse.json similarity index 100% rename from node/browsers/konqueror-suse.json rename to extension/firefox/data/popup/browsers/konqueror-suse.json diff --git a/node/browsers/konqueror-windows.json b/extension/firefox/data/popup/browsers/konqueror-windows.json similarity index 100% rename from node/browsers/konqueror-windows.json rename to extension/firefox/data/popup/browsers/konqueror-windows.json diff --git a/node/browsers/lunascape-windows.json b/extension/firefox/data/popup/browsers/lunascape-windows.json similarity index 100% rename from node/browsers/lunascape-windows.json rename to extension/firefox/data/popup/browsers/lunascape-windows.json diff --git a/node/browsers/maemo browser-linux.json b/extension/firefox/data/popup/browsers/maemo browser-linux.json similarity index 100% rename from node/browsers/maemo browser-linux.json rename to extension/firefox/data/popup/browsers/maemo browser-linux.json diff --git a/node/browsers/maxthon-windows.json b/extension/firefox/data/popup/browsers/maxthon-windows.json similarity index 100% rename from node/browsers/maxthon-windows.json rename to extension/firefox/data/popup/browsers/maxthon-windows.json diff --git a/node/browsers/midori-linux.json b/extension/firefox/data/popup/browsers/midori-linux.json similarity index 100% rename from node/browsers/midori-linux.json rename to extension/firefox/data/popup/browsers/midori-linux.json diff --git a/node/browsers/midori-netbsd.json b/extension/firefox/data/popup/browsers/midori-netbsd.json similarity index 100% rename from node/browsers/midori-netbsd.json rename to extension/firefox/data/popup/browsers/midori-netbsd.json diff --git a/node/browsers/minimo-linux.json b/extension/firefox/data/popup/browsers/minimo-linux.json similarity index 100% rename from node/browsers/minimo-linux.json rename to extension/firefox/data/popup/browsers/minimo-linux.json diff --git a/node/browsers/minimo-openbsd.json b/extension/firefox/data/popup/browsers/minimo-openbsd.json similarity index 100% rename from node/browsers/minimo-openbsd.json rename to extension/firefox/data/popup/browsers/minimo-openbsd.json diff --git a/node/browsers/minimo-windows.json b/extension/firefox/data/popup/browsers/minimo-windows.json similarity index 100% rename from node/browsers/minimo-windows.json rename to extension/firefox/data/popup/browsers/minimo-windows.json diff --git a/node/browsers/miui browser-android.json b/extension/firefox/data/popup/browsers/miui browser-android.json similarity index 100% rename from node/browsers/miui browser-android.json rename to extension/firefox/data/popup/browsers/miui browser-android.json diff --git a/node/browsers/mobile safari-android.json b/extension/firefox/data/popup/browsers/mobile safari-android.json similarity index 100% rename from node/browsers/mobile safari-android.json rename to extension/firefox/data/popup/browsers/mobile safari-android.json diff --git a/node/browsers/mobile safari-ios.json b/extension/firefox/data/popup/browsers/mobile safari-ios.json similarity index 100% rename from node/browsers/mobile safari-ios.json rename to extension/firefox/data/popup/browsers/mobile safari-ios.json diff --git a/node/browsers/mobile safari-mac os.json b/extension/firefox/data/popup/browsers/mobile safari-mac os.json similarity index 100% rename from node/browsers/mobile safari-mac os.json rename to extension/firefox/data/popup/browsers/mobile safari-mac os.json diff --git a/node/browsers/mozilla-aix.json b/extension/firefox/data/popup/browsers/mozilla-aix.json similarity index 100% rename from node/browsers/mozilla-aix.json rename to extension/firefox/data/popup/browsers/mozilla-aix.json diff --git a/node/browsers/mozilla-android.json b/extension/firefox/data/popup/browsers/mozilla-android.json similarity index 100% rename from node/browsers/mozilla-android.json rename to extension/firefox/data/popup/browsers/mozilla-android.json diff --git a/node/browsers/mozilla-beos.json b/extension/firefox/data/popup/browsers/mozilla-beos.json similarity index 100% rename from node/browsers/mozilla-beos.json rename to extension/firefox/data/popup/browsers/mozilla-beos.json diff --git a/node/browsers/mozilla-centos.json b/extension/firefox/data/popup/browsers/mozilla-centos.json similarity index 100% rename from node/browsers/mozilla-centos.json rename to extension/firefox/data/popup/browsers/mozilla-centos.json diff --git a/node/browsers/mozilla-debian.json b/extension/firefox/data/popup/browsers/mozilla-debian.json similarity index 100% rename from node/browsers/mozilla-debian.json rename to extension/firefox/data/popup/browsers/mozilla-debian.json diff --git a/node/browsers/mozilla-fedora.json b/extension/firefox/data/popup/browsers/mozilla-fedora.json similarity index 100% rename from node/browsers/mozilla-fedora.json rename to extension/firefox/data/popup/browsers/mozilla-fedora.json diff --git a/node/browsers/mozilla-freebsd.json b/extension/firefox/data/popup/browsers/mozilla-freebsd.json similarity index 100% rename from node/browsers/mozilla-freebsd.json rename to extension/firefox/data/popup/browsers/mozilla-freebsd.json diff --git a/node/browsers/mozilla-gentoo.json b/extension/firefox/data/popup/browsers/mozilla-gentoo.json similarity index 100% rename from node/browsers/mozilla-gentoo.json rename to extension/firefox/data/popup/browsers/mozilla-gentoo.json diff --git a/node/browsers/mozilla-haiku.json b/extension/firefox/data/popup/browsers/mozilla-haiku.json similarity index 100% rename from node/browsers/mozilla-haiku.json rename to extension/firefox/data/popup/browsers/mozilla-haiku.json diff --git a/node/browsers/mozilla-kubuntu.json b/extension/firefox/data/popup/browsers/mozilla-kubuntu.json similarity index 100% rename from node/browsers/mozilla-kubuntu.json rename to extension/firefox/data/popup/browsers/mozilla-kubuntu.json diff --git a/node/browsers/mozilla-linux.json b/extension/firefox/data/popup/browsers/mozilla-linux.json similarity index 100% rename from node/browsers/mozilla-linux.json rename to extension/firefox/data/popup/browsers/mozilla-linux.json diff --git a/node/browsers/mozilla-mac os.json b/extension/firefox/data/popup/browsers/mozilla-mac os.json similarity index 100% rename from node/browsers/mozilla-mac os.json rename to extension/firefox/data/popup/browsers/mozilla-mac os.json diff --git a/node/browsers/mozilla-mandriva.json b/extension/firefox/data/popup/browsers/mozilla-mandriva.json similarity index 100% rename from node/browsers/mozilla-mandriva.json rename to extension/firefox/data/popup/browsers/mozilla-mandriva.json diff --git a/node/browsers/mozilla-mint.json b/extension/firefox/data/popup/browsers/mozilla-mint.json similarity index 100% rename from node/browsers/mozilla-mint.json rename to extension/firefox/data/popup/browsers/mozilla-mint.json diff --git a/node/browsers/mozilla-netbsd.json b/extension/firefox/data/popup/browsers/mozilla-netbsd.json similarity index 100% rename from node/browsers/mozilla-netbsd.json rename to extension/firefox/data/popup/browsers/mozilla-netbsd.json diff --git a/node/browsers/mozilla-openbsd.json b/extension/firefox/data/popup/browsers/mozilla-openbsd.json similarity index 100% rename from node/browsers/mozilla-openbsd.json rename to extension/firefox/data/popup/browsers/mozilla-openbsd.json diff --git a/node/browsers/mozilla-openvms.json b/extension/firefox/data/popup/browsers/mozilla-openvms.json similarity index 100% rename from node/browsers/mozilla-openvms.json rename to extension/firefox/data/popup/browsers/mozilla-openvms.json diff --git a/node/browsers/mozilla-os-2.json b/extension/firefox/data/popup/browsers/mozilla-os-2.json similarity index 100% rename from node/browsers/mozilla-os-2.json rename to extension/firefox/data/popup/browsers/mozilla-os-2.json diff --git a/node/browsers/mozilla-qnx.json b/extension/firefox/data/popup/browsers/mozilla-qnx.json similarity index 100% rename from node/browsers/mozilla-qnx.json rename to extension/firefox/data/popup/browsers/mozilla-qnx.json diff --git a/node/browsers/mozilla-slackware.json b/extension/firefox/data/popup/browsers/mozilla-slackware.json similarity index 100% rename from node/browsers/mozilla-slackware.json rename to extension/firefox/data/popup/browsers/mozilla-slackware.json diff --git a/node/browsers/mozilla-solaris.json b/extension/firefox/data/popup/browsers/mozilla-solaris.json similarity index 100% rename from node/browsers/mozilla-solaris.json rename to extension/firefox/data/popup/browsers/mozilla-solaris.json diff --git a/node/browsers/mozilla-suse.json b/extension/firefox/data/popup/browsers/mozilla-suse.json similarity index 100% rename from node/browsers/mozilla-suse.json rename to extension/firefox/data/popup/browsers/mozilla-suse.json diff --git a/node/browsers/mozilla-ubuntu.json b/extension/firefox/data/popup/browsers/mozilla-ubuntu.json similarity index 100% rename from node/browsers/mozilla-ubuntu.json rename to extension/firefox/data/popup/browsers/mozilla-ubuntu.json diff --git a/node/browsers/mozilla-unix.json b/extension/firefox/data/popup/browsers/mozilla-unix.json similarity index 100% rename from node/browsers/mozilla-unix.json rename to extension/firefox/data/popup/browsers/mozilla-unix.json diff --git a/node/browsers/mozilla-windows.json b/extension/firefox/data/popup/browsers/mozilla-windows.json similarity index 100% rename from node/browsers/mozilla-windows.json rename to extension/firefox/data/popup/browsers/mozilla-windows.json diff --git a/node/browsers/mozilla-zenwalk.json b/extension/firefox/data/popup/browsers/mozilla-zenwalk.json similarity index 100% rename from node/browsers/mozilla-zenwalk.json rename to extension/firefox/data/popup/browsers/mozilla-zenwalk.json diff --git a/node/browsers/netscape-aix.json b/extension/firefox/data/popup/browsers/netscape-aix.json similarity index 100% rename from node/browsers/netscape-aix.json rename to extension/firefox/data/popup/browsers/netscape-aix.json diff --git a/node/browsers/netscape-linux.json b/extension/firefox/data/popup/browsers/netscape-linux.json similarity index 100% rename from node/browsers/netscape-linux.json rename to extension/firefox/data/popup/browsers/netscape-linux.json diff --git a/node/browsers/netscape-mac os.json b/extension/firefox/data/popup/browsers/netscape-mac os.json similarity index 100% rename from node/browsers/netscape-mac os.json rename to extension/firefox/data/popup/browsers/netscape-mac os.json diff --git a/node/browsers/netscape-solaris.json b/extension/firefox/data/popup/browsers/netscape-solaris.json similarity index 100% rename from node/browsers/netscape-solaris.json rename to extension/firefox/data/popup/browsers/netscape-solaris.json diff --git a/node/browsers/netscape-windows.json b/extension/firefox/data/popup/browsers/netscape-windows.json similarity index 100% rename from node/browsers/netscape-windows.json rename to extension/firefox/data/popup/browsers/netscape-windows.json diff --git a/node/browsers/omniweb-mac os.json b/extension/firefox/data/popup/browsers/omniweb-mac os.json similarity index 100% rename from node/browsers/omniweb-mac os.json rename to extension/firefox/data/popup/browsers/omniweb-mac os.json diff --git a/node/browsers/opera mini-ios.json b/extension/firefox/data/popup/browsers/opera mini-ios.json similarity index 100% rename from node/browsers/opera mini-ios.json rename to extension/firefox/data/popup/browsers/opera mini-ios.json diff --git a/node/browsers/opera touch-ios.json b/extension/firefox/data/popup/browsers/opera touch-ios.json similarity index 100% rename from node/browsers/opera touch-ios.json rename to extension/firefox/data/popup/browsers/opera touch-ios.json diff --git a/node/browsers/opera-android.json b/extension/firefox/data/popup/browsers/opera-android.json similarity index 100% rename from node/browsers/opera-android.json rename to extension/firefox/data/popup/browsers/opera-android.json diff --git a/node/browsers/opera-linux.json b/extension/firefox/data/popup/browsers/opera-linux.json similarity index 100% rename from node/browsers/opera-linux.json rename to extension/firefox/data/popup/browsers/opera-linux.json diff --git a/node/browsers/opera-mac os.json b/extension/firefox/data/popup/browsers/opera-mac os.json similarity index 100% rename from node/browsers/opera-mac os.json rename to extension/firefox/data/popup/browsers/opera-mac os.json diff --git a/node/browsers/opera-solaris.json b/extension/firefox/data/popup/browsers/opera-solaris.json similarity index 100% rename from node/browsers/opera-solaris.json rename to extension/firefox/data/popup/browsers/opera-solaris.json diff --git a/node/browsers/opera-symbian.json b/extension/firefox/data/popup/browsers/opera-symbian.json similarity index 100% rename from node/browsers/opera-symbian.json rename to extension/firefox/data/popup/browsers/opera-symbian.json diff --git a/node/browsers/opera-windows.json b/extension/firefox/data/popup/browsers/opera-windows.json similarity index 100% rename from node/browsers/opera-windows.json rename to extension/firefox/data/popup/browsers/opera-windows.json diff --git a/node/browsers/palemoon-windows.json b/extension/firefox/data/popup/browsers/palemoon-windows.json similarity index 100% rename from node/browsers/palemoon-windows.json rename to extension/firefox/data/popup/browsers/palemoon-windows.json diff --git a/node/browsers/phoenix-linux.json b/extension/firefox/data/popup/browsers/phoenix-linux.json similarity index 100% rename from node/browsers/phoenix-linux.json rename to extension/firefox/data/popup/browsers/phoenix-linux.json diff --git a/node/browsers/phoenix-mac os.json b/extension/firefox/data/popup/browsers/phoenix-mac os.json similarity index 100% rename from node/browsers/phoenix-mac os.json rename to extension/firefox/data/popup/browsers/phoenix-mac os.json diff --git a/node/browsers/phoenix-windows.json b/extension/firefox/data/popup/browsers/phoenix-windows.json similarity index 100% rename from node/browsers/phoenix-windows.json rename to extension/firefox/data/popup/browsers/phoenix-windows.json diff --git a/node/browsers/puffin-android.json b/extension/firefox/data/popup/browsers/puffin-android.json similarity index 100% rename from node/browsers/puffin-android.json rename to extension/firefox/data/popup/browsers/puffin-android.json diff --git a/node/browsers/qqbrowser-windows.json b/extension/firefox/data/popup/browsers/qqbrowser-windows.json similarity index 100% rename from node/browsers/qqbrowser-windows.json rename to extension/firefox/data/popup/browsers/qqbrowser-windows.json diff --git a/node/browsers/rockmelt-mac os.json b/extension/firefox/data/popup/browsers/rockmelt-mac os.json similarity index 100% rename from node/browsers/rockmelt-mac os.json rename to extension/firefox/data/popup/browsers/rockmelt-mac os.json diff --git a/node/browsers/rockmelt-windows.json b/extension/firefox/data/popup/browsers/rockmelt-windows.json similarity index 100% rename from node/browsers/rockmelt-windows.json rename to extension/firefox/data/popup/browsers/rockmelt-windows.json diff --git a/node/browsers/safari-android.json b/extension/firefox/data/popup/browsers/safari-android.json similarity index 100% rename from node/browsers/safari-android.json rename to extension/firefox/data/popup/browsers/safari-android.json diff --git a/node/browsers/safari-blackberry.json b/extension/firefox/data/popup/browsers/safari-blackberry.json similarity index 100% rename from node/browsers/safari-blackberry.json rename to extension/firefox/data/popup/browsers/safari-blackberry.json diff --git a/node/browsers/safari-bsd.json b/extension/firefox/data/popup/browsers/safari-bsd.json similarity index 100% rename from node/browsers/safari-bsd.json rename to extension/firefox/data/popup/browsers/safari-bsd.json diff --git a/node/browsers/safari-ios.json b/extension/firefox/data/popup/browsers/safari-ios.json similarity index 100% rename from node/browsers/safari-ios.json rename to extension/firefox/data/popup/browsers/safari-ios.json diff --git a/node/browsers/safari-linux.json b/extension/firefox/data/popup/browsers/safari-linux.json similarity index 100% rename from node/browsers/safari-linux.json rename to extension/firefox/data/popup/browsers/safari-linux.json diff --git a/node/browsers/safari-mac os.json b/extension/firefox/data/popup/browsers/safari-mac os.json similarity index 100% rename from node/browsers/safari-mac os.json rename to extension/firefox/data/popup/browsers/safari-mac os.json diff --git a/node/browsers/safari-netbsd.json b/extension/firefox/data/popup/browsers/safari-netbsd.json similarity index 100% rename from node/browsers/safari-netbsd.json rename to extension/firefox/data/popup/browsers/safari-netbsd.json diff --git a/node/browsers/safari-windows.json b/extension/firefox/data/popup/browsers/safari-windows.json similarity index 100% rename from node/browsers/safari-windows.json rename to extension/firefox/data/popup/browsers/safari-windows.json diff --git a/node/browsers/samsung browser-android.json b/extension/firefox/data/popup/browsers/samsung browser-android.json similarity index 100% rename from node/browsers/samsung browser-android.json rename to extension/firefox/data/popup/browsers/samsung browser-android.json diff --git a/node/browsers/samsung browser-linux.json b/extension/firefox/data/popup/browsers/samsung browser-linux.json similarity index 100% rename from node/browsers/samsung browser-linux.json rename to extension/firefox/data/popup/browsers/samsung browser-linux.json diff --git a/node/browsers/samsung browser-tizen.json b/extension/firefox/data/popup/browsers/samsung browser-tizen.json similarity index 100% rename from node/browsers/samsung browser-tizen.json rename to extension/firefox/data/popup/browsers/samsung browser-tizen.json diff --git a/node/browsers/seamonkey-amigaos.json b/extension/firefox/data/popup/browsers/seamonkey-amigaos.json similarity index 100% rename from node/browsers/seamonkey-amigaos.json rename to extension/firefox/data/popup/browsers/seamonkey-amigaos.json diff --git a/node/browsers/seamonkey-beos.json b/extension/firefox/data/popup/browsers/seamonkey-beos.json similarity index 100% rename from node/browsers/seamonkey-beos.json rename to extension/firefox/data/popup/browsers/seamonkey-beos.json diff --git a/node/browsers/seamonkey-centos.json b/extension/firefox/data/popup/browsers/seamonkey-centos.json similarity index 100% rename from node/browsers/seamonkey-centos.json rename to extension/firefox/data/popup/browsers/seamonkey-centos.json diff --git a/node/browsers/seamonkey-fedora.json b/extension/firefox/data/popup/browsers/seamonkey-fedora.json similarity index 100% rename from node/browsers/seamonkey-fedora.json rename to extension/firefox/data/popup/browsers/seamonkey-fedora.json diff --git a/node/browsers/seamonkey-freebsd.json b/extension/firefox/data/popup/browsers/seamonkey-freebsd.json similarity index 100% rename from node/browsers/seamonkey-freebsd.json rename to extension/firefox/data/popup/browsers/seamonkey-freebsd.json diff --git a/node/browsers/seamonkey-gentoo.json b/extension/firefox/data/popup/browsers/seamonkey-gentoo.json similarity index 100% rename from node/browsers/seamonkey-gentoo.json rename to extension/firefox/data/popup/browsers/seamonkey-gentoo.json diff --git a/node/browsers/seamonkey-haiku.json b/extension/firefox/data/popup/browsers/seamonkey-haiku.json similarity index 100% rename from node/browsers/seamonkey-haiku.json rename to extension/firefox/data/popup/browsers/seamonkey-haiku.json diff --git a/node/browsers/seamonkey-linux.json b/extension/firefox/data/popup/browsers/seamonkey-linux.json similarity index 100% rename from node/browsers/seamonkey-linux.json rename to extension/firefox/data/popup/browsers/seamonkey-linux.json diff --git a/node/browsers/seamonkey-mac os.json b/extension/firefox/data/popup/browsers/seamonkey-mac os.json similarity index 100% rename from node/browsers/seamonkey-mac os.json rename to extension/firefox/data/popup/browsers/seamonkey-mac os.json diff --git a/node/browsers/seamonkey-mandriva.json b/extension/firefox/data/popup/browsers/seamonkey-mandriva.json similarity index 100% rename from node/browsers/seamonkey-mandriva.json rename to extension/firefox/data/popup/browsers/seamonkey-mandriva.json diff --git a/node/browsers/seamonkey-netbsd.json b/extension/firefox/data/popup/browsers/seamonkey-netbsd.json similarity index 100% rename from node/browsers/seamonkey-netbsd.json rename to extension/firefox/data/popup/browsers/seamonkey-netbsd.json diff --git a/node/browsers/seamonkey-openbsd.json b/extension/firefox/data/popup/browsers/seamonkey-openbsd.json similarity index 100% rename from node/browsers/seamonkey-openbsd.json rename to extension/firefox/data/popup/browsers/seamonkey-openbsd.json diff --git a/node/browsers/seamonkey-os-2.json b/extension/firefox/data/popup/browsers/seamonkey-os-2.json similarity index 100% rename from node/browsers/seamonkey-os-2.json rename to extension/firefox/data/popup/browsers/seamonkey-os-2.json diff --git a/node/browsers/seamonkey-suse.json b/extension/firefox/data/popup/browsers/seamonkey-suse.json similarity index 100% rename from node/browsers/seamonkey-suse.json rename to extension/firefox/data/popup/browsers/seamonkey-suse.json diff --git a/node/browsers/seamonkey-windows.json b/extension/firefox/data/popup/browsers/seamonkey-windows.json similarity index 100% rename from node/browsers/seamonkey-windows.json rename to extension/firefox/data/popup/browsers/seamonkey-windows.json diff --git a/node/browsers/silk-android.json b/extension/firefox/data/popup/browsers/silk-android.json similarity index 100% rename from node/browsers/silk-android.json rename to extension/firefox/data/popup/browsers/silk-android.json diff --git a/node/browsers/silk-linux.json b/extension/firefox/data/popup/browsers/silk-linux.json similarity index 100% rename from node/browsers/silk-linux.json rename to extension/firefox/data/popup/browsers/silk-linux.json diff --git a/node/browsers/silk-mac os.json b/extension/firefox/data/popup/browsers/silk-mac os.json similarity index 100% rename from node/browsers/silk-mac os.json rename to extension/firefox/data/popup/browsers/silk-mac os.json diff --git a/node/browsers/skyfire-mac os.json b/extension/firefox/data/popup/browsers/skyfire-mac os.json similarity index 100% rename from node/browsers/skyfire-mac os.json rename to extension/firefox/data/popup/browsers/skyfire-mac os.json diff --git a/node/browsers/slim-android.json b/extension/firefox/data/popup/browsers/slim-android.json similarity index 100% rename from node/browsers/slim-android.json rename to extension/firefox/data/popup/browsers/slim-android.json diff --git a/node/browsers/swiftfox-linux.json b/extension/firefox/data/popup/browsers/swiftfox-linux.json similarity index 100% rename from node/browsers/swiftfox-linux.json rename to extension/firefox/data/popup/browsers/swiftfox-linux.json diff --git a/node/browsers/tizenbrowser-tizen.json b/extension/firefox/data/popup/browsers/tizenbrowser-tizen.json similarity index 100% rename from node/browsers/tizenbrowser-tizen.json rename to extension/firefox/data/popup/browsers/tizenbrowser-tizen.json diff --git a/node/browsers/ucbrowser-android.json b/extension/firefox/data/popup/browsers/ucbrowser-android.json similarity index 100% rename from node/browsers/ucbrowser-android.json rename to extension/firefox/data/popup/browsers/ucbrowser-android.json diff --git a/node/browsers/ucbrowser-windows.json b/extension/firefox/data/popup/browsers/ucbrowser-windows.json similarity index 100% rename from node/browsers/ucbrowser-windows.json rename to extension/firefox/data/popup/browsers/ucbrowser-windows.json diff --git a/node/browsers/vivaldi-linux.json b/extension/firefox/data/popup/browsers/vivaldi-linux.json similarity index 100% rename from node/browsers/vivaldi-linux.json rename to extension/firefox/data/popup/browsers/vivaldi-linux.json diff --git a/node/browsers/vivaldi-mac os.json b/extension/firefox/data/popup/browsers/vivaldi-mac os.json similarity index 100% rename from node/browsers/vivaldi-mac os.json rename to extension/firefox/data/popup/browsers/vivaldi-mac os.json diff --git a/node/browsers/vivaldi-netbsd.json b/extension/firefox/data/popup/browsers/vivaldi-netbsd.json similarity index 100% rename from node/browsers/vivaldi-netbsd.json rename to extension/firefox/data/popup/browsers/vivaldi-netbsd.json diff --git a/node/browsers/vivaldi-windows.json b/extension/firefox/data/popup/browsers/vivaldi-windows.json similarity index 100% rename from node/browsers/vivaldi-windows.json rename to extension/firefox/data/popup/browsers/vivaldi-windows.json diff --git a/node/browsers/waterfox-linux.json b/extension/firefox/data/popup/browsers/waterfox-linux.json similarity index 100% rename from node/browsers/waterfox-linux.json rename to extension/firefox/data/popup/browsers/waterfox-linux.json diff --git a/node/browsers/waterfox-mac os.json b/extension/firefox/data/popup/browsers/waterfox-mac os.json similarity index 100% rename from node/browsers/waterfox-mac os.json rename to extension/firefox/data/popup/browsers/waterfox-mac os.json diff --git a/node/browsers/waterfox-windows.json b/extension/firefox/data/popup/browsers/waterfox-windows.json similarity index 100% rename from node/browsers/waterfox-windows.json rename to extension/firefox/data/popup/browsers/waterfox-windows.json diff --git a/node/browsers/webkit-blackberry.json b/extension/firefox/data/popup/browsers/webkit-blackberry.json similarity index 100% rename from node/browsers/webkit-blackberry.json rename to extension/firefox/data/popup/browsers/webkit-blackberry.json diff --git a/node/browsers/webkit-ios.json b/extension/firefox/data/popup/browsers/webkit-ios.json similarity index 100% rename from node/browsers/webkit-ios.json rename to extension/firefox/data/popup/browsers/webkit-ios.json diff --git a/node/browsers/webkit-linux.json b/extension/firefox/data/popup/browsers/webkit-linux.json similarity index 100% rename from node/browsers/webkit-linux.json rename to extension/firefox/data/popup/browsers/webkit-linux.json diff --git a/node/browsers/webkit-mac os.json b/extension/firefox/data/popup/browsers/webkit-mac os.json similarity index 100% rename from node/browsers/webkit-mac os.json rename to extension/firefox/data/popup/browsers/webkit-mac os.json diff --git a/node/browsers/webkit-symbian.json b/extension/firefox/data/popup/browsers/webkit-symbian.json similarity index 100% rename from node/browsers/webkit-symbian.json rename to extension/firefox/data/popup/browsers/webkit-symbian.json diff --git a/node/browsers/webkit-windows.json b/extension/firefox/data/popup/browsers/webkit-windows.json similarity index 100% rename from node/browsers/webkit-windows.json rename to extension/firefox/data/popup/browsers/webkit-windows.json diff --git a/node/browsers/whale-windows.json b/extension/firefox/data/popup/browsers/whale-windows.json similarity index 100% rename from node/browsers/whale-windows.json rename to extension/firefox/data/popup/browsers/whale-windows.json diff --git a/node/browsers/yandex-android.json b/extension/firefox/data/popup/browsers/yandex-android.json similarity index 100% rename from node/browsers/yandex-android.json rename to extension/firefox/data/popup/browsers/yandex-android.json diff --git a/node/browsers/yandex-linux.json b/extension/firefox/data/popup/browsers/yandex-linux.json similarity index 100% rename from node/browsers/yandex-linux.json rename to extension/firefox/data/popup/browsers/yandex-linux.json diff --git a/node/browsers/yandex-mac os.json b/extension/firefox/data/popup/browsers/yandex-mac os.json similarity index 100% rename from node/browsers/yandex-mac os.json rename to extension/firefox/data/popup/browsers/yandex-mac os.json diff --git a/node/browsers/yandex-windows.json b/extension/firefox/data/popup/browsers/yandex-windows.json similarity index 100% rename from node/browsers/yandex-windows.json rename to extension/firefox/data/popup/browsers/yandex-windows.json diff --git a/extension/data/popup/index.css b/extension/firefox/data/popup/index.css similarity index 100% rename from extension/data/popup/index.css rename to extension/firefox/data/popup/index.css diff --git a/extension/data/popup/index.html b/extension/firefox/data/popup/index.html similarity index 100% rename from extension/data/popup/index.html rename to extension/firefox/data/popup/index.html diff --git a/extension/data/popup/index.js b/extension/firefox/data/popup/index.js similarity index 95% rename from extension/data/popup/index.js rename to extension/firefox/data/popup/index.js index a3b1a33..b40b3eb 100644 --- a/extension/data/popup/index.js +++ b/extension/firefox/data/popup/index.js @@ -239,9 +239,9 @@ document.addEventListener('DOMContentLoaded', () => fetch('./map.json').then(r = document.getElementById('os').value = prefs['popup-os']; document.getElementById('sort').value = prefs['popup-sort']; - chrome.runtime.getBackgroundPage(bg => { - // Firefox in private mode -> there is no bg! - const ua = (bg ? bg.prefs.ua : '') || navigator.userAgent; + chrome.runtime.sendMessage({ + method: 'get-ua' + }, ua => { update(ua); document.getElementById('ua').value = ua; document.getElementById('ua').dispatchEvent(new Event('input')); @@ -296,7 +296,11 @@ document.addEventListener('click', ({target}) => { if (value !== navigator.userAgent) { // prevent a container ua string from overwriting the default one if ('cookieStoreId' in tab && tab.cookieStoreId !== DCSI) { - chrome.runtime.getBackgroundPage(bg => bg.ua.update(value, undefined, tab.cookieStoreId)); + chrome.runtime.sendMessage({ + method: 'request-update', + value, + cookieStoreId: tab.cookieStoreId + }); chrome.storage.local.get({ 'container-uas': {} }, prefs => { @@ -313,7 +317,11 @@ document.addEventListener('click', ({target}) => { } else if (cmd === 'window') { const value = document.getElementById('ua').value; - chrome.runtime.getBackgroundPage(bg => bg.ua.update(value, tab.windowId, tab.cookieStoreId)); + chrome.runtime.sendMessage({ + method: 'request-update', + value, + cookieStoreId: tab.cookieStoreId + }); } else if (cmd === 'reset') { const input = document.querySelector('#list :checked'); @@ -322,9 +330,11 @@ document.addEventListener('click', ({target}) => { } // prevent a container ua string from overwriting the default one if ('cookieStoreId' in tab && tab.cookieStoreId !== DCSI) { - chrome.runtime.getBackgroundPage(bg => { - delete bg.ua._obj[tab.cookieStoreId]; - bg.ua.update('', undefined, tab.cookieStoreId); + chrome.runtime.sendMessage({ + method: 'request-update', + value: '', + cookieStoreId: tab.cookieStoreId, + delete: true }); chrome.storage.local.get({ 'container-uas': {} @@ -377,8 +387,10 @@ document.getElementById('ua').addEventListener('input', e => { document.querySelector('[data-cmd=window]').disabled = value === ''; if (value) { - chrome.runtime.getBackgroundPage(bg => { - const o = bg.ua.parse(value); + chrome.runtime.sendMessage({ + method: 'parse-ua', + value + }, o => { document.getElementById('appVersion').value = o.appVersion; document.getElementById('platform').value = o.platform; document.getElementById('vendor').value = o.vendor; diff --git a/extension/data/popup/list-black.svg b/extension/firefox/data/popup/list-black.svg similarity index 100% rename from extension/data/popup/list-black.svg rename to extension/firefox/data/popup/list-black.svg diff --git a/extension/data/popup/list-white.svg b/extension/firefox/data/popup/list-white.svg similarity index 100% rename from extension/data/popup/list-white.svg rename to extension/firefox/data/popup/list-white.svg diff --git a/extension/data/popup/loading.gif b/extension/firefox/data/popup/loading.gif similarity index 100% rename from extension/data/popup/loading.gif rename to extension/firefox/data/popup/loading.gif diff --git a/node/map.json b/extension/firefox/data/popup/map.json similarity index 100% rename from node/map.json rename to extension/firefox/data/popup/map.json diff --git a/extension/firefox/data/popup/matched.js b/extension/firefox/data/popup/matched.js new file mode 100644 index 0000000..c9f9bdd --- /dev/null +++ b/extension/firefox/data/popup/matched.js @@ -0,0 +1,172 @@ +'use strict'; + +{ + const shuffle = array => { + for (let i = array.length - 1; i > 0; i -= 1) { + const j = Math.floor(Math.random() * (i + 1)); + [array[i], array[j]] = [array[j], array[i]]; + } + + return array; + }; + + const root = document.getElementById('explore'); + + const INC = Number(root.dataset.inc || 100); + const count = Number(localStorage.getItem('explore-count') || INC - 5); + const cols = Number(root.dataset.cols || 3); + + const style = document.createElement('style'); + style.textContent = ` + #explore { + background-color: #fff; + position: relative; + color: #969696; + user-select: none; + } + #explore[data-loaded=true] { + margin: 4px; + padding: 5px; + box-shadow: 0 0 4px #ccc; + border: solid 1px #ccc; + } + #explore .close { + position: absolute; + right: 6px; + top: 4px; + cursor: pointer; + } + #explore>table { + margin-top: 10px; + table-layout: fixed; + width: 100%; + border-collapse: collapse; + } + #explore a { + text-decoration: none; + color: #000; + display: flex; + align-items: center; + justify-content: center; + } + #explore td:first-child a { + justify-content: flex-start; + } + #explore td:last-child a { + justify-content: flex-end; + } + #explore .title { + border-left: solid 1px #ccc; + display: inline-block; + align-items: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-left: 5px; + } + #explore .icon { + min-width: 28px; + height: 28px; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 50%; + color: #fff; + margin-right: 5px; + font-size: 10px; + font-weight: 100; + } + #explore .explore { + position: absolute; + right: 10px; + z-index: 1000000; + cursor: pointer; + font-size: 15px; + }`; + document.documentElement.appendChild(style); + + const cload = () => fetch('matched.json').then(r => r.json()).then(build); + const explore = () => { + const span = document.createElement('span'); + span.textContent = '↯'; + span.title = 'Explore more'; + span.classList.add('explore'); + root.appendChild(span); + span.onclick = () => { + root.textContent = ''; + localStorage.setItem('explore-count', INC); + cload(); + }; + }; + const build = json => { + if (json.length === 0) { + return; + } + root.dataset.loaded = true; + root.textContent = 'Explore more'; + const table = document.createElement('table'); + const tr = document.createElement('tr'); + const span = document.createElement('span'); + span.classList.add('close'); + span.textContent = '✕'; + span.onclick = () => { + root.textContent = ''; + root.dataset.loaded = false; + localStorage.setItem('explore-count', 0); + explore(); + }; + root.appendChild(span); + + const {homepage_url} = chrome.runtime.getManifest(); + const origin = homepage_url.split('/').slice(0, -1).join('/'); + const colors = shuffle( + ['524c84', '606470', '755da3', 'c06c84', '393e46', '446e5c', '693e52', '1d566e', '693e52', 'd95858', 'f27370'] + ); + shuffle(Object.entries(json)).slice(0, cols).forEach(([id, {name}], i) => { + const td = document.createElement('td'); + const a = Object.assign(document.createElement('a'), { + target: '_blank', + title: 'Click to browse', + href: origin + '/' + id + '.html?context=explore' + }); + + const icon = document.createElement('span'); + icon.textContent = name.split(' ').slice(0, 2).map(s => s[0]).join('').toUpperCase(); + icon.classList.add('icon'); + icon.style['background-color'] = '#' + colors[i]; + a.appendChild(icon); + + const span = document.createElement('span'); + span.classList.add('title'); + span.textContent = name; + a.appendChild(span); + td.appendChild(a); + tr.appendChild(td); + }); + table.appendChild(tr); + root.appendChild(table); + }; + const init = () => { + if (count >= INC) { + if (count < INC + 3) { + cload(); + } + else { + explore(); + } + if (count > INC + 5) { + localStorage.setItem('explore-count', INC - 6); + } + else { + localStorage.setItem('explore-count', count + 1); + } + } + else { + explore(); + localStorage.setItem('explore-count', count + 1); + } + }; + if (/Edg/.test(navigator.userAgent) === false) { + init(); + } +} diff --git a/extension/firefox/data/popup/matched.json b/extension/firefox/data/popup/matched.json new file mode 100644 index 0000000..54c58fb --- /dev/null +++ b/extension/firefox/data/popup/matched.json @@ -0,0 +1,35 @@ +{ + "country-flags": { + "name": "Country Flags & IP WHOIS" + }, + "save-images": { + "name": "Download All Images" + }, + "media-player": { + "name": "YouTube Media Player" + }, + "tab-discard": { + "name": "Auto Tab Discard" + }, + "block-site": { + "name": "Block Site" + }, + "chrome-reader-view": { + "name": "Reader View" + }, + "dark-theme": { + "name": "Dark Theme" + }, + "mute-tab": { + "name": "Mute Tab" + }, + "proxy-switcher": { + "name": "Proxy Switcher" + }, + "font-finder": { + "name": "Font Finder" + }, + "bookmarks-commander": { + "name": "Bookmarks Commander" + } +} diff --git a/extension/firefox/manifest.json b/extension/firefox/manifest.json new file mode 100755 index 0000000..186a93a --- /dev/null +++ b/extension/firefox/manifest.json @@ -0,0 +1,62 @@ +{ + "manifest_version": 2, + "name": "__MSG_extensionName__", + "version": "0.4.4", + "default_locale": "en", + "description": "__MSG_extensionDescription__", + "permissions": [ + "tabs", + "storage", + "", + "webNavigation", + "webRequest", + "webRequestBlocking", + "contextMenus" + ], + "optional_permissions": [ + "cookies" + ], + "icons": { + "16": "data/icons/active/16.png", + "18": "data/icons/active/18.png", + "19": "data/icons/active/19.png", + "32": "data/icons/active/32.png", + "36": "data/icons/active/36.png", + "38": "data/icons/active/38.png", + "48": "data/icons/active/48.png", + "64": "data/icons/active/64.png", + "128": "data/icons/active/128.png", + "256": "data/icons/active/256.png" + }, + "storage": { + "managed_schema": "schema.json" + }, + "background":{ + "scripts":[ + "ua-parser.min.js", + "common.js" + ] + }, + "browser_action":{ + "default_icon": { + "16": "data/icons/16.png", + "32": "data/icons/32.png", + "48": "data/icons/48.png", + "64": "data/icons/64.png" + }, + "default_popup": "data/popup/index.html" + }, + "homepage_url": "https://add0n.com/useragent-switcher.html", + "options_ui": { + "page": "data/options/index.html", + "chrome_style": true, + "open_in_tab": true + }, + "content_scripts": [{ + "all_frames": true, + "run_at": "document_start", + "match_about_blank": true, + "matches": ["*://*/*"], + "js": ["data/inject.js"] + }] +} diff --git a/extension/schema.json b/extension/firefox/schema.json similarity index 100% rename from extension/schema.json rename to extension/firefox/schema.json diff --git a/extension/ua-parser.min.js b/extension/firefox/ua-parser.min.js similarity index 100% rename from extension/ua-parser.min.js rename to extension/firefox/ua-parser.min.js diff --git a/node/build.js b/node/build.js index 7b6962e..f061bc1 100644 --- a/node/build.js +++ b/node/build.js @@ -13,7 +13,7 @@ const map = { const parser = new UAParser(); -const write = ({name, content}, callback) => fs.writeFile('./browsers/' + name, content, 'utf8', e => { +const write = ({name, content}, callback) => fs.writeFile('../extension/firefox/data/popup/browsers/' + name, content, 'utf8', e => { if (e) { console.log(e); } @@ -32,10 +32,10 @@ const reduce = (arr, length = 400) => { return arr; }; -fs.readdir('./browsers/', async (err, files) => { +fs.readdir('../extension/firefox/data/popup/browsers/', async (err, files) => { if (err) throw err; for (const file of files) { - fs.unlinkSync(path.join('./browsers/', file), err => { + fs.unlinkSync(path.join('../extension/firefox/data/popup/browsers/', file), err => { if (err) throw err; }); } @@ -150,7 +150,7 @@ fs.readdir('./browsers/', async (err, files) => { } } - fs.writeFile('./map.json', JSON.stringify({ + fs.writeFile('../extension/firefox/data/popup/map.json', JSON.stringify({ browser: Object.values(map.browser).map(k => k[0]), os: Object.values(map.os).map(k => k[0]), matching: map.matching diff --git a/node/ua-parser.min.js b/node/ua-parser.min.js index a8fde5b..1e580af 120000 --- a/node/ua-parser.min.js +++ b/node/ua-parser.min.js @@ -1 +1 @@ -../extension/ua-parser.min.js \ No newline at end of file +../extension/firefox/ua-parser.min.js \ No newline at end of file