diff options
Diffstat (limited to 'browser')
295 files changed, 578 insertions, 19180 deletions
diff --git a/browser/LICENSE b/browser/LICENSE index 99d9d6bcd..f1b2067a7 100644 --- a/browser/LICENSE +++ b/browser/LICENSE @@ -2,6 +2,10 @@ Please see the file ../toolkit/content/license.html for the copyright licensing conditions attached to this codebase, including copies of the licenses concerned. -You are not granted rights or licenses to the trademarks of the -Mozilla Foundation or any party, including without limitation the -Firefox name or logo. +You are not granted rights or licenses to the trademarks of Moonchild +Productions or any other party, including without limitation the +Basilisk name or logo. + +The Serpent logo in branding/unofficial is derived from "Sea Serpent" +by Lorc, licensed under the Creative Commons license CC-BY 3.0 + diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index 1c71bcd61..239fe43a4 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='UTF-8'?> -<blocklist lastupdate="1511452800000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> +<blocklist lastupdate="1521130300000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> <emItems> <emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}"> <prefs/> @@ -2087,6 +2087,10 @@ <prefs/> <versionRange minVersion="0" maxVersion="15.0.5" severity="1"/> </emItem> + <emItem blockID="2447476f-043b-4d0b-9d3c-8e859c97d950" id="{44e4b2cf-77ba-4f76-aca7-f3fcbc2dda2f}"> + <prefs/> + <versionRange minVersion="0" maxVersion="*" severity="3"/> + </emItem> </emItems> <pluginItems> <pluginItem blockID="p416"> diff --git a/browser/app/macbuild/Contents/Info.plist.in b/browser/app/macbuild/Contents/Info.plist.in index 6212e886d..d6902fffd 100644 --- a/browser/app/macbuild/Contents/Info.plist.in +++ b/browser/app/macbuild/Contents/Info.plist.in @@ -205,6 +205,11 @@ <true/> <key>LSApplicationCategoryType</key> <string>public.app-category.productivity</string> + <key>LSEnvironment</key> + <dict> + <key>MallocNanoZone</key> + <string>0</string> + </dict> <key>LSFileQuarantineEnabled</key> <true/> <key>LSMinimumSystemVersion</key> diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index ac2e85ea3..184b1fc2e 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -24,11 +24,6 @@ #include "nsStringGlue.h" #ifdef XP_WIN -#ifdef MOZ_ASAN -// ASAN requires basilisk.exe to be built with -MD, and it's OK if we don't -// support Windows XP SP2 in ASAN builds. -#define XRE_DONT_SUPPORT_XPSP2 -#endif #define XRE_WANT_ENVIRON #define strcasecmp _stricmp #ifdef MOZ_SANDBOX diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 94615ded0..5637d1797 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -156,8 +156,8 @@ pref("app.update.service.enabled", true); // .. etc .. // pref("extensions.update.enabled", true); -pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); -pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); pref("extensions.update.interval", 86400); // Check for updates to Extensions and // Themes every day // Non-symmetric (not shared by extensions) extension-specific [update] preferences @@ -229,11 +229,6 @@ pref("browser.slowStartup.notificationDisabled", false); pref("browser.slowStartup.timeThreshold", 40000); pref("browser.slowStartup.maxSamples", 5); -// This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into -// this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream -// repackager of this code using an alternate snippet url, please keep your users safe -pref("browser.aboutHomeSnippets.updateUrl", "https://snippets.cdn.mozilla.net/%STARTPAGE_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/"); - pref("browser.enable_automatic_image_resizing", true); pref("browser.casting.enabled", false); pref("browser.chrome.site_icons", true); @@ -1061,7 +1056,6 @@ pref("services.sync.prefs.sync.browser.download.useDownloadDir", true); pref("services.sync.prefs.sync.browser.formfill.enable", true); pref("services.sync.prefs.sync.browser.link.open_newwindow", true); pref("services.sync.prefs.sync.browser.newtabpage.enabled", true); -pref("services.sync.prefs.sync.browser.newtabpage.enhanced", true); pref("services.sync.prefs.sync.browser.newtabpage.pinned", true); pref("services.sync.prefs.sync.browser.offline-apps.notify", true); pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true); @@ -1156,7 +1150,7 @@ pref("browser.newtabpage.introShown", false); pref("browser.newtabpage.enabled", true); // Toggles the enhanced content of 'about:newtab'. Shows sponsored tiles. -sticky_pref("browser.newtabpage.enhanced", true); +sticky_pref("browser.newtabpage.enhanced", false); // enables Activity Stream inspired layout pref("browser.newtabpage.compact", false); @@ -1398,13 +1392,6 @@ pref("browser.translation.engine", "bing"); // Determines if Telemetry pings can be archived locally. pref("toolkit.telemetry.archive.enabled", true); -// Telemetry experiments settings. -pref("experiments.enabled", true); -pref("experiments.manifest.fetchIntervalSeconds", 86400); -pref("experiments.manifest.uri", "https://telemetry-experiment.cdn.mozilla.net/manifest/v1/firefox/%VERSION%/%CHANNEL%"); -// Whether experiments are supported by the current application profile. -pref("experiments.supported", true); - // Enable GMP support in the addon manager. pref("media.gmp-provider.enabled", true); diff --git a/browser/base/content/abouthome/aboutHome.css b/browser/base/content/abouthome/aboutHome.css index c0b02e257..bc3f9882c 100644 --- a/browser/base/content/abouthome/aboutHome.css +++ b/browser/base/content/abouthome/aboutHome.css @@ -49,8 +49,7 @@ a { background-repeat: no-repeat; } -#searchIconAndTextContainer, -#snippets { +#searchIconAndTextContainer { width: 470px; } @@ -168,48 +167,6 @@ a { transition-duration: 0ms; } -#defaultSnippet1, -#defaultSnippet2, -#rightsSnippet { - display: block; - min-height: 38px; - background: 0 center no-repeat; - padding: 6px 0; - padding-inline-start: 49px; -} - -#rightsSnippet[hidden] { - display: none; -} - -#defaultSnippet1:dir(rtl), -#defaultSnippet2:dir(rtl), -#rightsSnippet:dir(rtl) { - background-position: right 0 center; -} - -#defaultSnippet1 { - background-image: url("chrome://browser/content/abouthome/snippet1.png"); -} - -#defaultSnippet2 { - background-image: url("chrome://browser/content/abouthome/snippet2.png"); -} - -#snippets { - display: inline-block; - text-align: start; - margin: 12px 0; - color: #3c3c3c; - font-size: 75%; - /* 12px is the computed font size, 15px the computed line height of the snippets - with Segoe UI on a default Windows 7 setup. The 15/12 multiplier approximately - converts em from units of font-size to units of line-height. The goal is to - preset the height of a three-line snippet to avoid visual moving/flickering as - the snippets load. */ - min-height: calc(15/12 * 3em); -} - #launcher { display: -moz-box; -moz-box-align: center; @@ -385,20 +342,6 @@ body[narrow] #restorePreviousSession::before { background-image: url("chrome://branding/content/about-logo@2x.png"); } - #defaultSnippet1, - #defaultSnippet2, - #rightsSnippet { - background-size: 40px; - } - - #defaultSnippet1 { - background-image: url("chrome://browser/content/abouthome/snippet1@2x.png"); - } - - #defaultSnippet2 { - background-image: url("chrome://browser/content/abouthome/snippet2@2x.png"); - } - .launchButton::before, #aboutMozilla::before { transform: scale(.5); diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js index 50f3e01cd..0cbcc835a 100644 --- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/abouthome/aboutHome.js @@ -6,23 +6,10 @@ /* import-globals-from ../contentSearchUI.js */ -// The process of adding a new default snippet involves: -// * add a new entity to aboutHome.dtd -// * add a <span/> for it in aboutHome.xhtml -// * add an entry here in the proper ordering (based on spans) -// The <a/> part of the snippet will be linked to the corresponding url. -const DEFAULT_SNIPPETS_URLS = [ - "https://www.mozilla.org/firefox/features/?utm_source=snippet&utm_medium=snippet&utm_campaign=default+feature+snippet" -, "https://addons.mozilla.org/firefox/?utm_source=snippet&utm_medium=snippet&utm_campaign=addons" -]; - -const SNIPPETS_UPDATE_INTERVAL_MS = 14400000; // 4 hours. - // IndexedDB storage constants. const DATABASE_NAME = "abouthome"; const DATABASE_VERSION = 1; const DATABASE_STORAGE = "persistent"; -const SNIPPETS_OBJECTSTORE_NAME = "snippets"; var searchText; // This global tracks if the page has been set up before, to prevent double inits @@ -33,13 +20,6 @@ var gObserver = new MutationObserver(function (mutations) { if (mutation.attributeName == "session") { fitToWidth(); } - if (mutation.attributeName == "snippetsVersion") { - if (!gInitialized) { - ensureSnippetsMapThen(loadSnippets); - gInitialized = true; - } - return; - } } }); @@ -90,126 +70,6 @@ window.addEventListener("keypress", ev => { searchText.value += ev.key; }); -// This object has the same interface as Map and is used to store and retrieve -// the snippets data. It is lazily initialized by ensureSnippetsMapThen(), so -// be sure its callback returned before trying to use it. -var gSnippetsMap; -var gSnippetsMapCallbacks = []; - -/** - * Ensure the snippets map is properly initialized. - * - * @param aCallback - * Invoked once the map has been initialized, gets the map as argument. - * @note Snippets should never directly manage the underlying storage, since - * it may change inadvertently. - */ -function ensureSnippetsMapThen(aCallback) -{ - if (gSnippetsMap) { - aCallback(gSnippetsMap); - return; - } - - // Handle multiple requests during the async initialization. - gSnippetsMapCallbacks.push(aCallback); - if (gSnippetsMapCallbacks.length > 1) { - // We are already updating, the callbacks will be invoked when done. - return; - } - - let invokeCallbacks = function () { - if (!gSnippetsMap) { - gSnippetsMap = Object.freeze(new Map()); - } - - for (let callback of gSnippetsMapCallbacks) { - callback(gSnippetsMap); - } - gSnippetsMapCallbacks.length = 0; - } - - let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION, - storage: DATABASE_STORAGE}); - - openRequest.onerror = function (event) { - // Try to delete the old database so that we can start this process over - // next time. - indexedDB.deleteDatabase(DATABASE_NAME); - invokeCallbacks(); - }; - - openRequest.onupgradeneeded = function (event) { - let db = event.target.result; - if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) { - db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME); - } - } - - openRequest.onsuccess = function (event) { - let db = event.target.result; - - db.onerror = function (event) { - invokeCallbacks(); - } - - db.onversionchange = function (event) { - event.target.close(); - invokeCallbacks(); - } - - let cache = new Map(); - let cursorRequest; - try { - cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME) - .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor(); - } catch (ex) { - console.error(ex); - invokeCallbacks(); - return; - } - - cursorRequest.onerror = function (event) { - invokeCallbacks(); - } - - cursorRequest.onsuccess = function(event) { - let cursor = event.target.result; - - // Populate the cache from the persistent storage. - if (cursor) { - cache.set(cursor.key, cursor.value); - cursor.continue(); - return; - } - - // The cache has been filled up, create the snippets map. - gSnippetsMap = Object.freeze({ - get: (aKey) => cache.get(aKey), - set: function (aKey, aValue) { - db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") - .objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey); - return cache.set(aKey, aValue); - }, - has: (aKey) => cache.has(aKey), - delete: function (aKey) { - db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") - .objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey); - return cache.delete(aKey); - }, - clear: function () { - db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") - .objectStore(SNIPPETS_OBJECTSTORE_NAME).clear(); - return cache.clear(); - }, - get size() { return cache.size; }, - }); - - setTimeout(invokeCallbacks, 0); - } - } -} - function onSearchSubmit(aEvent) { gContentSearchController.search(aEvent); @@ -246,146 +106,6 @@ function setupSearch() */ function loadCompleted() { - var event = new CustomEvent("AboutHomeLoadSnippetsCompleted", {bubbles:true}); - document.dispatchEvent(event); -} - -/** - * Update the local snippets from the remote storage, then show them through - * showSnippets. - */ -function loadSnippets() -{ - if (!gSnippetsMap) - throw new Error("Snippets map has not properly been initialized"); - - // Allow tests to modify the snippets map before using it. - var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles:true}); - document.dispatchEvent(event); - - // Check cached snippets version. - let cachedVersion = gSnippetsMap.get("snippets-cached-version") || 0; - let currentVersion = document.documentElement.getAttribute("snippetsVersion"); - if (cachedVersion < currentVersion) { - // The cached snippets are old and unsupported, restart from scratch. - gSnippetsMap.clear(); - } - - // Check last snippets update. - let lastUpdate = gSnippetsMap.get("snippets-last-update"); - let updateURL = document.documentElement.getAttribute("snippetsURL"); - let shouldUpdate = !lastUpdate || - Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS; - if (updateURL && shouldUpdate) { - // Try to update from network. - let xhr = new XMLHttpRequest(); - xhr.timeout = 5000; - // Even if fetching should fail we don't want to spam the server, thus - // set the last update time regardless its results. Will retry tomorrow. - gSnippetsMap.set("snippets-last-update", Date.now()); - xhr.onloadend = function (event) { - if (xhr.status == 200) { - gSnippetsMap.set("snippets", xhr.responseText); - gSnippetsMap.set("snippets-cached-version", currentVersion); - } - showSnippets(); - loadCompleted(); - }; - try { - xhr.open("GET", updateURL, true); - xhr.send(null); - } catch (ex) { - showSnippets(); - loadCompleted(); - return; - } - } else { - showSnippets(); - loadCompleted(); - } -} - -/** - * Shows locally cached remote snippets, or default ones when not available. - * - * @note: snippets should never invoke showSnippets(), or they may cause - * a "too much recursion" exception. - */ -var _snippetsShown = false; -function showSnippets() -{ - let snippetsElt = document.getElementById("snippets"); - - // Show about:rights notification, if needed. - let showRights = document.documentElement.getAttribute("showKnowYourRights"); - if (showRights) { - let rightsElt = document.getElementById("rightsSnippet"); - let anchor = rightsElt.getElementsByTagName("a")[0]; - anchor.href = "about:rights"; - snippetsElt.appendChild(rightsElt); - rightsElt.removeAttribute("hidden"); - return; - } - - if (!gSnippetsMap) - throw new Error("Snippets map has not properly been initialized"); - if (_snippetsShown) { - // There's something wrong with the remote snippets, just in case fall back - // to the default snippets. - showDefaultSnippets(); - throw new Error("showSnippets should never be invoked multiple times"); - } - _snippetsShown = true; - - let snippets = gSnippetsMap.get("snippets"); - // If there are remotely fetched snippets, try to to show them. - if (snippets) { - // Injecting snippets can throw if they're invalid XML. - try { - snippetsElt.innerHTML = snippets; - // Scripts injected by innerHTML are inactive, so we have to relocate them - // through DOM manipulation to activate their contents. - Array.forEach(snippetsElt.getElementsByTagName("script"), function(elt) { - let relocatedScript = document.createElement("script"); - relocatedScript.type = "text/javascript;version=1.8"; - relocatedScript.text = elt.text; - elt.parentNode.replaceChild(relocatedScript, elt); - }); - return; - } catch (ex) { - // Bad content, continue to show default snippets. - } - } - - showDefaultSnippets(); -} - -/** - * Clear snippets element contents and show default snippets. - */ -function showDefaultSnippets() -{ - // Clear eventual contents... - let snippetsElt = document.getElementById("snippets"); - snippetsElt.innerHTML = ""; - - // ...then show default snippets. - let defaultSnippetsElt = document.getElementById("defaultSnippets"); - let entries = defaultSnippetsElt.querySelectorAll("span"); - // Choose a random snippet. Assume there is always at least one. - let randIndex = Math.floor(Math.random() * entries.length); - let entry = entries[randIndex]; - // Inject url in the eventual link. - if (DEFAULT_SNIPPETS_URLS[randIndex]) { - let links = entry.getElementsByTagName("a"); - // Default snippets can have only one link, otherwise something is messed - // up in the translation. - if (links.length == 1) { - links[0].href = DEFAULT_SNIPPETS_URLS[randIndex]; - } - } - // Move the default snippet to the snippets element. - snippetsElt.appendChild(entry); } function fitToWidth() { diff --git a/browser/base/content/abouthome/aboutHome.xhtml b/browser/base/content/abouthome/aboutHome.xhtml index c288e732e..22bf2e7e8 100644 --- a/browser/base/content/abouthome/aboutHome.xhtml +++ b/browser/base/content/abouthome/aboutHome.xhtml @@ -46,15 +46,6 @@ <input id="searchSubmit" type="button" onclick="onSearchSubmit(event)" title="&contentSearchSubmit.tooltip;"/> </div> - - <div id="snippetContainer"> - <div id="defaultSnippets" hidden="true"> - <span id="defaultSnippet1">&abouthome.defaultSnippet1.v1;</span> - <span id="defaultSnippet2">&abouthome.defaultSnippet2.v1;</span> - </div> - <span id="rightsSnippet" hidden="true">&abouthome.rightsSnippet;</span> - <div id="snippets"/> - </div> </div> <div class="spacer"/> @@ -73,7 +64,5 @@ <button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button> </div> - <a id="aboutMozilla" href="https://www.mozilla.org/about/?utm_source=about-home&utm_medium=Referral" - aria-label="&abouthome.aboutMozilla.label;"/> </body> </html> diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index 51b14d152..3061cccdd 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -456,12 +456,14 @@ oncommand="gContextMenu.openPasswordManager();"/> </menupopup> </menu> +#ifdef MOZ_DEVTOOLS <menuseparator id="inspect-separator" hidden="true"/> <menuitem id="context-inspect" hidden="true" label="&inspectContextMenu.label;" accesskey="&inspectContextMenu.accesskey;" oncommand="gContextMenu.inspectNode();"/> +#endif <menuseparator id="context-media-eme-separator" hidden="true"/> <menuitem id="context-media-eme-learnmore" class="menuitem-iconic" diff --git a/browser/base/content/browser-media.js b/browser/base/content/browser-media.js index f721be74d..bd5c5b227 100644 --- a/browser/base/content/browser-media.js +++ b/browser/base/content/browser-media.js @@ -45,11 +45,23 @@ var gEMEHandler = { } return true; }, - getLearnMoreLink: function(msgId) { - let text = gNavigatorBundle.getString("emeNotifications." + msgId + ".learnMoreLabel"); + getEMEDisabledFragment: function(msgId) { + let mainMessage = gNavigatorBundle.getString("emeNotifications.drmContentDisabled.message"); + let [prefix, suffix] = mainMessage.split(/%(?:\$\d)?S/).map(s => document.createTextNode(s)); + let text = gNavigatorBundle.getString("emeNotifications.drmContentDisabled.learnMoreLabel"); let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL"); - return "<label class='text-link' href='" + baseURL + "drm-content'>" + - text + "</label>"; + let link = document.createElement("label"); + link.className = "text-link"; + link.setAttribute("href", baseURL + "drm-content"); + link.textContent = text; + + let fragment = document.createDocumentFragment(); + [prefix, link, suffix].forEach(n => fragment.appendChild(n)); + return fragment; + }, + getMessageWithBrandName: function(notificationId) { + let msgId = "emeNotifications." + notificationId + ".message"; + return gNavigatorBundle.getFormattedString(msgId, [this._brandShortName]); }, receiveMessage: function({target: browser, data: data}) { let parsedData; @@ -67,7 +79,8 @@ var gEMEHandler = { let notificationId; let buttonCallback; - let params = []; + // Notification message can be either a string or a DOM fragment. + let notificationMessage; switch (status) { case "available": case "cdm-created": @@ -82,17 +95,17 @@ var gEMEHandler = { case "cdm-disabled": notificationId = "drmContentDisabled"; buttonCallback = gEMEHandler.ensureEMEEnabled.bind(gEMEHandler, browser, keySystem) - params = [this.getLearnMoreLink(notificationId)]; + notificationMessage = this.getEMEDisabledFragment(); break; case "cdm-insufficient-version": notificationId = "drmContentCDMInsufficientVersion"; - params = [this._brandShortName]; + notificationMessage = this.getMessageWithBrandName(notificationId); break; case "cdm-not-installed": notificationId = "drmContentCDMInstalling"; - params = [this._brandShortName]; + notificationMessage = this.getMessageWithBrandName(notificationId); break; case "cdm-not-supported": @@ -104,44 +117,29 @@ var gEMEHandler = { return; } - this.showNotificationBar(browser, notificationId, keySystem, params, buttonCallback); - }, - showNotificationBar: function(browser, notificationId, keySystem, labelParams, callback) { + // Now actually create the notification + let box = gBrowser.getNotificationBox(browser); if (box.getNotificationWithValue(notificationId)) { return; } - let msgPrefix = "emeNotifications." + notificationId + "."; - let msgId = msgPrefix + "message"; - - let message = labelParams.length ? - gNavigatorBundle.getFormattedString(msgId, labelParams) : - gNavigatorBundle.getString(msgId); - let buttons = []; - if (callback) { + if (buttonCallback) { + let msgPrefix = "emeNotifications." + notificationId + "."; let btnLabelId = msgPrefix + "button.label"; let btnAccessKeyId = msgPrefix + "button.accesskey"; buttons.push({ label: gNavigatorBundle.getString(btnLabelId), accessKey: gNavigatorBundle.getString(btnAccessKeyId), - callback: callback + callback: buttonCallback }); } let iconURL = "chrome://browser/skin/drm-icon.svg#chains-black"; - // Do a little dance to get rich content into the notification: - let fragment = document.createDocumentFragment(); - let descriptionContainer = document.createElement("description"); - descriptionContainer.innerHTML = message; - while (descriptionContainer.childNodes.length) { - fragment.appendChild(descriptionContainer.childNodes[0]); - } - - box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM, - buttons); + box.appendNotification(notificationMessage, notificationId, iconURL, + box.PRIORITY_WARNING_MEDIUM, buttons); }, showPopupNotificationForSuccess: function(browser, keySystem) { // We're playing EME content! Remove any "we can't play because..." messages. diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index a447880be..83c737977 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -299,24 +299,23 @@ var StarUI = { parent.setAttribute("open", "true"); } } - let panel = this.panel; - let target = panel; - if (target.parentNode) { - // By targeting the panel's parent and using a capturing listener, we - // can have our listener called before others waiting for the panel to - // be shown (which probably expect the panel to be fully initialized) - target = target.parentNode; - } - target.addEventListener("popupshown", function shownListener(event) { - if (event.target == panel) { - target.removeEventListener("popupshown", shownListener, true); - - gEditItemOverlay.initPanel({ node: aNode - , hiddenRows: ["description", "location", - "loadInSidebar", "keyword"] - , focusedElement: "preferred"}); + let onPanelReady = fn => { + let target = this.panel; + if (target.parentNode) { + // By targeting the panel's parent and using a capturing listener, we + // can have our listener called before others waiting for the panel to + // be shown (which probably expect the panel to be fully initialized) + target = target.parentNode; } - }, true); + target.addEventListener("popupshown", function(event) { + fn(); + }, {"capture": true, "once": true}); + }; + gEditItemOverlay.initPanel({ node: aNode + , onPanelReady + , hiddenRows: ["description", "location", + "loadInSidebar", "keyword"] + , focusedElement: "preferred"}); this.panel.openPopup(aAnchorElement, aPosition); }), diff --git a/browser/base/content/browser-plugins.js b/browser/base/content/browser-plugins.js index ad070df12..c1bc65860 100644 --- a/browser/base/content/browser-plugins.js +++ b/browser/base/content/browser-plugins.js @@ -63,9 +63,7 @@ var gPluginHandler = { msg.data.pluginID); break; case "PluginContent:SubmitReport": - if (AppConstants.MOZ_CRASHREPORTER) { - this.submitReport(msg.data.runID, msg.data.keyVals, msg.data.submitURLOptIn); - } + // Nothing to do here break; case "PluginContent:LinkClickCallback": switch (msg.data.name) { @@ -98,11 +96,8 @@ var gPluginHandler = { }, submitReport: function submitReport(runID, keyVals, submitURLOptIn) { - if (!AppConstants.MOZ_CRASHREPORTER) { - return; - } - Services.prefs.setBoolPref("dom.ipc.plugins.reportCrashURL", submitURLOptIn); - PluginCrashReporter.submitCrashReport(runID, keyVals); + /*** STUB ***/ + return; }, // Callback for user clicking a "reload page" link @@ -461,18 +456,7 @@ var gPluginHandler = { // If we don't have a minidumpID, we can't (or didn't) submit anything. // This can happen if the plugin is killed from the task manager. - let state; - if (!AppConstants.MOZ_CRASHREPORTER || !gCrashReporter.enabled) { - // This state tells the user that crash reporting is disabled, so we - // cannot send a report. - state = "noSubmit"; - } else if (!pluginDumpID) { - // This state tells the user that there is no crash report available. - state = "noReport"; - } else { - // This state asks the user to submit a crash report. - state = "please"; - } + let state = "noSubmit"; let mm = window.getGroupMessageManager("browsers"); mm.broadcastAsyncMessage("BrowserPlugins:NPAPIPluginProcessCrashed", @@ -513,22 +497,6 @@ var gPluginHandler = { callback: function() { browser.reload(); }, }]; - if (AppConstants.MOZ_CRASHREPORTER && - PluginCrashReporter.hasCrashReport(pluginID)) { - let submitLabel = gNavigatorBundle.getString("crashedpluginsMessage.submitButton.label"); - let submitKey = gNavigatorBundle.getString("crashedpluginsMessage.submitButton.accesskey"); - let submitButton = { - label: submitLabel, - accessKey: submitKey, - popup: null, - callback: () => { - PluginCrashReporter.submitCrashReport(pluginID); - }, - }; - - buttons.push(submitButton); - } - notification = notificationBox.appendNotification(messageString, "plugin-crashed", iconURL, priority, buttons); diff --git a/browser/base/content/browser-syncui.js b/browser/base/content/browser-syncui.js index c5c2995c8..51bcb15d5 100644 --- a/browser/base/content/browser-syncui.js +++ b/browser/base/content/browser-syncui.js @@ -4,10 +4,10 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -if (AppConstants.MOZ_SERVICES_CLOUDSYNC) { - XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -} +#ifdef MOZ_SERVICES_CLOUDSYNC +XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", + "resource://gre/modules/CloudSync.jsm"); +#endif XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", "resource://gre/modules/FxAccounts.jsm"); @@ -170,9 +170,13 @@ var gSyncUI = { document.getElementById("sync-setup-state").hidden = true; document.getElementById("sync-syncnow-state").hidden = true; +#ifdef MOZ_SERVICES_CLOUDSYNC if (CloudSync && CloudSync.ready && CloudSync().adapters.count) { document.getElementById("sync-syncnow-state").hidden = false; } else if (loginFailed) { +#else + if (loginFailed) { +#endif // unhiding this element makes the menubar show the login failure state. document.getElementById("sync-reauth-state").hidden = false; } else if (needsSetup) { diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index a05b031b2..f03f21c3f 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -557,7 +557,7 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks { transition: none; } -#DateTimePickerPanel { +#DateTimePickerPanel[active="true"] { -moz-binding: url("chrome://global/content/bindings/datetimepopup.xml#datetime-popup"); } @@ -815,7 +815,6 @@ html|*#fullscreen-exit-button { .popup-anchor { /* should occupy space but not be visible */ opacity: 0; - visibility: hidden; pointer-events: none; -moz-stack-sizing: ignore; } diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index d41e94ae6..696a2871a 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -53,19 +53,16 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); ["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"], ["Weave", "resource://services-sync/main.js"], ["fxAccounts", "resource://gre/modules/FxAccounts.jsm"], +#ifdef MOZ_DEVTOOLS + // Note: Do not delete! It is used for: base/content/nsContextMenu.js ["gDevTools", "resource://devtools/client/framework/gDevTools.jsm"], - ["gDevToolsBrowser", "resource://devtools/client/framework/gDevTools.jsm"], +#endif ["webrtcUI", "resource:///modules/webrtcUI.jsm", ] ].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource)); XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing", "resource://gre/modules/SafeBrowsing.jsm"); -if (AppConstants.MOZ_CRASHREPORTER) { - XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter", - "resource:///modules/ContentCrashHandlers.jsm"); -} - // lazy service getters [ ["Favicons", "@mozilla.org/browser/favicon-service;1", "mozIAsyncFavicons"], @@ -74,13 +71,6 @@ if (AppConstants.MOZ_CRASHREPORTER) { ["gDNSService", "@mozilla.org/network/dns-service;1", "nsIDNSService"], ].forEach(([name, cc, ci]) => XPCOMUtils.defineLazyServiceGetter(this, name, cc, ci)); -if (AppConstants.MOZ_CRASHREPORTER) { - XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter", - "@mozilla.org/xre/app-info;1", - "nsICrashReporter"); -} - - XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() { let tmp = {}; Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", tmp); @@ -214,7 +204,8 @@ var gInitialPages = [ "about:home", "about:privatebrowsing", "about:welcomeback", - "about:sessionrestore" + "about:sessionrestore", + "about:logopage" ]; function* browserWindows() { @@ -4582,23 +4573,6 @@ var XULBrowserWindow = { setTimeout(function () { XULBrowserWindow.asyncUpdateUI(); }, 0); else this.asyncUpdateUI(); - - if (AppConstants.MOZ_CRASHREPORTER && aLocationURI) { - let uri = aLocationURI.clone(); - try { - // If the current URI contains a username/password, remove it. - uri.userPass = ""; - } catch (ex) { /* Ignore failures on about: URIs. */ } - - try { - gCrashReporter.annotateCrashReport("URL", uri.spec); - } catch (ex) { - // Don't make noise when the crash reporter is built but not enabled. - if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) { - throw ex; - } - } - } }, asyncUpdateUI: function () { @@ -7893,15 +7867,6 @@ var TabContextMenu = { } }; -Object.defineProperty(this, "HUDService", { - get: function HUDService_getter() { - let devtools = Cu.import("resource://devtools/shared/Loader.jsm", {}).devtools; - return devtools.require("devtools/client/webconsole/hudservice").HUDService; - }, - configurable: true, - enumerable: true -}); - // Prompt user to restart the browser in safe mode function safeModeRestart() { if (Services.appinfo.inSafeMode) { @@ -7959,30 +7924,6 @@ function duplicateTabIn(aTab, where, delta) { } } -var Scratchpad = { - openScratchpad: function SP_openScratchpad() { - return this.ScratchpadManager.openScratchpad(); - } -}; - -XPCOMUtils.defineLazyGetter(Scratchpad, "ScratchpadManager", function() { - let tmp = {}; - Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm", tmp); - return tmp.ScratchpadManager; -}); - -var ResponsiveUI = { - toggle: function RUI_toggle() { - this.ResponsiveUIManager.toggle(window, gBrowser.selectedTab); - } -}; - -XPCOMUtils.defineLazyGetter(ResponsiveUI, "ResponsiveUIManager", function() { - let tmp = {}; - Cu.import("resource://devtools/client/responsivedesign/responsivedesign.jsm", tmp); - return tmp.ResponsiveUIManager; -}); - var MousePosTracker = { _listeners: new Set(), _x: 0, diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index ae531e167..485471ee3 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -9,7 +9,9 @@ <?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?> +#ifdef MOZ_DEVTOOLS <?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?> +#endif <?xml-stylesheet href="chrome://browser/skin/controlcenter/panel.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/customizableui/panelUI.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/skin/" type="text/css"?> @@ -155,13 +157,17 @@ level="parent" overflowpadding="30" /> + <!-- for date/time picker. consumeoutsideclicks is set to never, so that + clicks on the anchored input box are never consumed. --> <panel id="DateTimePickerPanel" type="arrow" hidden="true" orient="vertical" noautofocus="true" - consumeoutsideclicks="false" - level="parent"> + norolluponanchor="true" + consumeoutsideclicks="never" + level="parent" + tabspecific="true"> <iframe id="dateTimePopupFrame"/> </panel> diff --git a/browser/base/content/newtab/customize.js b/browser/base/content/newtab/customize.js index 28a52373c..39724fa91 100644 --- a/browser/base/content/newtab/customize.js +++ b/browser/base/content/newtab/customize.js @@ -25,7 +25,6 @@ var gCustomize = { this._nodes.button.addEventListener("click", e => this.showPanel(e)); this._nodes.blank.addEventListener("click", this); this._nodes.classic.addEventListener("click", this); - this._nodes.enhanced.addEventListener("click", this); this._nodes.learn.addEventListener("click", this); this.updateSelected(); @@ -87,11 +86,7 @@ var gCustomize = { sendAsyncMessage("NewTab:Customize", {enabled: false, enhanced: false}); break; case "newtab-customize-classic": - if (this._nodes.enhanced.getAttribute("selected")){ - sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: true}); - } else { - sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: false}); - } + sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: false}); break; case "newtab-customize-enhanced": sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: !gAllPages.enhanced}); @@ -114,9 +109,9 @@ var gCustomize = { }, updateSelected: function() { - let {enabled, enhanced} = gAllPages; - let selected = enabled ? enhanced ? "enhanced" : "classic" : "blank"; - ["enhanced", "classic", "blank"].forEach(id => { + let {enabled} = gAllPages; + let selected = enabled ? "classic" : "blank"; + ["classic", "blank"].forEach(id => { let node = this._nodes[id]; if (id == selected) { node.setAttribute("selected", true); @@ -125,9 +120,5 @@ var gCustomize = { node.removeAttribute("selected"); } }); - if (selected == "enhanced") { - // If enhanced is selected, so is classic (since enhanced is a subitem of classic) - this._nodes.classic.setAttribute("selected", true); - } }, }; diff --git a/browser/base/content/newtab/newTab.xhtml b/browser/base/content/newtab/newTab.xhtml index 07fb0093e..eef51b4b2 100644 --- a/browser/base/content/newtab/newTab.xhtml +++ b/browser/base/content/newtab/newTab.xhtml @@ -33,15 +33,8 @@ <div id="newtab-customize-title" class="newtab-customize-panel-item"> <label>&newtab.customize.cog.title2;</label> </div> - - <div class="newtab-customize-complex-option"> - <div id="newtab-customize-classic" class="newtab-customize-panel-superitem newtab-customize-panel-item selectable"> - <label>&newtab.customize.classic;</label> - </div> - <div id="newtab-customize-enhanced" class="newtab-customize-panel-subitem"> - <label class="checkbox"></label> - <label>&newtab.customize.cog.enhanced;</label> - </div> + <div id="newtab-customize-classic" class="newtab-customize-panel-item selectable"> + <label>&newtab.customize.classic;</label> </div> <div id="newtab-customize-blank" class="newtab-customize-panel-item selectable"> <label>&newtab.customize.blank2;</label> diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index 8eb9b034f..ddf695202 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -1158,7 +1158,8 @@ nsContextMenu.prototype = { this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); openUILink(this.mediaURL, e, { disallowInheritPrincipal: true, - referrerURI: referrerURI }); + referrerURI: referrerURI, + forceAllowDataURI: true }); } }, diff --git a/browser/base/content/sync/aboutSyncTabs.js b/browser/base/content/sync/aboutSyncTabs.js index 0c5dbb2d8..f4bb607ea 100644 --- a/browser/base/content/sync/aboutSyncTabs.js +++ b/browser/base/content/sync/aboutSyncTabs.js @@ -7,7 +7,6 @@ var Cu = Components.utils; Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/main.js"); Cu.import("resource:///modules/PlacesUIUtils.jsm"); -Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/PlacesUtils.jsm", this); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -15,10 +14,10 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); -if (AppConstants.MOZ_SERVICES_CLOUDSYNC) { - XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -} +#ifdef MOZ_SERVICES_CLOUDSYNC +XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", + "resource://gre/modules/CloudSync.jsm"); +#endif var RemoteTabViewer = { _tabsList: null, @@ -184,12 +183,16 @@ var RemoteTabViewer = { } } +#ifdef MOZ_SERVICES_CLOUDSYNC if (CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs()) { this._generateCloudSyncTabList() .then(complete, complete); } else { complete(); } +#else + complete(); +#endif }, _clearTabList: function () { diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js index 05f8e00ab..7e803796a 100644 --- a/browser/base/content/tab-content.js +++ b/browser/base/content/tab-content.js @@ -147,13 +147,10 @@ var AboutHomeListener = { if (aData.showRestoreLastSession && !PrivateBrowsingUtils.isContentWindowPrivate(content)) doc.getElementById("launcher").setAttribute("session", "true"); - // Inject search engine and snippets URL. + // Inject search engine URL. let docElt = doc.documentElement; - // Set snippetsVersion last, which triggers to show the snippets when it's set. - docElt.setAttribute("snippetsURL", aData.snippetsURL); if (aData.showKnowYourRights) docElt.setAttribute("showKnowYourRights", "true"); - docElt.setAttribute("snippetsVersion", aData.snippetsVersion); }, onPageLoad: function() { diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 833369f4d..6ceaf773e 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -35,7 +35,7 @@ var gBidiUI = false; * Determines whether the given url is considered a special URL for new tabs. */ function isBlankPageURL(aURL) { - return aURL == "about:blank" || aURL == BROWSER_NEW_TAB_URL; + return aURL == "about:blank" || aURL == "about:newtab" || aURL == "about:logopage"; } function getBrowserURL() @@ -197,6 +197,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI openLinkIn(url, where, params); } +/* eslint-disable complexity */ function openLinkIn(url, where, params) { if (!where || !url) return; @@ -212,6 +213,7 @@ function openLinkIn(url, where, params) { params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT); var aRelatedToCurrent = params.relatedToCurrent; var aAllowMixedContent = params.allowMixedContent; + var aForceAllowDataURI = params.forceAllowDataURI; var aInBackground = params.inBackground; var aDisallowInheritPrincipal = params.disallowInheritPrincipal; var aInitiatingDoc = params.initiatingDoc; @@ -378,6 +380,9 @@ function openLinkIn(url, where, params) { if (aIndicateErrorPageLoad) { flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV; } + if (aForceAllowDataURI) { + flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI; + } let {URI_INHERITS_SECURITY_CONTEXT} = Ci.nsIProtocolHandler; if (aForceAboutBlankViewerInCurrent && diff --git a/browser/base/jar.mn b/browser/base/jar.mn index a65c77338..c58265351 100644 --- a/browser/base/jar.mn +++ b/browser/base/jar.mn @@ -67,7 +67,7 @@ browser.jar: content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js) content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml) * content/browser/browser.css (content/browser.css) - content/browser/browser.js (content/browser.js) +* content/browser/browser.js (content/browser.js) * content/browser/browser.xul (content/browser.xul) content/browser/browser-addons.js (content/browser-addons.js) content/browser/browser-captivePortal.js (content/browser-captivePortal.js) @@ -87,7 +87,7 @@ browser.jar: content/browser/browser-safebrowsing.js (content/browser-safebrowsing.js) content/browser/browser-sidebar.js (content/browser-sidebar.js) content/browser/browser-social.js (content/browser-social.js) - content/browser/browser-syncui.js (content/browser-syncui.js) +* content/browser/browser-syncui.js (content/browser-syncui.js) * content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) #ifdef CAN_DRAW_IN_TITLEBAR content/browser/browser-tabsintitlebar.js (content/browser-tabsintitlebar.js) @@ -138,7 +138,7 @@ browser.jar: content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js) content/browser/pageinfo/security.js (content/pageinfo/security.js) content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul) - content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js) +* content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js) content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css) content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml) content/browser/sync/setup.xul (content/sync/setup.xul) diff --git a/browser/branding/official/locales/en-US/brand.dtd b/browser/branding/official/locales/en-US/brand.dtd index 7bfa07f71..1d2ac791e 100644 --- a/browser/branding/official/locales/en-US/brand.dtd +++ b/browser/branding/official/locales/en-US/brand.dtd @@ -6,4 +6,5 @@ <!ENTITY brandShortName "Basilisk"> <!ENTITY brandFullName "Basilisk"> <!ENTITY vendorShortName "Moonchild"> +<!ENTITY vendorFullName "Moonchild Productions"> <!ENTITY trademarkInfo.part1 "Basilisk, Basilisk Browser and the Basilisk logos are trademarks of Moonchild Productions."> diff --git a/browser/branding/shared/branding.mozbuild b/browser/branding/shared/branding.mozbuild index 29d25094f..e6fee3f4e 100644 --- a/browser/branding/shared/branding.mozbuild +++ b/browser/branding/shared/branding.mozbuild @@ -33,9 +33,9 @@ def ApplicationBranding(): elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': BRANDING_FILES += [ '../shared/dsstore', + 'background.png', 'disk.icns', 'document.icns', - 'background.png', 'firefox.icns', ] elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: @@ -53,4 +53,4 @@ def ApplicationBranding(): ] DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] DEFINES['MOZ_BRANDING_DIRECTORY'] = CONFIG['MOZ_BRANDING_DIRECTORY'] - DEFINES['MOZILLA_UAVERSION_U'] = CONFIG['MOZILLA_UAVERSION_U']
\ No newline at end of file + DEFINES['MOZILLA_UAVERSION_U'] = CONFIG['MOZILLA_UAVERSION_U'] diff --git a/browser/branding/shared/preferences.inc b/browser/branding/shared/preferences.inc index 08f6c950b..90fd3da06 100644 --- a/browser/branding/shared/preferences.inc +++ b/browser/branding/shared/preferences.inc @@ -31,3 +31,5 @@ pref("browser.safebrowsing.downloads.remote.enabled", false); // Disable the UI controls for it as well for Basilisk-official. pref("browser.safebrowsing.UI.enabled", false); +// +pref("general.useragent.appVersionIsBuildID", true); diff --git a/browser/branding/shared/uaoverrides.inc b/browser/branding/shared/uaoverrides.inc index 13a89ed7f..59e413728 100644 --- a/browser/branding/shared/uaoverrides.inc +++ b/browser/branding/shared/uaoverrides.inc @@ -5,7 +5,7 @@ #define GRE_DATE_SLICE Goanna/20170101
#define APP_SLICE Basilisk/@MOZ_APP_VERSION@
-#define GK_VERSION 52.0
+#define GK_VERSION 52.9
#define GK_SLICE Gecko/20100101
#define FX_SLICE Firefox/@GK_VERSION@
@@ -27,6 +27,8 @@ pref("@GUAO_PREF@.accounts.firefox.com", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION // The never-ending Facebook debacle...
// UA-Sniffing domains below are pending responses from their operators - temp workaround
+// Daily motion only likes strict Firefox UAs
+pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ Firefox/52.0");
// The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
@@ -35,4 +37,5 @@ pref("@GUAO_PREF@.accounts.firefox.com", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION // UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon
// The following domains do not like the Goanna slice
-
+pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
+pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@");
diff --git a/browser/branding/unofficial/VisualElements_150.png b/browser/branding/unofficial/VisualElements_150.png Binary files differindex 461961e8d..eb74e4adc 100644 --- a/browser/branding/unofficial/VisualElements_150.png +++ b/browser/branding/unofficial/VisualElements_150.png diff --git a/browser/branding/unofficial/VisualElements_70.png b/browser/branding/unofficial/VisualElements_70.png Binary files differindex aad81f40d..571532a9b 100644 --- a/browser/branding/unofficial/VisualElements_70.png +++ b/browser/branding/unofficial/VisualElements_70.png diff --git a/browser/branding/unofficial/branding.nsi b/browser/branding/unofficial/branding.nsi index 34214453f..77f08a4cb 100644 --- a/browser/branding/unofficial/branding.nsi +++ b/browser/branding/unofficial/branding.nsi @@ -8,19 +8,19 @@ # BrandFullNameInternal is used for some registry and file system values # instead of BrandFullName and typically should not be modified. -!define BrandFullNameInternal "Mozilla Developer Preview" -!define CompanyName "mozilla.org" -!define URLInfoAbout "https://www.mozilla.org" -!define HelpLink "https://support.mozilla.org" +!define BrandFullNameInternal "Serpent" +!define CompanyName "Moonchild Productions" +!define URLInfoAbout "http://www.basilisk-browser.org" +!define HelpLink "https://forum.palemoon.org" -!define URLStubDownload "http://download.mozilla.org/?os=win&lang=${AB_CD}&product=firefox-latest" -!define URLManualDownload "https://www.mozilla.org/${AB_CD}/firefox/installer-help/?channel=release&installer_lang=${AB_CD}" -!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/" +!define URLStubDownload "" +!define URLManualDownload "" +!define URLSystemRequirements "" !define Channel "unofficial" # The installer's certificate name and issuer expected by the stub installer -!define CertNameDownload "Mozilla Corporation" -!define CertIssuerDownload "DigiCert SHA2 Assured ID Code Signing CA" +!define CertNameDownload "" +!define CertIssuerDownload "" # Dialog units are used so the UI displays correctly with the system's DPI # settings. diff --git a/browser/branding/unofficial/configure.sh b/browser/branding/unofficial/configure.sh index edd3bd3e8..ea4e37e45 100644 --- a/browser/branding/unofficial/configure.sh +++ b/browser/branding/unofficial/configure.sh @@ -2,4 +2,4 @@ # 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/. -MOZ_APP_DISPLAYNAME=Nightly +MOZ_APP_DISPLAYNAME=Serpent diff --git a/browser/branding/unofficial/content/about-background.png b/browser/branding/unofficial/content/about-background.png Binary files differindex 70eb8dafd..e36211b08 100644 --- a/browser/branding/unofficial/content/about-background.png +++ b/browser/branding/unofficial/content/about-background.png diff --git a/browser/branding/unofficial/content/about-logo.png b/browser/branding/unofficial/content/about-logo.png Binary files differindex 4c7214ba3..c5a838178 100644 --- a/browser/branding/unofficial/content/about-logo.png +++ b/browser/branding/unofficial/content/about-logo.png diff --git a/browser/branding/unofficial/content/about-logo@2x.png b/browser/branding/unofficial/content/about-logo@2x.png Binary files differindex 3526eda54..48c31564c 100644 --- a/browser/branding/unofficial/content/about-logo@2x.png +++ b/browser/branding/unofficial/content/about-logo@2x.png diff --git a/browser/branding/unofficial/content/about-wordmark.svg b/browser/branding/unofficial/content/about-wordmark.svg index 60b278d03..ce7a5c07b 100644 --- a/browser/branding/unofficial/content/about-wordmark.svg +++ b/browser/branding/unofficial/content/about-wordmark.svg @@ -1,22 +1,87 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- 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/. --> -<svg xmlns="http://www.w3.org/2000/svg" width="132px" height="48px" viewBox="0 0 132 48"> - <path fill="#fff" d="M60.6,14.3l-2.4-2.4C57,12.7,56,13,54.7,13c-3,0-3.8-1.4-7.6-1.4c-5.4,0-9.2,3.4-9.2,8.4 - c0,3.3,2.2,6.1,5.6,7.2c-3.4,1-4.5,2.2-4.5,4.3c0,2.2,1.8,3.6,4.7,3.6h3.8c2.5,0,3.9,0.2,4.9,0.9c0.9,0.6,1.4,1.6,1.4,3 - c0,3.1-2.2,4.4-6,4.4c-2,0-3.8-0.5-5.1-1.2c-0.9-0.6-1.5-1.6-1.5-2.9c0-0.8,0.3-1.7,0.7-2.2l-4.1,0.4c-0.3,1-0.5,1.7-0.5,2.6 - c0,3.5,3,6.4,10.8,6.4c6.1,0,9.9-2.5,9.9-7.9c0-2.1-0.8-3.9-2.7-5.3c-1.5-1.1-3.1-1.4-6-1.4h-4c-1.3,0-2-0.5-2-1.2 - c0-0.8,1.1-1.7,4.5-2.9c1.8,0,3.4-0.3,4.7-1.1c2.3-1.4,3.7-4.1,3.7-6.8c0-1.6-0.5-3-1.5-4.3c0.4,0.2,1.1,0.3,1.7,0.3 - C57.9,15.8,59,15.4,60.6,14.3z M47.1,24.8c-3.1,0-4.8-1.7-4.8-4.8c0-3.5,1.6-5.1,4.7-5.1c3.3,0,4.6,1.5,4.6,4.9 - C51.6,23.1,50.1,24.8,47.1,24.8z M30.7,1.3c-1.7,0-3,1.4-3,3.1s1.4,3,3,3c1.7,0,3.1-1.3,3.1-3C33.7,2.7,32.4,1.3,30.7,1.3z - M107.7,34.5c-1.1,0-1.4-0.6-1.4-2.5V6.5c0-3.8-0.6-5.9-0.6-5.9l-3.9,0.8c0,0,0.6,1.9,0.6,5.1v26.4c0,1.8,0.4,2.8,1.2,3.5 - c0.7,0.7,1.7,1,2.9,1c1,0,1.5-0.1,2.5-0.5l-0.8-2.5C108.2,34.4,107.8,34.5,107.7,34.5z M74.7,11.6c-3.2,0-6.1,1.8-8.3,3.9 - c0,0,0.2-1.8,0.2-3.4V6.3c0-3.8-0.7-5.9-0.7-5.9l-3.9,0.7c0,0,0.7,1.9,0.7,5.1V37h3.9V19.3c2.1-2.7,4.9-4.2,7.2-4.2 - c1.3,0,2.3,0.4,2.9,1c0.7,0.7,0.9,1.8,0.9,3.7V37h3.8V19.1c0-1.8-0.1-2.6-0.4-3.6C80.4,13.2,77.7,11.6,74.7,11.6z M127.4,12.1 - l-4.9,16.4c-0.6,2-1.6,5.2-1.6,5.2s-0.7-3.9-1.5-6.2l-5.1-16.2l-3.9,1.3l5.4,15.6c0.8,2.5,2.2,7.4,2.5,9l1.6-0.3 - c-1.3,5.1-2.5,6.7-5.7,7.6l1.2,2.7c4.4-1,6.4-4.3,8-9.3l8.6-25.8H127.4z M96.9,15l1.2-2.9h-6.2c0-3.3,0.5-7.2,0.5-7.2l-4.1,0.9 - c0,0-0.4,3.9-0.4,6.3h-3.2V15h3.2v17.1c0,2.5,0.7,4.1,2.4,5c0.9,0.4,1.9,0.7,3.3,0.7c1.8,0,3.1-0.4,4.4-1l-0.6-2.5 - c-0.7,0.3-1.3,0.5-2.4,0.5c-2.4,0-3.2-0.9-3.2-3.7V15H96.9z M28.6,37h4.1V11.5l-4.1,0.6V37z M18.9,21.3c0,5,0.4,10.5,0.4,10.5 - s-1.4-3.8-3.2-7.2L4.8,2.7H0V37h4.2L4,17.1c0-4.5-0.4-9.3-0.4-9.3s1.7,4.1,3.9,8.2l11,21h4.3V2.7h-4L18.9,21.3z"/> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="132px" + height="48px" + viewBox="0 0 132 48" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + sodipodi:docname="about-wordmark.svg"> + <metadata + id="metadata10"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs8" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1215" + inkscape:window-height="778" + id="namedview6" + showgrid="false" + inkscape:zoom="2.4090909" + inkscape:cx="91.154186" + inkscape:cy="24" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /> + <g + transform="scale(0.83939803,1.1913299)" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42.56122971px;line-height:125%;font-family:'Levenim MT';-inkscape-font-specification:'Levenim MT';letter-spacing:0px;word-spacing:0px;fill:#a8e6db;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="text4138"> + <path + d="m 18.521413,24.115665 q 0,3.470569 -2.618513,5.881264 -2.535386,2.348349 -6.0475185,2.348349 -5.6942271,0 -9.22714164,-6.463156 L 3.2259712,24.323483 q 2.7432042,5.04999 6.3384644,5.04999 3.4082234,0 4.9460804,-2.639295 0.706583,-1.205347 0.706583,-2.556167 0,-1.537857 -1.039093,-3.013369 Q 12.827186,19.23193 9.1487985,16.488726 5.3872836,13.703958 4.1819363,12.082974 2.560952,9.9008792 2.560952,7.4070572 q 0,-4.2394975 3.6576056,-6.2345551 1.7248936,-0.93518331 3.761515,-0.93518331 4.3641884,0 8.0217944,5.00842591 L 15.508045,7.1368931 Q 14.115661,5.3080903 13.138914,4.5391618 11.684184,3.3961601 9.917727,3.3961601 q -1.7664573,0 -2.9510228,1.0598743 -1.246911,1.0806563 -1.246911,2.8263317 0,2.0574032 1.9327121,3.9693339 0.56111,0.540328 3.9485517,3.054932 3.117277,2.306785 4.655134,4.15637 2.265222,2.763986 2.265222,5.652663 z" + style="" + id="path4143" /> + <path + d="m 46.743165,20.499623 -20.324649,0 q 0.08313,3.803079 2.369131,6.338464 2.410694,2.660077 6.151427,2.660077 3.616042,0 6.130646,-2.202876 1.143002,-0.997529 2.47304,-3.221187 l 2.452259,1.288475 q -2.286004,4.468098 -6.338465,6.026737 -1.974275,0.768928 -4.468097,0.768928 -5.091554,0 -8.437432,-3.36666 -3.325096,-3.366659 -3.325096,-8.458213 0,-4.301843 2.639295,-7.668503 3.345878,-4.2810608 8.956978,-4.2810608 5.777354,0 9.227141,4.3849708 2.452259,3.117277 2.493822,7.730848 z M 43.54276,17.985019 q -1.080656,-4.301843 -4.634352,-5.964391 -1.828803,-0.852056 -3.844643,-0.852056 -3.325096,0 -5.715008,2.140531 -1.745676,1.558639 -2.639295,4.675916 l 16.833298,0 z" + style="" + id="path4145" /> + <path + d="m 62.516592,9.1527326 -1.517075,2.4522584 q -0.914401,-0.394855 -1.537857,-0.394855 -3.491351,0 -4.862953,4.904517 -0.540328,1.932712 -0.540328,7.813975 l 0,7.647721 -2.971805,0 0,-22.610653 2.971805,0 0,3.304314 q 2.639295,-3.8862058 5.881264,-3.8862058 1.205347,0 2.576949,0.7689284 z" + style="" + id="path4147" /> + <path + d="m 88.577029,20.208677 q 0,4.94608 -3.325096,8.416649 -3.366659,3.532915 -8.271176,3.532915 -5.382499,0 -9.060887,-4.468098 l 0,12.157383 -2.888677,0 0,-30.88183 2.888677,0 0,4.15637 q 3.449787,-4.7382618 8.977759,-4.7382618 4.883735,0 8.271177,3.4705688 3.408223,3.470569 3.408223,8.354304 z m -2.930241,0.103909 q 0,-2.410694 -1.205347,-4.572007 -1.205347,-2.161312 -3.283532,-3.345878 -2.057403,-1.205347 -4.48888,-1.205347 -3.865424,0 -6.421592,2.660077 -2.535385,2.660077 -2.535385,6.546283 0,5.403281 4.468097,7.897103 2.140531,1.205347 4.530444,1.205347 2.410694,0 4.488879,-1.246911 2.01584,-1.226129 3.221187,-3.387441 1.226129,-2.161313 1.226129,-4.551226 z" + style="" + id="path4149" /> + <path + d="m 116.23767,20.499623 -20.324647,0 q 0.08313,3.803079 2.36913,6.338464 2.410697,2.660077 6.151427,2.660077 3.61604,0 6.13065,-2.202876 1.143,-0.997529 2.47304,-3.221187 l 2.45226,1.288475 q -2.28601,4.468098 -6.33847,6.026737 -1.97427,0.768928 -4.4681,0.768928 -5.09155,0 -8.437428,-3.36666 -3.325096,-3.366659 -3.325096,-8.458213 0,-4.301843 2.639295,-7.668503 3.345878,-4.2810608 8.956979,-4.2810608 5.77735,0 9.22714,4.3849708 2.45226,3.117277 2.49382,7.730848 z m -3.2004,-2.514604 q -1.08066,-4.301843 -4.63436,-5.964391 -1.8288,-0.852056 -3.84464,-0.852056 -3.32509,0 -5.715007,2.140531 -1.745675,1.558639 -2.639295,4.675916 l 16.833302,0 z" + style="" + id="path4151" /> + <path + d="m 141.4045,31.576349 -2.88868,0 0,-10.78578 q 0,-3.823861 -0.33251,-5.216245 -1.08066,-4.509661 -5.69423,-4.509661 -2.63929,0 -4.73826,1.745675 -2.07819,1.724894 -2.7432,4.322625 -0.41564,1.641766 -0.41564,6.151428 l 0,8.291958 -2.90946,0 0,-22.610653 2.90946,0 0,4.052461 q 3.47057,-4.6343528 8.47899,-4.6343528 2.47304,0 4.44732,1.2676928 1.99506,1.246911 2.93024,3.470569 0.95597,2.202876 0.95597,6.816447 l 0,11.637836 z" + style="" + id="path4153" /> + <path + d="m 157.69747,11.459518 -4.61357,0 0,20.116831 -2.93024,0 0,-20.116831 -3.96934,0 0,-2.493822 3.96934,0 0,-8.3958676 2.93024,0 0,8.3958676 4.61357,0 0,2.493822 z" + style="" + id="path4155" /> + </g> </svg> diff --git a/browser/branding/unofficial/content/about.png b/browser/branding/unofficial/content/about.png Binary files differindex 231449344..e323c8df5 100644 --- a/browser/branding/unofficial/content/about.png +++ b/browser/branding/unofficial/content/about.png diff --git a/browser/branding/unofficial/content/icon48.png b/browser/branding/unofficial/content/icon48.png Binary files differindex 5fc7861e5..16e022a64 100644 --- a/browser/branding/unofficial/content/icon48.png +++ b/browser/branding/unofficial/content/icon48.png diff --git a/browser/branding/unofficial/content/icon64.png b/browser/branding/unofficial/content/icon64.png Binary files differindex 83f7016bc..9860917e3 100644 --- a/browser/branding/unofficial/content/icon64.png +++ b/browser/branding/unofficial/content/icon64.png diff --git a/browser/branding/unofficial/default16.png b/browser/branding/unofficial/default16.png Binary files differindex d285a90b4..67ef39df8 100644 --- a/browser/branding/unofficial/default16.png +++ b/browser/branding/unofficial/default16.png diff --git a/browser/branding/unofficial/default32.png b/browser/branding/unofficial/default32.png Binary files differindex 95adf2497..2f709e6b2 100644 --- a/browser/branding/unofficial/default32.png +++ b/browser/branding/unofficial/default32.png diff --git a/browser/branding/unofficial/default48.png b/browser/branding/unofficial/default48.png Binary files differindex d38185f54..02a1e14c1 100644 --- a/browser/branding/unofficial/default48.png +++ b/browser/branding/unofficial/default48.png diff --git a/browser/branding/unofficial/firefox.icns b/browser/branding/unofficial/firefox.icns Binary files differindex 0c6941acf..2c613634b 100644 --- a/browser/branding/unofficial/firefox.icns +++ b/browser/branding/unofficial/firefox.icns diff --git a/browser/branding/unofficial/firefox.ico b/browser/branding/unofficial/firefox.ico Binary files differindex 5217a6c0b..0c7acb61b 100644 --- a/browser/branding/unofficial/firefox.ico +++ b/browser/branding/unofficial/firefox.ico diff --git a/browser/branding/unofficial/locales/en-US/brand.dtd b/browser/branding/unofficial/locales/en-US/brand.dtd index cf4596ae0..17c243606 100644 --- a/browser/branding/unofficial/locales/en-US/brand.dtd +++ b/browser/branding/unofficial/locales/en-US/brand.dtd @@ -2,8 +2,9 @@ - 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/. --> -<!ENTITY brandShorterName "Nightly"> -<!ENTITY brandShortName "Nightly"> -<!ENTITY brandFullName "Nightly"> -<!ENTITY vendorShortName "Mozilla"> +<!ENTITY brandShorterName "Serpent"> +<!ENTITY brandShortName "Serpent"> +<!ENTITY brandFullName "Serpent"> +<!ENTITY vendorShortName "Moonchild"> +<!ENTITY vendorFullName "Moonchild Productions"> <!ENTITY trademarkInfo.part1 " "> diff --git a/browser/branding/unofficial/locales/en-US/brand.properties b/browser/branding/unofficial/locales/en-US/brand.properties index 8cd2c2ec9..80349f0e3 100644 --- a/browser/branding/unofficial/locales/en-US/brand.properties +++ b/browser/branding/unofficial/locales/en-US/brand.properties @@ -2,9 +2,10 @@ # 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/. -brandShorterName=Nightly -brandShortName=Nightly -brandFullName=Nightly -vendorShortName=Mozilla +brandShorterName=Serpent +brandShortName=Serpent +brandFullName=Serpent +vendorShortName=Moonchild +vendorFullName=Moonchild Productions syncBrandShortName=Sync diff --git a/browser/branding/unofficial/mozicon128.png b/browser/branding/unofficial/mozicon128.png Binary files differindex 471cf4645..739b61084 100644 --- a/browser/branding/unofficial/mozicon128.png +++ b/browser/branding/unofficial/mozicon128.png diff --git a/browser/branding/unofficial/basilisk.VisualElementsManifest.xml b/browser/branding/unofficial/serpent.VisualElementsManifest.xml index 7654e0ab7..5046ee7da 100644 --- a/browser/branding/unofficial/basilisk.VisualElementsManifest.xml +++ b/browser/branding/unofficial/serpent.VisualElementsManifest.xml @@ -4,5 +4,5 @@ Square150x150Logo='browser\VisualElements\VisualElements_150.png' Square70x70Logo='browser\VisualElements\VisualElements_70.png' ForegroundText='light' - BackgroundColor='#14171a'/> + BackgroundColor='#304D7E'/> </Application> diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index a09932d95..717ae9c48 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -35,75 +35,117 @@ struct RedirEntry { URI_SAFE_FOR_UNTRUSTED_CONTENT. */ static RedirEntry kRedirMap[] = { - { "blocked", "chrome://browser/content/blockedSite.xhtml", + { + "basilisk", "chrome://global/content/memoriam.xhtml", + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "blocked", "chrome://browser/content/blockedSite.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "certerror", "chrome://browser/content/aboutNetError.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "certerror", "chrome://browser/content/aboutNetError.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "socialerror", "chrome://browser/content/aboutSocialError.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "socialerror", "chrome://browser/content/aboutSocialError.xhtml", nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "providerdirectory", "chrome://browser/content/aboutProviderDirectory.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "providerdirectory", "chrome://browser/content/aboutProviderDirectory.xhtml", nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "feeds", "chrome://browser/content/feeds/subscribe.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "feeds", "chrome://browser/content/feeds/subscribe.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml", + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml", nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::ALLOW_SCRIPT }, - { "rights", - "chrome://global/content/aboutRights.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "rights", "chrome://global/content/aboutRights.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT }, - { "robots", "chrome://browser/content/aboutRobots.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "robots", "chrome://browser/content/aboutRobots.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT }, - { "searchreset", "chrome://browser/content/search/searchReset.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "searchreset", "chrome://browser/content/search/searchReset.xhtml", nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, - { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", - nsIAboutModule::ALLOW_SCRIPT }, - { "welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", - nsIAboutModule::ALLOW_SCRIPT }, - { "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", - nsIAboutModule::ALLOW_SCRIPT }, - // Linkable because of indexeddb use (bug 1228118) + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, + { + "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", + nsIAboutModule::ALLOW_SCRIPT + }, { "home", "chrome://browser/content/abouthome/aboutHome.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | + // Linkable because of indexeddb use (bug 1228118) nsIAboutModule::MAKE_LINKABLE | nsIAboutModule::ENABLE_INDEXED_DB }, - // the newtab's actual URL will be determined when the channel is created - { "newtab", "about:blank", - nsIAboutModule::ALLOW_SCRIPT }, - { "preferences", "chrome://browser/content/preferences/in-content/preferences.xul", - nsIAboutModule::ALLOW_SCRIPT }, - { "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", - nsIAboutModule::ALLOW_SCRIPT }, + { + // the newtab's actual URL will be determined when the channel is created + "newtab", "about:blank", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "preferences", "chrome://browser/content/preferences/in-content/preferences.xul", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", + nsIAboutModule::ALLOW_SCRIPT + }, #ifdef MOZ_SERVICES_HEALTHREPORT - { "healthreport", "chrome://browser/content/abouthealthreport/abouthealth.xhtml", - nsIAboutModule::ALLOW_SCRIPT }, + { + "healthreport", "chrome://browser/content/abouthealthreport/abouthealth.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, #endif - { "accounts", "chrome://browser/content/aboutaccounts/aboutaccounts.xhtml", - nsIAboutModule::ALLOW_SCRIPT }, - { "reader", "chrome://global/content/reader/aboutReader.html", + { + "accounts", "chrome://browser/content/aboutaccounts/aboutaccounts.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, + { + "reader", "chrome://global/content/reader/aboutReader.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::HIDE_FROM_ABOUTABOUT }, + nsIAboutModule::HIDE_FROM_ABOUTABOUT + }, }; static const int kRedirTotal = ArrayLength(kRedirMap); diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp index f85d8812c..1fad0ce68 100644 --- a/browser/components/build/nsModule.cpp +++ b/browser/components/build/nsModule.cpp @@ -85,6 +85,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID }, + { NS_ABOUT_MODULE_CONTRACTID_PREFIX "basilisk", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blocked", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "socialerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, diff --git a/browser/components/migration/FirefoxProfileMigrator.js b/browser/components/migration/FirefoxProfileMigrator.js index 60ffcf627..2714cdbcd 100644 --- a/browser/components/migration/FirefoxProfileMigrator.js +++ b/browser/components/migration/FirefoxProfileMigrator.js @@ -7,7 +7,7 @@ "use strict"; /* - * Migrates from a Firefox profile in a lossy manner in order to clean up a + * Migrates from a Basilisk profile in a lossy manner in order to clean up a * user's profile. Data is only migrated where the benefits outweigh the * potential problems caused by importing undesired/invalid configurations * from the source profile. diff --git a/browser/components/migration/MigrationUtils.jsm b/browser/components/migration/MigrationUtils.jsm index 104efe005..e133ec520 100644 --- a/browser/components/migration/MigrationUtils.jsm +++ b/browser/components/migration/MigrationUtils.jsm @@ -726,6 +726,7 @@ this.MigrationUtils = Object.freeze({ "Internet Explorer": "ie", "Microsoft Edge": "edge", "Safari": "safari", + "Basilisk": "firefox", "Firefox": "firefox", "Nightly": "firefox", "Google Chrome": "chrome", // Windows, Linux diff --git a/browser/components/moz.build b/browser/components/moz.build index 0393b6e92..a49580200 100644 --- a/browser/components/moz.build +++ b/browser/components/moz.build @@ -37,11 +37,8 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browsercompsbase' -EXTRA_PP_COMPONENTS += [ - 'BrowserComponents.manifest', -] - EXTRA_COMPONENTS += [ + 'BrowserComponents.manifest', 'nsBrowserContentHandler.js', 'nsBrowserGlue.js', ] diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index b366c3f81..74144fc1b 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -558,7 +558,7 @@ nsBrowserContentHandler.prototype = { if (overridePage && startPage && !willRestoreSession && !skipStartPage) return overridePage + "|" + startPage; - return overridePage || startPage || "about:blank"; + return overridePage || startPage || "about:blank" || "about:logopage"; }, get startPage() { diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index f97c173a0..448bb910d 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -70,15 +70,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s ["webrtcUI", "resource:///modules/webrtcUI.jsm"], ].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource)); -if (AppConstants.MOZ_CRASHREPORTER) { - XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter", - "resource:///modules/ContentCrashHandlers.jsm"); - XPCOMUtils.defineLazyModuleGetter(this, "UnsubmittedCrashHandler", - "resource:///modules/ContentCrashHandlers.jsm"); - XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit", - "resource://gre/modules/CrashSubmit.jsm"); -} - XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() { return Services.strings.createBundle('chrome://branding/locale/brand.properties'); }); @@ -710,10 +701,6 @@ BrowserGlue.prototype = { } TabCrashHandler.init(); - if (AppConstants.MOZ_CRASHREPORTER) { - PluginCrashReporter.init(); - UnsubmittedCrashHandler.init(); - } Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); }, diff --git a/browser/components/places/PlacesUIUtils.jsm b/browser/components/places/PlacesUIUtils.jsm index b25835a71..17fa276aa 100644 --- a/browser/components/places/PlacesUIUtils.jsm +++ b/browser/components/places/PlacesUIUtils.jsm @@ -46,43 +46,6 @@ let gFaviconLoadDataMap = new Map(); // copied from utilityOverlay.js const TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab"; -// This function isn't public both because it's synchronous and because it is -// going to be removed in bug 1072833. -function IsLivemark(aItemId) { - // Since this check may be done on each dragover event, it's worth maintaining - // a cache. - let self = IsLivemark; - if (!("ids" in self)) { - const LIVEMARK_ANNO = PlacesUtils.LMANNO_FEEDURI; - - let idsVec = PlacesUtils.annotations.getItemsWithAnnotation(LIVEMARK_ANNO); - self.ids = new Set(idsVec); - - let obs = Object.freeze({ - QueryInterface: XPCOMUtils.generateQI(Ci.nsIAnnotationObserver), - - onItemAnnotationSet(itemId, annoName) { - if (annoName == LIVEMARK_ANNO) - self.ids.add(itemId); - }, - - onItemAnnotationRemoved(itemId, annoName) { - // If annoName is set to an empty string, the item is gone. - if (annoName == LIVEMARK_ANNO || annoName == "") - self.ids.delete(itemId); - }, - - onPageAnnotationSet() { }, - onPageAnnotationRemoved() { }, - }); - PlacesUtils.annotations.addObserver(obs); - PlacesUtils.registerShutdownFunction(() => { - PlacesUtils.annotations.removeObserver(obs); - }); - } - return self.ids.has(aItemId); -} - let InternalFaviconLoader = { /** * This gets called for every inner window that is destroyed. @@ -509,6 +472,52 @@ this.PlacesUIUtils = { }, /** + * Test if a bookmark item = a live bookmark item. + * + * @param aItemId + * item identifier + * @return true if a live bookmark item, false otherwise. + * + * @note Maybe this should be removed later, see bug 1072833. + */ + _isLivemark: + function PUIU__isLivemark(aItemId) + { + // Since this check may be done on each dragover event, it's worth maintaining + // a cache. + let self = PUIU__isLivemark; + if (!("ids" in self)) { + const LIVEMARK_ANNO = PlacesUtils.LMANNO_FEEDURI; + + let idsVec = PlacesUtils.annotations.getItemsWithAnnotation(LIVEMARK_ANNO); + self.ids = new Set(idsVec); + + let obs = Object.freeze({ + QueryInterface: XPCOMUtils.generateQI(Ci.nsIAnnotationObserver), + + onItemAnnotationSet(itemId, annoName) { + if (annoName == LIVEMARK_ANNO) + self.ids.add(itemId); + }, + + onItemAnnotationRemoved(itemId, annoName) { + // If annoName is set to an empty string, the item is gone. + if (annoName == LIVEMARK_ANNO || annoName == "") + self.ids.delete(itemId); + }, + + onPageAnnotationSet() { }, + onPageAnnotationRemoved() { }, + }); + PlacesUtils.annotations.addObserver(obs); + PlacesUtils.registerShutdownFunction(() => { + PlacesUtils.annotations.removeObserver(obs); + }); + } + return self.ids.has(aItemId); + }, + + /** * Constructs a Transaction for the drop or paste of a blob of data into * a container. * @param data @@ -857,7 +866,7 @@ this.PlacesUIUtils = { throw new Error("invalid value for aNodeOrItemId"); } - if (itemId == PlacesUtils.placesRootId || IsLivemark(itemId)) + if (itemId == PlacesUtils.placesRootId || this._isLivemark(itemId)) return true; // leftPaneFolderId, and as a result, allBookmarksFolderId, is a lazy getter diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 0d66fbcaf..ebdab60f4 100644 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -253,7 +253,8 @@ PlacesController.prototype = { } else host = NetUtil.newURI(this._view.selectedNode.uri).host; - ForgetAboutSite.removeDataFromDomain(host); + ForgetAboutSite.removeDataFromDomain(host) + .catch(Components.utils.reportError); break; case "cmd_selectAll": this.selectAll(); diff --git a/browser/components/places/content/editBookmarkOverlay.js b/browser/components/places/content/editBookmarkOverlay.js index e26cfb138..d59f5c764 100644 --- a/browser/components/places/content/editBookmarkOverlay.js +++ b/browser/components/places/content/editBookmarkOverlay.js @@ -57,12 +57,14 @@ var gEditItemOverlay = { } } let focusedElement = aInitInfo.focusedElement; + let onPanelReady = aInitInfo.onPanelReady; return this._paneInfo = { itemId, itemGuid, isItem, isURI, uri, title, isBookmark, isFolderShortcut, isParentReadOnly, bulkTagging, uris, - visibleRows, postData, isTag, focusedElement }; + visibleRows, postData, isTag, focusedElement, + onPanelReady }; }, get initialized() { @@ -214,7 +216,8 @@ var gEditItemOverlay = { let { itemId, isItem, isURI, isBookmark, bulkTagging, uris, - visibleRows, focusedElement } = this._setPaneInfo(aInfo); + visibleRows, focusedElement, + onPanelReady } = this._setPaneInfo(aInfo); let showOrCollapse = (rowId, isAppropriateForInput, nameInHiddenRows = null) => { @@ -286,22 +289,34 @@ var gEditItemOverlay = { this._observersAdded = true; } - // The focusedElement possible values are: - // * preferred: focus the field that the user touched first the last - // time the pane was shown (either namePicker or tagsField) - // * first: focus the first non collapsed textbox - // Note: since all controls are collapsed by default, we don't get the - // default XUL dialog behavior, that selects the first control, so we set - // the focus explicitly. - let elt; - if (focusedElement === "preferred") { - elt = this._element(gPrefService.getCharPref("browser.bookmarks.editDialog.firstEditField")); - } else if (focusedElement === "first") { - elt = document.querySelector("textbox:not([collapsed=true])"); - } - if (elt) { - elt.focus(); - elt.select(); + let focusElement = () => { + // The focusedElement possible values are: + // * preferred: focus the field that the user touched first the last + // time the pane was shown (either namePicker or tagsField) + // * first: focus the first non collapsed textbox + // Note: since all controls are collapsed by default, we don't get the + // default XUL dialog behavior, that selects the first control, so we set + // the focus explicitly. + // Note: If focusedElement === "preferred", this file expects gPrefService + // to be defined in the global scope. + let elt; + if (focusedElement === "preferred") { + /* eslint-disable no-undef */ + elt = this._element(gPrefService.getCharPref("browser.bookmarks.editDialog.firstEditField")); + /* eslint-enable no-undef */ + } else if (focusedElement === "first") { + elt = document.querySelector("textbox:not([collapsed=true])"); + } + if (elt) { + elt.focus(); + elt.select(); + } + }; + + if (onPanelReady) { + onPanelReady(focusElement); + } else { + focusElement(); } }, @@ -335,10 +350,23 @@ var gEditItemOverlay = { if (aElement.value != aValue) { aElement.value = aValue; - // Clear the undo stack - let editor = aElement.editor; - if (editor) - editor.transactionManager.clear(); + // Clear the editor's undo stack + let transactionManager; + try { + transactionManager = aElement.editor.transactionManager; + } catch (e) { + // When retrieving the transaction manager, editor may be null resulting + // in a TypeError. Additionally, the transaction manager may not + // exist yet, which causes access to it to throw NS_ERROR_FAILURE. + // In either event, the transaction manager doesn't exist it, so we + // don't need to worry about clearing it. + if (!(e instanceof TypeError) && e.result != Cr.NS_ERROR_FAILURE) { + throw e; + } + } + if (transactionManager) { + transactionManager.clear(); + } } }, diff --git a/browser/components/places/content/treeView.js b/browser/components/places/content/treeView.js index 5baf3a21f..181bb5404 100644 --- a/browser/components/places/content/treeView.js +++ b/browser/components/places/content/treeView.js @@ -170,7 +170,9 @@ PlacesTreeView.prototype = { let row = -1; let useNodeIndex = typeof(aNodeIndex) == "number"; if (parent == this._rootNode) { - row = useNodeIndex ? aNodeIndex : this._rootNode.getChildIndex(aNode); + if (aNode instanceof Ci.nsINavHistoryResultNode) { + row = useNodeIndex ? aNodeIndex : this._rootNode.getChildIndex(aNode); + } } else if (useNodeIndex && typeof(aParentRow) == "number") { // If we have both the row of the parent node, and the node's index, we diff --git a/browser/components/preferences/in-content/advanced.js b/browser/components/preferences/in-content/advanced.js index 448a21dae..5f9458eee 100644 --- a/browser/components/preferences/in-content/advanced.js +++ b/browser/components/preferences/in-content/advanced.js @@ -40,9 +40,6 @@ var gAdvancedPane = { this.updateReadPrefs(); } this.updateOfflineApps(); - if (AppConstants.MOZ_CRASHREPORTER) { - this.initSubmitCrashes(); - } this.initTelemetry(); if (AppConstants.MOZ_TELEMETRY_REPORTING) { this.initSubmitHealthReport(); diff --git a/browser/components/preferences/in-content/advanced.xul b/browser/components/preferences/in-content/advanced.xul index facaaeaa9..4973f8e09 100644 --- a/browser/components/preferences/in-content/advanced.xul +++ b/browser/components/preferences/in-content/advanced.xul @@ -54,13 +54,6 @@ type="bool"/> #endif - <!-- Data Choices tab --> -#ifdef MOZ_CRASHREPORTER - <preference id="browser.crashReports.unsubmittedCheck.autoSubmit2" - name="browser.crashReports.unsubmittedCheck.autoSubmit2" - type="bool"/> -#endif - <!-- Network tab --> <preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" @@ -233,22 +226,6 @@ </vbox> </groupbox> #endif -#ifdef MOZ_CRASHREPORTER - <groupbox> - <caption> - <checkbox id="automaticallySubmitCrashesBox" - preference="browser.crashReports.unsubmittedCheck.autoSubmit2" - label="&alwaysSubmitCrashReports.label;" - accesskey="&alwaysSubmitCrashReports.accesskey;"/> - </caption> - <hbox class="indent"> - <label flex="1">&crashReporterDesc2.label;</label> - <spacer flex="10"/> - <label id="crashReporterLearnMore" - class="text-link">&crashReporterLearnMore.label;</label> - </hbox> - </groupbox> -#endif </tabpanel> #endif diff --git a/browser/components/preferences/in-content/security.js b/browser/components/preferences/in-content/security.js index a8ad28c7e..0d7af39a3 100644 --- a/browser/components/preferences/in-content/security.js +++ b/browser/components/preferences/in-content/security.js @@ -168,12 +168,24 @@ var gSecurityPane = { let safeBrowsingPhishingPref = document.getElementById("browser.safebrowsing.phishing.enabled"); let safeBrowsingMalwarePref = document.getElementById("browser.safebrowsing.malware.enabled"); + let safeBrowsingUIPref = document.getElementById("browser.safebrowsing.UI.enabled"); + let safeBrowsingUISep = document.getElementById("safeBrowsingUISep"); + let safeBrowsingUIGroup = document.getElementById("safeBrowsingUIGroup"); + let blockDownloadsPref = document.getElementById("browser.safebrowsing.downloads.enabled"); let malwareTable = document.getElementById("urlclassifier.malwareTable"); let blockUnwantedPref = document.getElementById("browser.safebrowsing.downloads.remote.block_potentially_unwanted"); let blockUncommonPref = document.getElementById("browser.safebrowsing.downloads.remote.block_uncommon"); + if (safeBrowsingUIPref.value == false) { + safeBrowsingUISep.setAttribute("hidden", "true"); + safeBrowsingUIGroup.setAttribute("hidden", "true"); + } else { + safeBrowsingUISep.removeAttribute("hidden"); + safeBrowsingUIGroup.removeAttribute("hidden"); + } + enableSafeBrowsing.addEventListener("command", function() { safeBrowsingPhishingPref.value = enableSafeBrowsing.checked; safeBrowsingMalwarePref.value = enableSafeBrowsing.checked; diff --git a/browser/components/preferences/in-content/security.xul b/browser/components/preferences/in-content/security.xul index b7bdb9361..5dc8ad5e9 100644 --- a/browser/components/preferences/in-content/security.xul +++ b/browser/components/preferences/in-content/security.xul @@ -28,6 +28,10 @@ name="browser.safebrowsing.phishing.enabled" type="bool"/> + <preference id="browser.safebrowsing.UI.enabled" + name="browser.safebrowsing.UI.enabled" + type="bool"/> + <preference id="browser.safebrowsing.downloads.enabled" name="browser.safebrowsing.downloads.enabled" type="bool"/> @@ -73,8 +77,8 @@ accesskey="&addonExceptions.accesskey;"/> </hbox> - <separator class="thin"/> - <vbox align="start"> + <separator id="safeBrowsingUISep" class="thin"/> + <vbox id="safeBrowsingUIGroup" align="start"> <checkbox id="enableSafeBrowsing" label="&enableSafeBrowsing.label;" accesskey="&enableSafeBrowsing.accesskey;" /> diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js index cc8d2da0b..8a9410aa8 100644 --- a/browser/components/sessionstore/content/aboutSessionRestore.js +++ b/browser/components/sessionstore/content/aboutSessionRestore.js @@ -41,7 +41,11 @@ window.onload = function() { return; } - gStateObject = JSON.parse(sessionData.value); + try { + gStateObject = JSON.parse(sessionData.value); + } catch (e) { + Cu.reportError(e); + } // make sure the data is tracked to be restored in case of a subsequent crash var event = document.createEvent("UIEvents"); @@ -68,30 +72,32 @@ function initTreeView() { var winLabel = tabList.getAttribute("_window_label"); gTreeData = []; - gStateObject.windows.forEach(function(aWinData, aIx) { - var winState = { - label: winLabel.replace("%S", (aIx + 1)), - open: true, - checked: true, - ix: aIx - }; - winState.tabs = aWinData.tabs.map(function(aTabData) { - var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; - var iconURL = aTabData.image || null; - // don't initiate a connection just to fetch a favicon (see bug 462863) - if (/^https?:/.test(iconURL)) - iconURL = "moz-anno:favicon:" + iconURL; - return { - label: entry.title || entry.url, + if (gStateObject) { + gStateObject.windows.forEach(function(aWinData, aIx) { + var winState = { + label: winLabel.replace("%S", (aIx + 1)), + open: true, checked: true, - src: iconURL, - parent: winState + ix: aIx }; - }); - gTreeData.push(winState); - for (let tab of winState.tabs) - gTreeData.push(tab); - }, this); + winState.tabs = aWinData.tabs.map(function(aTabData) { + var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; + var iconURL = aTabData.image || null; + // don't initiate a connection just to fetch a favicon (see bug 462863) + if (/^https?:/.test(iconURL)) + iconURL = "moz-anno:favicon:" + iconURL; + return { + label: entry.title || entry.url, + checked: true, + src: iconURL, + parent: winState + }; + }); + gTreeData.push(winState); + for (let tab of winState.tabs) + gTreeData.push(tab); + }, this); + } tabList.view = treeView; tabList.view.selection.select(0); diff --git a/browser/components/webextensions/ext-commands.js b/browser/components/webextensions/ext-commands.js index 416544e86..b6e7ab3d1 100644 --- a/browser/components/webextensions/ext-commands.js +++ b/browser/components/webextensions/ext-commands.js @@ -74,15 +74,14 @@ CommandList.prototype = { // For Windows, chrome.runtime expects 'win' while chrome.commands // expects 'windows'. We can special case this for now. let os = PlatformInfo.os == "win" ? "windows" : PlatformInfo.os; - for (let name of Object.keys(manifest.commands)) { - let command = manifest.commands[name]; - let shortcut = command.suggested_key[os] || command.suggested_key.default; - if (shortcut) { - commands.set(name, { - description: command.description, - shortcut: shortcut.replace(/\s+/g, ""), - }); - } + for (let [name, command] of Object.entries(manifest.commands)) { + let suggested_key = command.suggested_key || {}; + let shortcut = suggested_key[os] || suggested_key.default; + shortcut = shortcut ? shortcut.replace(/\s+/g, "") : null; + commands.set(name, { + description: command.description, + shortcut, + }); } return commands; }, @@ -96,8 +95,10 @@ CommandList.prototype = { let keyset = doc.createElementNS(XUL_NS, "keyset"); keyset.id = `ext-keyset-id-${this.id}`; this.commands.forEach((command, name) => { - let keyElement = this.buildKey(doc, name, command.shortcut); - keyset.appendChild(keyElement); + if (command.shortcut) { + let keyElement = this.buildKey(doc, name, command.shortcut); + keyset.appendChild(keyElement); + } }); doc.documentElement.appendChild(keyset); this.keysetsMap.set(window, keyset); @@ -162,11 +163,12 @@ CommandList.prototype = { // The modifiers are the remaining elements. keyElement.setAttribute("modifiers", this.getModifiersAttribute(parts)); - if (/^[A-Z0-9]$/.test(chromeKey)) { + if (/^[A-Z]$/.test(chromeKey)) { // We use the key attribute for all single digits and characters. keyElement.setAttribute("key", chromeKey); } else { keyElement.setAttribute("keycode", this.getKeycodeAttribute(chromeKey)); + keyElement.setAttribute("event", "keydown"); } return keyElement; @@ -186,6 +188,9 @@ CommandList.prototype = { * @returns {string} The constructed value for the Key's 'keycode' attribute. */ getKeycodeAttribute(chromeKey) { + if (/[0-9]/.test(chromeKey)) { + return `VK_${chromeKey}`; + } return `VK${chromeKey.replace(/([A-Z])/g, "_$&").toUpperCase()}`; }, diff --git a/browser/confvars.sh b/browser/confvars.sh index 503e940b3..41c0be3d7 100755 --- a/browser/confvars.sh +++ b/browser/confvars.sh @@ -53,11 +53,12 @@ MOZ_PROFILE_MIGRATOR=1 MOZ_APP_STATIC_INI=1 MOZ_WEBGL_CONFORMANT=1 MOZ_JSDOWNLOADS=1 -MOZ_RUST_MP4PARSE=1 -MOZ_RUST_URLPARSE=1 MOZ_WEBRTC=1 MOZ_WEBEXTENSIONS=1 MOZ_DEVTOOLS=1 +MOZ_SERVICES_COMMON=1 +MOZ_SERVICES_SYNC=1 +MOZ_SERVICES_HEALTHREPORT= # Disable checking that add-ons are signed by the trusted root MOZ_ADDON_SIGNING=0 diff --git a/browser/experiments/.eslintrc.js b/browser/experiments/.eslintrc.js deleted file mode 100644 index 1f6b11d67..000000000 --- a/browser/experiments/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -module.exports = { - "rules": { - "no-unused-vars": ["error", { - "vars": "all", - "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", - "args": "none" - }] - } -}; diff --git a/browser/experiments/Experiments.jsm b/browser/experiments/Experiments.jsm deleted file mode 100644 index e9a63f19f..000000000 --- a/browser/experiments/Experiments.jsm +++ /dev/null @@ -1,2354 +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/. */ - -"use strict"; - -this.EXPORTED_SYMBOLS = [ - "Experiments", -]; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource://gre/modules/osfile.jsm"); -Cu.import("resource://gre/modules/Log.jsm"); -Cu.import("resource://gre/modules/Preferences.jsm"); -Cu.import("resource://gre/modules/AsyncShutdown.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", - "resource://gre/modules/UpdateUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", - "resource://gre/modules/AddonManager.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate", - "resource://gre/modules/AddonManager.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment", - "resource://gre/modules/TelemetryEnvironment.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog", - "resource://gre/modules/TelemetryLog.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryUtils", - "resource://gre/modules/TelemetryUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils", - "resource://services-common/utils.js"); - -XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter", - "@mozilla.org/xre/app-info;1", - "nsICrashReporter"); - -const FILE_CACHE = "experiments.json"; -const EXPERIMENTS_CHANGED_TOPIC = "experiments-changed"; -const MANIFEST_VERSION = 1; -const CACHE_VERSION = 1; - -const KEEP_HISTORY_N_DAYS = 180; - -const PREF_BRANCH = "experiments."; -const PREF_ENABLED = "enabled"; // experiments.enabled -const PREF_ACTIVE_EXPERIMENT = "activeExperiment"; // whether we have an active experiment -const PREF_LOGGING = "logging"; -const PREF_LOGGING_LEVEL = PREF_LOGGING + ".level"; // experiments.logging.level -const PREF_LOGGING_DUMP = PREF_LOGGING + ".dump"; // experiments.logging.dump -const PREF_MANIFEST_URI = "manifest.uri"; // experiments.logging.manifest.uri -const PREF_FORCE_SAMPLE = "force-sample-value"; // experiments.force-sample-value - -const PREF_BRANCH_TELEMETRY = "toolkit.telemetry."; -const PREF_TELEMETRY_ENABLED = "enabled"; - -const URI_EXTENSION_STRINGS = "chrome://mozapps/locale/extensions/extensions.properties"; -const STRING_TYPE_NAME = "type.%ID%.name"; - -const CACHE_WRITE_RETRY_DELAY_SEC = 60 * 3; -const MANIFEST_FETCH_TIMEOUT_MSEC = 60 * 3 * 1000; // 3 minutes - -const TELEMETRY_LOG = { - // log(key, [kind, experimentId, details]) - ACTIVATION_KEY: "EXPERIMENT_ACTIVATION", - ACTIVATION: { - // Successfully activated. - ACTIVATED: "ACTIVATED", - // Failed to install the add-on. - INSTALL_FAILURE: "INSTALL_FAILURE", - // Experiment does not meet activation requirements. Details will - // be provided. - REJECTED: "REJECTED", - }, - - // log(key, [kind, experimentId, optionalDetails...]) - TERMINATION_KEY: "EXPERIMENT_TERMINATION", - TERMINATION: { - // The Experiments service was disabled. - SERVICE_DISABLED: "SERVICE_DISABLED", - // Add-on uninstalled. - ADDON_UNINSTALLED: "ADDON_UNINSTALLED", - // The experiment disabled itself. - FROM_API: "FROM_API", - // The experiment expired (e.g. by exceeding the end date). - EXPIRED: "EXPIRED", - // Disabled after re-evaluating conditions. If this is specified, - // details will be provided. - RECHECK: "RECHECK", - }, -}; -XPCOMUtils.defineConstant(this, "TELEMETRY_LOG", TELEMETRY_LOG); - -const gPrefs = new Preferences(PREF_BRANCH); -const gPrefsTelemetry = new Preferences(PREF_BRANCH_TELEMETRY); -var gExperimentsEnabled = false; -var gAddonProvider = null; -var gExperiments = null; -var gLogAppenderDump = null; -var gPolicyCounter = 0; -var gExperimentsCounter = 0; -var gExperimentEntryCounter = 0; -var gPreviousProviderCounter = 0; - -// Tracks active AddonInstall we know about so we can deny external -// installs. -var gActiveInstallURLs = new Set(); - -// Tracks add-on IDs that are being uninstalled by us. This allows us -// to differentiate between expected uninstalled and user-driven uninstalls. -var gActiveUninstallAddonIDs = new Set(); - -var gLogger; -var gLogDumping = false; - -function configureLogging() { - if (!gLogger) { - gLogger = Log.repository.getLogger("Browser.Experiments"); - gLogger.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter())); - } - gLogger.level = gPrefs.get(PREF_LOGGING_LEVEL, Log.Level.Warn); - - let logDumping = gPrefs.get(PREF_LOGGING_DUMP, false); - if (logDumping != gLogDumping) { - if (logDumping) { - gLogAppenderDump = new Log.DumpAppender(new Log.BasicFormatter()); - gLogger.addAppender(gLogAppenderDump); - } else { - gLogger.removeAppender(gLogAppenderDump); - gLogAppenderDump = null; - } - gLogDumping = logDumping; - } -} - -// Loads a JSON file using OS.file. file is a string representing the path -// of the file to be read, options contains additional options to pass to -// OS.File.read. -// Returns a Promise resolved with the json payload or rejected with -// OS.File.Error or JSON.parse() errors. -function loadJSONAsync(file, options) { - return Task.spawn(function*() { - let rawData = yield OS.File.read(file, options); - // Read json file into a string - let data; - try { - // Obtain a converter to read from a UTF-8 encoded input stream. - let converter = new TextDecoder(); - data = JSON.parse(converter.decode(rawData)); - } catch (ex) { - gLogger.error("Experiments: Could not parse JSON: " + file + " " + ex); - throw ex; - } - return data; - }); -} - -// Returns a promise that is resolved with the AddonInstall for that URL. -function addonInstallForURL(url, hash) { - let deferred = Promise.defer(); - AddonManager.getInstallForURL(url, install => deferred.resolve(install), - "application/x-xpinstall", hash); - return deferred.promise; -} - -// Returns a promise that is resolved with an Array<Addon> of the installed -// experiment addons. -function installedExperimentAddons() { - let deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons.filter(a => !a.appDisabled)); - }); - return deferred.promise; -} - -// Takes an Array<Addon> and returns a promise that is resolved when the -// addons are uninstalled. -function uninstallAddons(addons) { - let ids = new Set(addons.map(addon => addon.id)); - let deferred = Promise.defer(); - - let listener = {}; - listener.onUninstalled = addon => { - if (!ids.has(addon.id)) { - return; - } - - ids.delete(addon.id); - if (ids.size == 0) { - AddonManager.removeAddonListener(listener); - deferred.resolve(); - } - }; - - AddonManager.addAddonListener(listener); - - for (let addon of addons) { - // Disabling the add-on before uninstalling is necessary to cause tests to - // pass. This might be indicative of a bug in XPIProvider. - // TODO follow up in bug 992396. - addon.userDisabled = true; - addon.uninstall(); - } - - return deferred.promise; -} - -/** - * The experiments module. - */ - -var Experiments = { - /** - * Provides access to the global `Experiments.Experiments` instance. - */ - instance: function () { - if (!gExperiments) { - gExperiments = new Experiments.Experiments(); - } - - return gExperiments; - }, -}; - -/* - * The policy object allows us to inject fake enviroment data from the - * outside by monkey-patching. - */ - -Experiments.Policy = function () { - this._log = Log.repository.getLoggerWithMessagePrefix( - "Browser.Experiments.Policy", - "Policy #" + gPolicyCounter++ + "::"); - - // Set to true to ignore hash verification on downloaded XPIs. This should - // not be used outside of testing. - this.ignoreHashes = false; -}; - -Experiments.Policy.prototype = { - now: function () { - return new Date(); - }, - - random: function () { - let pref = gPrefs.get(PREF_FORCE_SAMPLE); - if (pref !== undefined) { - let val = Number.parseFloat(pref); - this._log.debug("random sample forced: " + val); - if (isNaN(val) || val < 0) { - return 0; - } - if (val > 1) { - return 1; - } - return val; - } - return Math.random(); - }, - - futureDate: function (offset) { - return new Date(this.now().getTime() + offset); - }, - - oneshotTimer: function (callback, timeout, thisObj, name) { - return CommonUtils.namedTimer(callback, timeout, thisObj, name); - }, - - updatechannel: function () { - return UpdateUtils.UpdateChannel; - }, - - locale: function () { - let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry); - return chrome.getSelectedLocale("global"); - }, - - /** - * For testing a race condition, one of the tests delays the callback of - * writing the cache by replacing this policy function. - */ - delayCacheWrite: function(promise) { - return promise; - }, -}; - -function AlreadyShutdownError(message="already shut down") { - Error.call(this, message); - let error = new Error(); - this.name = "AlreadyShutdownError"; - this.message = message; - this.stack = error.stack; -} -AlreadyShutdownError.prototype = Object.create(Error.prototype); -AlreadyShutdownError.prototype.constructor = AlreadyShutdownError; - -function CacheWriteError(message="Error writing cache file") { - Error.call(this, message); - let error = new Error(); - this.name = "CacheWriteError"; - this.message = message; - this.stack = error.stack; -} -CacheWriteError.prototype = Object.create(Error.prototype); -CacheWriteError.prototype.constructor = CacheWriteError; - -/** - * Manages the experiments and provides an interface to control them. - */ - -Experiments.Experiments = function (policy=new Experiments.Policy()) { - let log = Log.repository.getLoggerWithMessagePrefix( - "Browser.Experiments.Experiments", - "Experiments #" + gExperimentsCounter++ + "::"); - - // At the time of this writing, Experiments.jsm has severe - // crashes. For forensics purposes, keep the last few log - // messages in memory and upload them in case of crash. - this._forensicsLogs = []; - this._forensicsLogs.length = 30; - this._log = Object.create(log); - this._log.log = (level, string, params) => { - this._addToForensicsLog("Experiments", string); - log.log(level, string, params); - }; - - this._log.trace("constructor"); - - // Capture the latest error, for forensics purposes. - this._latestError = null; - - - this._policy = policy; - - // This is a Map of (string -> ExperimentEntry), keyed with the experiment id. - // It holds both the current experiments and history. - // Map() preserves insertion order, which means we preserve the manifest order. - // This is null until we've successfully completed loading the cache from - // disk the first time. - this._experiments = null; - this._refresh = false; - this._terminateReason = null; // or TELEMETRY_LOG.TERMINATION.... - this._dirty = false; - - // Loading the cache happens once asynchronously on startup - this._loadTask = null; - - // The _main task handles all other actions: - // * refreshing the manifest off the network (if _refresh) - // * disabling/enabling experiments - // * saving the cache (if _dirty) - this._mainTask = null; - - // Timer for re-evaluating experiment status. - this._timer = null; - - this._shutdown = false; - this._networkRequest = null; - - // We need to tell when we first evaluated the experiments to fire an - // experiments-changed notification when we only loaded completed experiments. - this._firstEvaluate = true; - - this.init(); -}; - -Experiments.Experiments.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback, Ci.nsIObserver]), - - /** - * `true` if the experiments manager is currently setup (has been fully initialized - * and not uninitialized yet). - */ - get isReady() { - return !this._shutdown; - }, - - init: function () { - this._shutdown = false; - configureLogging(); - - gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false) && TelemetryUtils.isTelemetryEnabled; - this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled); - - gPrefs.observe(PREF_LOGGING, configureLogging); - gPrefs.observe(PREF_MANIFEST_URI, this.updateManifest, this); - gPrefs.observe(PREF_ENABLED, this._toggleExperimentsEnabled, this); - - gPrefsTelemetry.observe(PREF_TELEMETRY_ENABLED, this._telemetryStatusChanged, this); - - AddonManager.shutdown.addBlocker("Experiments.jsm shutdown", - this.uninit.bind(this), - this._getState.bind(this) - ); - - this._registerWithAddonManager(); - - this._loadTask = this._loadFromCache(); - - return this._loadTask.then( - () => { - this._log.trace("_loadTask finished ok"); - this._loadTask = null; - return this._run(); - }, - (e) => { - this._log.error("_loadFromCache caught error: " + e); - this._latestError = e; - throw e; - } - ); - }, - - /** - * Uninitialize this instance. - * - * This function is susceptible to race conditions. If it is called multiple - * times before the previous uninit() has completed or if it is called while - * an init() operation is being performed, the object may get in bad state - * and/or deadlock could occur. - * - * @return Promise<> - * The promise is fulfilled when all pending tasks are finished. - */ - uninit: Task.async(function* () { - this._log.trace("uninit: started"); - yield this._loadTask; - this._log.trace("uninit: finished with _loadTask"); - - if (!this._shutdown) { - this._log.trace("uninit: no previous shutdown"); - this._unregisterWithAddonManager(); - - gPrefs.ignore(PREF_LOGGING, configureLogging); - gPrefs.ignore(PREF_MANIFEST_URI, this.updateManifest, this); - gPrefs.ignore(PREF_ENABLED, this._toggleExperimentsEnabled, this); - - gPrefsTelemetry.ignore(PREF_TELEMETRY_ENABLED, this._telemetryStatusChanged, this); - - if (this._timer) { - this._timer.clear(); - } - } - - this._shutdown = true; - if (this._mainTask) { - if (this._networkRequest) { - try { - this._log.trace("Aborting pending network request: " + this._networkRequest); - this._networkRequest.abort(); - } catch (e) { - // pass - } - } - try { - this._log.trace("uninit: waiting on _mainTask"); - yield this._mainTask; - } catch (e) { - // We error out of tasks after shutdown via this exception. - this._log.trace(`uninit: caught error - ${e}`); - if (!(e instanceof AlreadyShutdownError)) { - this._latestError = e; - throw e; - } - } - } - - this._log.info("Completed uninitialization."); - }), - - // Return state information, for debugging purposes. - _getState: function() { - let activeExperiment = this._getActiveExperiment(); - let state = { - isShutdown: this._shutdown, - isEnabled: gExperimentsEnabled, - isRefresh: this._refresh, - isDirty: this._dirty, - isFirstEvaluate: this._firstEvaluate, - hasLoadTask: !!this._loadTask, - hasMainTask: !!this._mainTask, - hasTimer: !!this._hasTimer, - hasAddonProvider: !!gAddonProvider, - latestLogs: this._forensicsLogs, - experiments: this._experiments ? [...this._experiments.keys()] : null, - terminateReason: this._terminateReason, - activeExperiment: activeExperiment ? activeExperiment.id : null, - }; - if (this._latestError) { - if (typeof this._latestError == "object") { - state.latestError = { - message: this._latestError.message, - stack: this._latestError.stack - }; - } else { - state.latestError = "" + this._latestError; - } - } - return state; - }, - - _addToForensicsLog: function (what, string) { - this._forensicsLogs.shift(); - let timeInSec = Math.floor(Services.telemetry.msSinceProcessStart() / 1000); - this._forensicsLogs.push(`${timeInSec}: ${what} - ${string}`); - }, - - _registerWithAddonManager: function (previousExperimentsProvider) { - this._log.trace("Registering instance with Addon Manager."); - - AddonManager.addAddonListener(this); - AddonManager.addInstallListener(this); - - if (!gAddonProvider) { - // The properties of this AddonType should be kept in sync with the - // experiment AddonType registered in XPIProvider. - this._log.trace("Registering previous experiment add-on provider."); - gAddonProvider = previousExperimentsProvider || new Experiments.PreviousExperimentProvider(this); - AddonManagerPrivate.registerProvider(gAddonProvider, [ - new AddonManagerPrivate.AddonType("experiment", - URI_EXTENSION_STRINGS, - STRING_TYPE_NAME, - AddonManager.VIEW_TYPE_LIST, - 11000, - AddonManager.TYPE_UI_HIDE_EMPTY), - ]); - } - - }, - - _unregisterWithAddonManager: function () { - this._log.trace("Unregistering instance with Addon Manager."); - - this._log.trace("Removing install listener from add-on manager."); - AddonManager.removeInstallListener(this); - this._log.trace("Removing addon listener from add-on manager."); - AddonManager.removeAddonListener(this); - this._log.trace("Finished unregistering with addon manager."); - - if (gAddonProvider) { - this._log.trace("Unregistering previous experiment add-on provider."); - AddonManagerPrivate.unregisterProvider(gAddonProvider); - gAddonProvider = null; - } - }, - - /* - * Change the PreviousExperimentsProvider that this instance uses. - * For testing only. - */ - _setPreviousExperimentsProvider: function (provider) { - this._unregisterWithAddonManager(); - this._registerWithAddonManager(provider); - }, - - /** - * Throws an exception if we've already shut down. - */ - _checkForShutdown: function() { - if (this._shutdown) { - throw new AlreadyShutdownError("uninit() already called"); - } - }, - - /** - * Whether the experiments feature is enabled. - */ - get enabled() { - return gExperimentsEnabled; - }, - - /** - * Toggle whether the experiments feature is enabled or not. - */ - set enabled(enabled) { - this._log.trace("set enabled(" + enabled + ")"); - gPrefs.set(PREF_ENABLED, enabled); - }, - - _toggleExperimentsEnabled: Task.async(function* (enabled) { - this._log.trace("_toggleExperimentsEnabled(" + enabled + ")"); - let wasEnabled = gExperimentsEnabled; - gExperimentsEnabled = enabled && TelemetryUtils.isTelemetryEnabled; - - if (wasEnabled == gExperimentsEnabled) { - return; - } - - if (gExperimentsEnabled) { - yield this.updateManifest(); - } else { - yield this.disableExperiment(TELEMETRY_LOG.TERMINATION.SERVICE_DISABLED); - if (this._timer) { - this._timer.clear(); - } - } - }), - - _telemetryStatusChanged: function () { - this._toggleExperimentsEnabled(gExperimentsEnabled); - }, - - /** - * Returns a promise that is resolved with an array of `ExperimentInfo` objects, - * which provide info on the currently and recently active experiments. - * The array is in chronological order. - * - * The experiment info is of the form: - * { - * id: <string>, - * name: <string>, - * description: <string>, - * active: <boolean>, - * endDate: <integer>, // epoch ms - * detailURL: <string>, - * ... // possibly extended later - * } - * - * @return Promise<Array<ExperimentInfo>> Array of experiment info objects. - */ - getExperiments: function () { - return Task.spawn(function*() { - yield this._loadTask; - let list = []; - - for (let [id, experiment] of this._experiments) { - if (!experiment.startDate) { - // We only collect experiments that are or were active. - continue; - } - - list.push({ - id: id, - name: experiment._name, - description: experiment._description, - active: experiment.enabled, - endDate: experiment.endDate.getTime(), - detailURL: experiment._homepageURL, - branch: experiment.branch, - }); - } - - // Sort chronologically, descending. - list.sort((a, b) => b.endDate - a.endDate); - return list; - }.bind(this)); - }, - - /** - * Returns the ExperimentInfo for the active experiment, or null - * if there is none. - */ - getActiveExperiment: function () { - let experiment = this._getActiveExperiment(); - if (!experiment) { - return null; - } - - let info = { - id: experiment.id, - name: experiment._name, - description: experiment._description, - active: experiment.enabled, - endDate: experiment.endDate.getTime(), - detailURL: experiment._homepageURL, - }; - - return info; - }, - - /** - * Experiment "branch" support. If an experiment has multiple branches, it - * can record the branch with the experiment system and it will - * automatically be included in data reporting (FHR/telemetry payloads). - */ - - /** - * Set the experiment branch for the specified experiment ID. - * @returns Promise<> - */ - setExperimentBranch: Task.async(function*(id, branchstr) { - yield this._loadTask; - let e = this._experiments.get(id); - if (!e) { - throw new Error("Experiment not found"); - } - e.branch = String(branchstr); - this._log.trace("setExperimentBranch(" + id + ", " + e.branch + ") _dirty=" + this._dirty); - this._dirty = true; - Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null); - yield this._run(); - }), - /** - * Get the branch of the specified experiment. If the experiment is unknown, - * throws an error. - * - * @param id The ID of the experiment. Pass null for the currently running - * experiment. - * @returns Promise<string|null> - * @throws Error if the specified experiment ID is unknown, or if there is no - * current experiment. - */ - getExperimentBranch: Task.async(function*(id=null) { - yield this._loadTask; - let e; - if (id) { - e = this._experiments.get(id); - if (!e) { - throw new Error("Experiment not found"); - } - } else { - e = this._getActiveExperiment(); - if (e === null) { - throw new Error("No active experiment"); - } - } - return e.branch; - }), - - /** - * Determine whether another date has the same UTC day as now(). - */ - _dateIsTodayUTC: function (d) { - let now = this._policy.now(); - - return stripDateToMidnight(now).getTime() == stripDateToMidnight(d).getTime(); - }, - - /** - * Obtain the entry of the most recent active experiment that was active - * today. - * - * If no experiment was active today, this resolves to nothing. - * - * Assumption: Only a single experiment can be active at a time. - * - * @return Promise<object> - */ - lastActiveToday: function () { - return Task.spawn(function* getMostRecentActiveExperimentTask() { - let experiments = yield this.getExperiments(); - - // Assumption: Ordered chronologically, descending, with active always - // first. - for (let experiment of experiments) { - if (experiment.active) { - return experiment; - } - - if (experiment.endDate && this._dateIsTodayUTC(experiment.endDate)) { - return experiment; - } - } - return null; - }.bind(this)); - }, - - _run: function() { - this._log.trace("_run"); - this._checkForShutdown(); - if (!this._mainTask) { - this._mainTask = Task.spawn(function*() { - try { - yield this._main(); - } catch (e) { - // In the CacheWriteError case we want to reschedule - if (!(e instanceof CacheWriteError)) { - this._log.error("_main caught error: " + e); - return; - } - } finally { - this._mainTask = null; - } - this._log.trace("_main finished, scheduling next run"); - try { - yield this._scheduleNextRun(); - } catch (ex) { - // We error out of tasks after shutdown via this exception. - if (!(ex instanceof AlreadyShutdownError)) { - throw ex; - } - } - }.bind(this)); - } - return this._mainTask; - }, - - _main: function*() { - do { - this._log.trace("_main iteration"); - yield this._loadTask; - if (!gExperimentsEnabled) { - this._refresh = false; - } - - if (this._refresh) { - yield this._loadManifest(); - } - yield this._evaluateExperiments(); - if (this._dirty) { - yield this._saveToCache(); - } - // If somebody called .updateManifest() or disableExperiment() - // while we were running, go again right now. - } - while (this._refresh || this._terminateReason || this._dirty); - }, - - _loadManifest: function*() { - this._log.trace("_loadManifest"); - let uri = Services.urlFormatter.formatURLPref(PREF_BRANCH + PREF_MANIFEST_URI); - - this._checkForShutdown(); - - this._refresh = false; - try { - let responseText = yield this._httpGetRequest(uri); - this._log.trace("_loadManifest() - responseText=\"" + responseText + "\""); - - if (this._shutdown) { - return; - } - - let data = JSON.parse(responseText); - this._updateExperiments(data); - } catch (e) { - this._log.error("_loadManifest - failure to fetch/parse manifest (continuing anyway): " + e); - } - }, - - /** - * Fetch an updated list of experiments and trigger experiment updates. - * Do only use when experiments are enabled. - * - * @return Promise<> - * The promise is resolved when the manifest and experiment list is updated. - */ - updateManifest: function () { - this._log.trace("updateManifest()"); - - if (!gExperimentsEnabled) { - return Promise.reject(new Error("experiments are disabled")); - } - - if (this._shutdown) { - return Promise.reject(Error("uninit() alrady called")); - } - - this._refresh = true; - return this._run(); - }, - - notify: function (timer) { - this._log.trace("notify()"); - this._checkForShutdown(); - return this._run(); - }, - - // START OF ADD-ON LISTENERS - - onUninstalled: function (addon) { - this._log.trace("onUninstalled() - addon id: " + addon.id); - if (gActiveUninstallAddonIDs.has(addon.id)) { - this._log.trace("matches pending uninstall"); - return; - } - let activeExperiment = this._getActiveExperiment(); - if (!activeExperiment || activeExperiment._addonId != addon.id) { - return; - } - - this.disableExperiment(TELEMETRY_LOG.TERMINATION.ADDON_UNINSTALLED); - }, - - /** - * @returns {Boolean} returns false when we cancel the install. - */ - onInstallStarted: function (install) { - if (install.addon.type != "experiment") { - return true; - } - - this._log.trace("onInstallStarted() - " + install.addon.id); - if (install.addon.appDisabled) { - // This is a PreviousExperiment - return true; - } - - // We want to be in control of all experiment add-ons: reject installs - // for add-ons that we don't know about. - - // We have a race condition of sorts to worry about here. We have 2 - // onInstallStarted listeners. This one (the global one) and the one - // created as part of ExperimentEntry._installAddon. Because of the order - // they are registered in, this one likely executes first. Unfortunately, - // this means that the add-on ID is not yet set on the ExperimentEntry. - // So, we can't just look at this._trackedAddonIds because the new experiment - // will have its add-on ID set to null. We work around this by storing a - // identifying field - the source URL of the install - in a module-level - // variable (so multiple Experiments instances doesn't cancel each other - // out). - - if (this._trackedAddonIds.has(install.addon.id)) { - this._log.info("onInstallStarted allowing install because add-on ID " + - "tracked by us."); - return true; - } - - if (gActiveInstallURLs.has(install.sourceURI.spec)) { - this._log.info("onInstallStarted allowing install because install " + - "tracked by us."); - return true; - } - - this._log.warn("onInstallStarted cancelling install of unknown " + - "experiment add-on: " + install.addon.id); - return false; - }, - - // END OF ADD-ON LISTENERS. - - _getExperimentByAddonId: function (addonId) { - for (let [, entry] of this._experiments) { - if (entry._addonId === addonId) { - return entry; - } - } - - return null; - }, - - /* - * Helper function to make HTTP GET requests. Returns a promise that is resolved with - * the responseText when the request is complete. - */ - _httpGetRequest: function (url) { - this._log.trace("httpGetRequest(" + url + ")"); - let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest); - - this._networkRequest = xhr; - let deferred = Promise.defer(); - - let log = this._log; - let errorhandler = (evt) => { - log.error("httpGetRequest::onError() - Error making request to " + url + ": " + evt.type); - deferred.reject(new Error("Experiments - XHR error for " + url + " - " + evt.type)); - this._networkRequest = null; - }; - xhr.onerror = errorhandler; - xhr.ontimeout = errorhandler; - xhr.onabort = errorhandler; - - xhr.onload = (event) => { - if (xhr.status !== 200 && xhr.state !== 0) { - log.error("httpGetRequest::onLoad() - Request to " + url + " returned status " + xhr.status); - deferred.reject(new Error("Experiments - XHR status for " + url + " is " + xhr.status)); - this._networkRequest = null; - return; - } - - deferred.resolve(xhr.responseText); - this._networkRequest = null; - }; - - try { - xhr.open("GET", url); - - if (xhr.channel instanceof Ci.nsISupportsPriority) { - xhr.channel.priority = Ci.nsISupportsPriority.PRIORITY_LOWEST; - } - - xhr.timeout = MANIFEST_FETCH_TIMEOUT_MSEC; - xhr.send(null); - } catch (e) { - this._log.error("httpGetRequest() - Error opening request to " + url + ": " + e); - return Promise.reject(new Error("Experiments - Error opening XHR for " + url)); - } - return deferred.promise; - }, - - /* - * Path of the cache file we use in the profile. - */ - get _cacheFilePath() { - return OS.Path.join(OS.Constants.Path.profileDir, FILE_CACHE); - }, - - /* - * Part of the main task to save the cache to disk, called from _main. - */ - _saveToCache: function* () { - this._log.trace("_saveToCache"); - let path = this._cacheFilePath; - this._dirty = false; - try { - let textData = JSON.stringify({ - version: CACHE_VERSION, - data: [...this._experiments.values()].map(e => e.toJSON()), - }); - - let encoder = new TextEncoder(); - let data = encoder.encode(textData); - let options = { tmpPath: path + ".tmp", compression: "lz4" }; - yield this._policy.delayCacheWrite(OS.File.writeAtomic(path, data, options)); - } catch (e) { - // We failed to write the cache, it's still dirty. - this._dirty = true; - this._log.error("_saveToCache failed and caught error: " + e); - throw new CacheWriteError(); - } - - this._log.debug("_saveToCache saved to " + path); - }, - - /* - * Task function, load the cached experiments manifest file from disk. - */ - _loadFromCache: Task.async(function* () { - this._log.trace("_loadFromCache"); - let path = this._cacheFilePath; - try { - let result = yield loadJSONAsync(path, { compression: "lz4" }); - this._populateFromCache(result); - } catch (e) { - if (e instanceof OS.File.Error && e.becauseNoSuchFile) { - // No cached manifest yet. - this._experiments = new Map(); - } else { - throw e; - } - } - }), - - _populateFromCache: function (data) { - this._log.trace("populateFromCache() - data: " + JSON.stringify(data)); - - // If the user has a newer cache version than we can understand, we fail - // hard; no experiments should be active in this older client. - if (CACHE_VERSION !== data.version) { - throw new Error("Experiments::_populateFromCache() - invalid cache version"); - } - - let experiments = new Map(); - for (let item of data.data) { - let entry = new Experiments.ExperimentEntry(this._policy); - if (!entry.initFromCacheData(item)) { - continue; - } - - // Discard old experiments if they ended more than 180 days ago. - if (entry.shouldDiscard()) { - // We discarded an experiment, the cache needs to be updated. - this._dirty = true; - continue; - } - - experiments.set(entry.id, entry); - } - - this._experiments = experiments; - }, - - /* - * Update the experiment entries from the experiments - * array in the manifest - */ - _updateExperiments: function (manifestObject) { - this._log.trace("_updateExperiments() - experiments: " + JSON.stringify(manifestObject)); - - if (manifestObject.version !== MANIFEST_VERSION) { - this._log.warning("updateExperiments() - unsupported version " + manifestObject.version); - } - - let experiments = new Map(); // The new experiments map - - // Collect new and updated experiments. - for (let data of manifestObject.experiments) { - let entry = this._experiments.get(data.id); - - if (entry) { - if (!entry.updateFromManifestData(data)) { - this._log.error("updateExperiments() - Invalid manifest data for " + data.id); - continue; - } - } else { - entry = new Experiments.ExperimentEntry(this._policy); - if (!entry.initFromManifestData(data)) { - continue; - } - } - - if (entry.shouldDiscard()) { - continue; - } - - experiments.set(entry.id, entry); - } - - // Make sure we keep experiments that are or were running. - // We remove them after KEEP_HISTORY_N_DAYS. - for (let [id, entry] of this._experiments) { - if (experiments.has(id)) { - continue; - } - - if (!entry.startDate || entry.shouldDiscard()) { - this._log.trace("updateExperiments() - discarding entry for " + id); - continue; - } - - experiments.set(id, entry); - } - - this._experiments = experiments; - this._dirty = true; - }, - - getActiveExperimentID: function() { - if (!this._experiments) { - return null; - } - let e = this._getActiveExperiment(); - if (!e) { - return null; - } - return e.id; - }, - - getActiveExperimentBranch: function() { - if (!this._experiments) { - return null; - } - let e = this._getActiveExperiment(); - if (!e) { - return null; - } - return e.branch; - }, - - _getActiveExperiment: function () { - let enabled = [...this._experiments.values()].filter(experiment => experiment._enabled); - - if (enabled.length == 1) { - return enabled[0]; - } - - if (enabled.length > 1) { - this._log.error("getActiveExperimentId() - should not have more than 1 active experiment"); - throw new Error("have more than 1 active experiment"); - } - - return null; - }, - - /** - * Disables all active experiments. - * - * @return Promise<> Promise that will get resolved once the task is done or failed. - */ - disableExperiment: function (reason) { - if (!reason) { - throw new Error("Must specify a termination reason."); - } - - this._log.trace("disableExperiment()"); - this._terminateReason = reason; - return this._run(); - }, - - /** - * The Set of add-on IDs that we know about from manifests. - */ - get _trackedAddonIds() { - if (!this._experiments) { - return new Set(); - } - - return new Set([...this._experiments.values()].map(e => e._addonId)); - }, - - /* - * Task function to check applicability of experiments, disable the active - * experiment if needed and activate the first applicable candidate. - */ - _evaluateExperiments: function*() { - this._log.trace("_evaluateExperiments"); - - this._checkForShutdown(); - - // The first thing we do is reconcile our state against what's in the - // Addon Manager. It's possible that the Addon Manager knows of experiment - // add-ons that we don't. This could happen if an experiment gets installed - // when we're not listening or if there is a bug in our synchronization - // code. - // - // We have a few options of what to do with unknown experiment add-ons - // coming from the Addon Manager. Ideally, we'd convert these to - // ExperimentEntry instances and stuff them inside this._experiments. - // However, since ExperimentEntry contain lots of metadata from the - // manifest and trying to make up data could be error prone, it's safer - // to not try. Furthermore, if an experiment really did come from us, we - // should have some record of it. In the end, we decide to discard all - // knowledge for these unknown experiment add-ons. - let installedExperiments = yield installedExperimentAddons(); - let expectedAddonIds = this._trackedAddonIds; - let unknownAddons = installedExperiments.filter(a => !expectedAddonIds.has(a.id)); - if (unknownAddons.length) { - this._log.warn("_evaluateExperiments() - unknown add-ons in AddonManager: " + - unknownAddons.map(a => a.id).join(", ")); - - yield uninstallAddons(unknownAddons); - } - - let activeExperiment = this._getActiveExperiment(); - let activeChanged = false; - - if (!activeExperiment) { - // Avoid this pref staying out of sync if there were e.g. crashes. - gPrefs.set(PREF_ACTIVE_EXPERIMENT, false); - } - - // Ensure the active experiment is in the proper state. This may install, - // uninstall, upgrade, or enable the experiment add-on. What exactly is - // abstracted away from us by design. - if (activeExperiment) { - let changes; - let shouldStopResult = yield activeExperiment.shouldStop(); - if (shouldStopResult.shouldStop) { - let expireReasons = ["endTime", "maxActiveSeconds"]; - let kind, reason; - - if (expireReasons.indexOf(shouldStopResult.reason[0]) != -1) { - kind = TELEMETRY_LOG.TERMINATION.EXPIRED; - reason = null; - } else { - kind = TELEMETRY_LOG.TERMINATION.RECHECK; - reason = shouldStopResult.reason; - } - changes = yield activeExperiment.stop(kind, reason); - } - else if (this._terminateReason) { - changes = yield activeExperiment.stop(this._terminateReason); - } - else { - changes = yield activeExperiment.reconcileAddonState(); - } - - if (changes) { - this._dirty = true; - activeChanged = true; - } - - if (!activeExperiment._enabled) { - activeExperiment = null; - activeChanged = true; - } - } - - this._terminateReason = null; - - if (!activeExperiment && gExperimentsEnabled) { - for (let [id, experiment] of this._experiments) { - let applicable; - let reason = null; - try { - applicable = yield experiment.isApplicable(); - } - catch (e) { - applicable = false; - reason = e; - } - - if (!applicable && reason && reason[0] != "was-active") { - // Report this from here to avoid over-reporting. - let data = [TELEMETRY_LOG.ACTIVATION.REJECTED, id]; - data = data.concat(reason); - const key = TELEMETRY_LOG.ACTIVATION_KEY; - TelemetryLog.log(key, data); - this._log.trace("evaluateExperiments() - added " + key + " to TelemetryLog: " + JSON.stringify(data)); - } - - if (!applicable) { - continue; - } - - this._log.debug("evaluateExperiments() - activating experiment " + id); - try { - yield experiment.start(); - activeChanged = true; - activeExperiment = experiment; - this._dirty = true; - break; - } catch (e) { - // On failure, clean up the best we can and try the next experiment. - this._log.error("evaluateExperiments() - Unable to start experiment: " + e.message); - experiment._enabled = false; - yield experiment.reconcileAddonState(); - } - } - } - - gPrefs.set(PREF_ACTIVE_EXPERIMENT, activeExperiment != null); - - if (activeChanged || this._firstEvaluate) { - Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null); - this._firstEvaluate = false; - } - - if ("@mozilla.org/toolkit/crash-reporter;1" in Cc && activeExperiment) { - try { - gCrashReporter.annotateCrashReport("ActiveExperiment", activeExperiment.id); - gCrashReporter.annotateCrashReport("ActiveExperimentBranch", activeExperiment.branch); - } catch (e) { - // It's ok if crash reporting is disabled. - } - } - }, - - /* - * Schedule the soonest re-check of experiment applicability that is needed. - */ - _scheduleNextRun: function () { - this._checkForShutdown(); - - if (this._timer) { - this._timer.clear(); - } - - if (!gExperimentsEnabled || this._experiments.length == 0) { - return; - } - - let time = null; - let now = this._policy.now().getTime(); - if (this._dirty) { - // If we failed to write the cache, we should try again periodically - time = now + 1000 * CACHE_WRITE_RETRY_DELAY_SEC; - } - - for (let [, experiment] of this._experiments) { - let scheduleTime = experiment.getScheduleTime(); - if (scheduleTime > now) { - if (time !== null) { - time = Math.min(time, scheduleTime); - } else { - time = scheduleTime; - } - } - } - - if (time === null) { - // No schedule time found. - return; - } - - this._log.trace("scheduleExperimentEvaluation() - scheduling for "+time+", now: "+now); - this._policy.oneshotTimer(this.notify, time - now, this, "_timer"); - }, -}; - - -/* - * Represents a single experiment. - */ - -Experiments.ExperimentEntry = function (policy) { - this._policy = policy || new Experiments.Policy(); - let log = Log.repository.getLoggerWithMessagePrefix( - "Browser.Experiments.Experiments", - "ExperimentEntry #" + gExperimentEntryCounter++ + "::"); - this._log = Object.create(log); - this._log.log = (level, string, params) => { - if (gExperiments) { - gExperiments._addToForensicsLog("ExperimentEntry", string); - } - log.log(level, string, params); - }; - - // Is the experiment supposed to be running. - this._enabled = false; - // When this experiment was started, if ever. - this._startDate = null; - // When this experiment was ended, if ever. - this._endDate = null; - // The condition data from the manifest. - this._manifestData = null; - // For an active experiment, signifies whether we need to update the xpi. - this._needsUpdate = false; - // A random sample value for comparison against the manifest conditions. - this._randomValue = null; - // When this entry was last changed for respecting history retention duration. - this._lastChangedDate = null; - // Has this experiment failed to activate before? - this._failedStart = false; - // The experiment branch - this._branch = null; - - // We grab these from the addon after download. - this._name = null; - this._description = null; - this._homepageURL = null; - this._addonId = null; -}; - -Experiments.ExperimentEntry.prototype = { - MANIFEST_REQUIRED_FIELDS: new Set([ - "id", - "xpiURL", - "xpiHash", - "startTime", - "endTime", - "maxActiveSeconds", - "appName", - "channel", - ]), - - MANIFEST_OPTIONAL_FIELDS: new Set([ - "maxStartTime", - "minVersion", - "maxVersion", - "version", - "minBuildID", - "maxBuildID", - "buildIDs", - "os", - "locale", - "sample", - "disabled", - "frozen", - "jsfilter", - ]), - - SERIALIZE_KEYS: new Set([ - "_enabled", - "_manifestData", - "_needsUpdate", - "_randomValue", - "_failedStart", - "_name", - "_description", - "_homepageURL", - "_addonId", - "_startDate", - "_endDate", - "_branch", - ]), - - DATE_KEYS: new Set([ - "_startDate", - "_endDate", - ]), - - UPGRADE_KEYS: new Map([ - ["_branch", null], - ]), - - ADDON_CHANGE_NONE: 0, - ADDON_CHANGE_INSTALL: 1, - ADDON_CHANGE_UNINSTALL: 2, - ADDON_CHANGE_ENABLE: 4, - - /* - * Initialize entry from the manifest. - * @param data The experiment data from the manifest. - * @return boolean Whether initialization succeeded. - */ - initFromManifestData: function (data) { - if (!this._isManifestDataValid(data)) { - return false; - } - - this._manifestData = data; - - this._randomValue = this._policy.random(); - this._lastChangedDate = this._policy.now(); - - return true; - }, - - get enabled() { - return this._enabled; - }, - - get id() { - return this._manifestData.id; - }, - - get branch() { - return this._branch; - }, - - set branch(v) { - this._branch = v; - }, - - get startDate() { - return this._startDate; - }, - - get endDate() { - if (!this._startDate) { - return null; - } - - let endTime = 0; - - if (!this._enabled) { - return this._endDate; - } - - let maxActiveMs = 1000 * this._manifestData.maxActiveSeconds; - endTime = Math.min(1000 * this._manifestData.endTime, - this._startDate.getTime() + maxActiveMs); - - return new Date(endTime); - }, - - get needsUpdate() { - return this._needsUpdate; - }, - - /* - * Initialize entry from the cache. - * @param data The entry data from the cache. - * @return boolean Whether initialization succeeded. - */ - initFromCacheData: function (data) { - for (let [key, dval] of this.UPGRADE_KEYS) { - if (!(key in data)) { - data[key] = dval; - } - } - - for (let key of this.SERIALIZE_KEYS) { - if (!(key in data) && !this.DATE_KEYS.has(key)) { - this._log.error("initFromCacheData() - missing required key " + key); - return false; - } - } - - if (!this._isManifestDataValid(data._manifestData)) { - return false; - } - - // Dates are restored separately from epoch ms, everything else is just - // copied in. - - this.SERIALIZE_KEYS.forEach(key => { - if (!this.DATE_KEYS.has(key)) { - this[key] = data[key]; - } - }); - - this.DATE_KEYS.forEach(key => { - if (key in data) { - let date = new Date(); - date.setTime(data[key]); - this[key] = date; - } - }); - - // In order for the experiment's data expiration mechanism to work, use the experiment's - // |_endData| as the |_lastChangedDate| (if available). - this._lastChangedDate = this._endDate ? this._endDate : this._policy.now(); - - return true; - }, - - /* - * Returns a JSON representation of this object. - */ - toJSON: function () { - let obj = {}; - - // Dates are serialized separately as epoch ms. - - this.SERIALIZE_KEYS.forEach(key => { - if (!this.DATE_KEYS.has(key)) { - obj[key] = this[key]; - } - }); - - this.DATE_KEYS.forEach(key => { - if (this[key]) { - obj[key] = this[key].getTime(); - } - }); - - return obj; - }, - - /* - * Update from the experiment data from the manifest. - * @param data The experiment data from the manifest. - * @return boolean Whether updating succeeded. - */ - updateFromManifestData: function (data) { - let old = this._manifestData; - - if (!this._isManifestDataValid(data)) { - return false; - } - - if (this._enabled) { - if (old.xpiHash !== data.xpiHash) { - // A changed hash means we need to update active experiments. - this._needsUpdate = true; - } - } else if (this._failedStart && - (old.xpiHash !== data.xpiHash) || - (old.xpiURL !== data.xpiURL)) { - // Retry installation of previously invalid experiments - // if hash or url changed. - this._failedStart = false; - } - - this._manifestData = data; - this._lastChangedDate = this._policy.now(); - - return true; - }, - - /* - * Is this experiment applicable? - * @return Promise<> Resolved if the experiment is applicable. - * If it is not applicable it is rejected with - * a Promise<string> which contains the reason. - */ - isApplicable: function () { - let versionCmp = Cc["@mozilla.org/xpcom/version-comparator;1"] - .getService(Ci.nsIVersionComparator); - let app = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo); - let runtime = Cc["@mozilla.org/xre/app-info;1"] - .getService(Ci.nsIXULRuntime); - - let locale = this._policy.locale(); - let channel = this._policy.updatechannel(); - let data = this._manifestData; - - let now = this._policy.now() / 1000; // The manifest times are in seconds. - let maxActive = data.maxActiveSeconds || 0; - let startSec = (this.startDate || 0) / 1000; - - this._log.trace("isApplicable() - now=" + now - + ", randomValue=" + this._randomValue); - - // Not applicable if it already ran. - - if (!this.enabled && this._endDate) { - return Promise.reject(["was-active"]); - } - - // Define and run the condition checks. - - let simpleChecks = [ - { name: "failedStart", - condition: () => !this._failedStart }, - { name: "disabled", - condition: () => !data.disabled }, - { name: "frozen", - condition: () => !data.frozen || this._enabled }, - { name: "startTime", - condition: () => now >= data.startTime }, - { name: "endTime", - condition: () => now < data.endTime }, - { name: "maxStartTime", - condition: () => this._startDate || !data.maxStartTime || now <= data.maxStartTime }, - { name: "maxActiveSeconds", - condition: () => !this._startDate || now <= (startSec + maxActive) }, - { name: "appName", - condition: () => !data.appName || data.appName.indexOf(app.name) != -1 }, - { name: "minBuildID", - condition: () => !data.minBuildID || app.platformBuildID >= data.minBuildID }, - { name: "maxBuildID", - condition: () => !data.maxBuildID || app.platformBuildID <= data.maxBuildID }, - { name: "buildIDs", - condition: () => !data.buildIDs || data.buildIDs.indexOf(app.platformBuildID) != -1 }, - { name: "os", - condition: () => !data.os || data.os.indexOf(runtime.OS) != -1 }, - { name: "channel", - condition: () => !data.channel || data.channel.indexOf(channel) != -1 }, - { name: "locale", - condition: () => !data.locale || data.locale.indexOf(locale) != -1 }, - { name: "sample", - condition: () => data.sample === undefined || this._randomValue <= data.sample }, - { name: "version", - condition: () => !data.version || data.version.indexOf(app.version) != -1 }, - { name: "minVersion", - condition: () => !data.minVersion || versionCmp.compare(app.version, data.minVersion) >= 0 }, - { name: "maxVersion", - condition: () => !data.maxVersion || versionCmp.compare(app.version, data.maxVersion) <= 0 }, - ]; - - for (let check of simpleChecks) { - let result = check.condition(); - if (!result) { - this._log.debug("isApplicable() - id=" - + data.id + " - test '" + check.name + "' failed"); - return Promise.reject([check.name]); - } - } - - if (data.jsfilter) { - return this._runFilterFunction(data.jsfilter); - } - - return Promise.resolve(true); - }, - - /* - * Run the jsfilter function from the manifest in a sandbox and return the - * result (forced to boolean). - */ - _runFilterFunction: Task.async(function* (jsfilter) { - this._log.trace("runFilterFunction() - filter: " + jsfilter); - - let ssm = Services.scriptSecurityManager; - const nullPrincipal = ssm.createNullPrincipal({}); - let options = { - sandboxName: "telemetry experiments jsfilter sandbox", - wantComponents: false, - }; - - let sandbox = Cu.Sandbox(nullPrincipal, options); - try { - Cu.evalInSandbox(jsfilter, sandbox); - } catch (e) { - this._log.error("runFilterFunction() - failed to eval jsfilter: " + e.message); - throw ["jsfilter-evalfailed"]; - } - - let currentEnvironment = yield TelemetryEnvironment.onInitialized(); - - Object.defineProperty(sandbox, "_e", - { get: () => Cu.cloneInto(currentEnvironment, sandbox) }); - - let result = false; - try { - result = !!Cu.evalInSandbox("filter({get telemetryEnvironment() { return _e; } })", sandbox); - } - catch (e) { - this._log.debug("runFilterFunction() - filter function failed: " - + e.message + ", " + e.stack); - throw ["jsfilter-threw", e.message]; - } - finally { - Cu.nukeSandbox(sandbox); - } - - if (!result) { - throw ["jsfilter-false"]; - } - - return true; - }), - - /* - * Start running the experiment. - * - * @return Promise<> Resolved when the operation is complete. - */ - start: Task.async(function* () { - this._log.trace("start() for " + this.id); - - this._enabled = true; - return yield this.reconcileAddonState(); - }), - - // Async install of the addon for this experiment, part of the start task above. - _installAddon: Task.async(function* () { - let deferred = Promise.defer(); - - let hash = this._policy.ignoreHashes ? null : this._manifestData.xpiHash; - - let install = yield addonInstallForURL(this._manifestData.xpiURL, hash); - gActiveInstallURLs.add(install.sourceURI.spec); - - let failureHandler = (install, handler) => { - let message = "AddonInstall " + handler + " for " + this.id + ", state=" + - (install.state || "?") + ", error=" + install.error; - this._log.error("_installAddon() - " + message); - this._failedStart = true; - gActiveInstallURLs.delete(install.sourceURI.spec); - - TelemetryLog.log(TELEMETRY_LOG.ACTIVATION_KEY, - [TELEMETRY_LOG.ACTIVATION.INSTALL_FAILURE, this.id]); - - deferred.reject(new Error(message)); - }; - - let listener = { - _expectedID: null, - - onDownloadEnded: install => { - this._log.trace("_installAddon() - onDownloadEnded for " + this.id); - - if (install.existingAddon) { - this._log.warn("_installAddon() - onDownloadEnded, addon already installed"); - } - - if (install.addon.type !== "experiment") { - this._log.error("_installAddon() - onDownloadEnded, wrong addon type"); - install.cancel(); - } - }, - - onInstallStarted: install => { - this._log.trace("_installAddon() - onInstallStarted for " + this.id); - - if (install.existingAddon) { - this._log.warn("_installAddon() - onInstallStarted, addon already installed"); - } - - if (install.addon.type !== "experiment") { - this._log.error("_installAddon() - onInstallStarted, wrong addon type"); - return false; - } - return undefined; - }, - - onInstallEnded: install => { - this._log.trace("_installAddon() - install ended for " + this.id); - gActiveInstallURLs.delete(install.sourceURI.spec); - - this._lastChangedDate = this._policy.now(); - this._startDate = this._policy.now(); - this._enabled = true; - - TelemetryLog.log(TELEMETRY_LOG.ACTIVATION_KEY, - [TELEMETRY_LOG.ACTIVATION.ACTIVATED, this.id]); - - let addon = install.addon; - this._name = addon.name; - this._addonId = addon.id; - this._description = addon.description || ""; - this._homepageURL = addon.homepageURL || ""; - - // Experiment add-ons default to userDisabled=true. Enable if needed. - if (addon.userDisabled) { - this._log.trace("Add-on is disabled. Enabling."); - listener._expectedID = addon.id; - AddonManager.addAddonListener(listener); - addon.userDisabled = false; - } else { - this._log.trace("Add-on is enabled. start() completed."); - deferred.resolve(); - } - }, - - onEnabled: addon => { - this._log.info("onEnabled() for " + addon.id); - - if (addon.id != listener._expectedID) { - return; - } - - AddonManager.removeAddonListener(listener); - deferred.resolve(); - }, - }; - - ["onDownloadCancelled", "onDownloadFailed", "onInstallCancelled", "onInstallFailed"] - .forEach(what => { - listener[what] = install => failureHandler(install, what) - }); - - install.addListener(listener); - install.install(); - - return yield deferred.promise; - }), - - /** - * Stop running the experiment if it is active. - * - * @param terminationKind (optional) - * The termination kind, e.g. ADDON_UNINSTALLED or EXPIRED. - * @param terminationReason (optional) - * The termination reason details for termination kind RECHECK. - * @return Promise<> Resolved when the operation is complete. - */ - stop: Task.async(function* (terminationKind, terminationReason) { - this._log.trace("stop() - id=" + this.id + ", terminationKind=" + terminationKind); - if (!this._enabled) { - throw new Error("Must not call stop() on an inactive experiment."); - } - - this._enabled = false; - let now = this._policy.now(); - this._lastChangedDate = now; - this._endDate = now; - - let changes = yield this.reconcileAddonState(); - this._logTermination(terminationKind, terminationReason); - - if (terminationKind == TELEMETRY_LOG.TERMINATION.ADDON_UNINSTALLED) { - changes |= this.ADDON_CHANGE_UNINSTALL; - } - - return changes; - }), - - /** - * Reconcile the state of the add-on against what it's supposed to be. - * - * If we are active, ensure the add-on is enabled and up to date. - * - * If we are inactive, ensure the add-on is not installed. - */ - reconcileAddonState: Task.async(function* () { - this._log.trace("reconcileAddonState()"); - - if (!this._enabled) { - if (!this._addonId) { - this._log.trace("reconcileAddonState() - Experiment is not enabled and " + - "has no add-on. Doing nothing."); - return this.ADDON_CHANGE_NONE; - } - - let addon = yield this._getAddon(); - if (!addon) { - this._log.trace("reconcileAddonState() - Inactive experiment has no " + - "add-on. Doing nothing."); - return this.ADDON_CHANGE_NONE; - } - - this._log.info("reconcileAddonState() - Uninstalling add-on for inactive " + - "experiment: " + addon.id); - gActiveUninstallAddonIDs.add(addon.id); - yield uninstallAddons([addon]); - gActiveUninstallAddonIDs.delete(addon.id); - return this.ADDON_CHANGE_UNINSTALL; - } - - // If we get here, we're supposed to be active. - - let changes = 0; - - // That requires an add-on. - let currentAddon = yield this._getAddon(); - - // If we have an add-on but it isn't up to date, uninstall it - // (to prepare for reinstall). - if (currentAddon && this._needsUpdate) { - this._log.info("reconcileAddonState() - Uninstalling add-on because update " + - "needed: " + currentAddon.id); - gActiveUninstallAddonIDs.add(currentAddon.id); - yield uninstallAddons([currentAddon]); - gActiveUninstallAddonIDs.delete(currentAddon.id); - changes |= this.ADDON_CHANGE_UNINSTALL; - } - - if (!currentAddon || this._needsUpdate) { - this._log.info("reconcileAddonState() - Installing add-on."); - yield this._installAddon(); - changes |= this.ADDON_CHANGE_INSTALL; - } - - let addon = yield this._getAddon(); - if (!addon) { - throw new Error("Could not obtain add-on for experiment that should be " + - "enabled."); - } - - // If we have the add-on and it is enabled, we are done. - if (!addon.userDisabled) { - return changes; - } - - // Check permissions to see if we can enable the addon. - if (!(addon.permissions & AddonManager.PERM_CAN_ENABLE)) { - throw new Error("Don't have permission to enable addon " + addon.id + ", perm=" + addon.permission); - } - - // Experiment addons should not require a restart. - if (addon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE) { - throw new Error("Experiment addon requires a restart: " + addon.id); - } - - let deferred = Promise.defer(); - - // Else we need to enable it. - let listener = { - onEnabled: enabledAddon => { - if (enabledAddon.id != addon.id) { - return; - } - - AddonManager.removeAddonListener(listener); - deferred.resolve(); - }, - }; - - for (let handler of ["onDisabled", "onOperationCancelled", "onUninstalled"]) { - listener[handler] = (evtAddon) => { - if (evtAddon.id != addon.id) { - return; - } - - AddonManager.removeAddonListener(listener); - deferred.reject("Failed to enable addon " + addon.id + " due to: " + handler); - }; - } - - this._log.info("reconcileAddonState() - Activating add-on: " + addon.id); - AddonManager.addAddonListener(listener); - addon.userDisabled = false; - yield deferred.promise; - changes |= this.ADDON_CHANGE_ENABLE; - - this._log.info("reconcileAddonState() - Add-on has been enabled: " + addon.id); - return changes; - }), - - /** - * Obtain the underlying Addon from the Addon Manager. - * - * @return Promise<Addon|null> - */ - _getAddon: function () { - if (!this._addonId) { - return Promise.resolve(null); - } - - let deferred = Promise.defer(); - - AddonManager.getAddonByID(this._addonId, (addon) => { - if (addon && addon.appDisabled) { - // Don't return PreviousExperiments. - addon = null; - } - - deferred.resolve(addon); - }); - - return deferred.promise; - }, - - _logTermination: function (terminationKind, terminationReason) { - if (terminationKind === undefined) { - return; - } - - if (!(terminationKind in TELEMETRY_LOG.TERMINATION)) { - this._log.warn("stop() - unknown terminationKind " + terminationKind); - return; - } - - let data = [terminationKind, this.id]; - if (terminationReason) { - data = data.concat(terminationReason); - } - - TelemetryLog.log(TELEMETRY_LOG.TERMINATION_KEY, data); - }, - - /** - * Determine whether an active experiment should be stopped. - */ - shouldStop: function () { - if (!this._enabled) { - throw new Error("shouldStop must not be called on disabled experiments."); - } - - let deferred = Promise.defer(); - this.isApplicable().then( - () => deferred.resolve({shouldStop: false}), - reason => deferred.resolve({shouldStop: true, reason: reason}) - ); - - return deferred.promise; - }, - - /* - * Should this be discarded from the cache due to age? - */ - shouldDiscard: function () { - let limit = this._policy.now(); - limit.setDate(limit.getDate() - KEEP_HISTORY_N_DAYS); - return (this._lastChangedDate < limit); - }, - - /* - * Get next date (in epoch-ms) to schedule a re-evaluation for this. - * Returns 0 if it doesn't need one. - */ - getScheduleTime: function () { - if (this._enabled) { - let startTime = this._startDate.getTime(); - let maxActiveTime = startTime + 1000 * this._manifestData.maxActiveSeconds; - return Math.min(1000 * this._manifestData.endTime, maxActiveTime); - } - - if (this._endDate) { - return this._endDate.getTime(); - } - - return 1000 * this._manifestData.startTime; - }, - - /* - * Perform sanity checks on the experiment data. - */ - _isManifestDataValid: function (data) { - this._log.trace("isManifestDataValid() - data: " + JSON.stringify(data)); - - for (let key of this.MANIFEST_REQUIRED_FIELDS) { - if (!(key in data)) { - this._log.error("isManifestDataValid() - missing required key: " + key); - return false; - } - } - - for (let key in data) { - if (!this.MANIFEST_OPTIONAL_FIELDS.has(key) && - !this.MANIFEST_REQUIRED_FIELDS.has(key)) { - this._log.error("isManifestDataValid() - unknown key: " + key); - return false; - } - } - - return true; - }, -}; - -/** - * Strip a Date down to its UTC midnight. - * - * This will return a cloned Date object. The original is unchanged. - */ -var stripDateToMidnight = function (d) { - let m = new Date(d); - m.setUTCHours(0, 0, 0, 0); - - return m; -}; - -/** - * An Add-ons Manager provider that knows about old experiments. - * - * This provider exposes read-only add-ons corresponding to previously-active - * experiments. The existence of this provider (and the add-ons it knows about) - * facilitates the display of old experiments in the Add-ons Manager UI with - * very little custom code in that component. - */ -this.Experiments.PreviousExperimentProvider = function (experiments) { - this._experiments = experiments; - this._experimentList = []; - this._log = Log.repository.getLoggerWithMessagePrefix( - "Browser.Experiments.Experiments", - "PreviousExperimentProvider #" + gPreviousProviderCounter++ + "::"); -} - -this.Experiments.PreviousExperimentProvider.prototype = Object.freeze({ - name: "PreviousExperimentProvider", - - startup: function () { - this._log.trace("startup()"); - Services.obs.addObserver(this, EXPERIMENTS_CHANGED_TOPIC, false); - }, - - shutdown: function () { - this._log.trace("shutdown()"); - try { - Services.obs.removeObserver(this, EXPERIMENTS_CHANGED_TOPIC); - } catch (e) { - // Prevent crash in mochitest-browser3 on Mulet - } - }, - - observe: function (subject, topic, data) { - switch (topic) { - case EXPERIMENTS_CHANGED_TOPIC: - this._updateExperimentList(); - break; - } - }, - - getAddonByID: function (id, cb) { - for (let experiment of this._experimentList) { - if (experiment.id == id) { - cb(new PreviousExperimentAddon(experiment)); - return; - } - } - - cb(null); - }, - - getAddonsByTypes: function (types, cb) { - if (types && types.length > 0 && types.indexOf("experiment") == -1) { - cb([]); - return; - } - - cb(this._experimentList.map(e => new PreviousExperimentAddon(e))); - }, - - _updateExperimentList: function () { - return this._experiments.getExperiments().then((experiments) => { - let list = experiments.filter(e => !e.active); - - let newMap = new Map(list.map(e => [e.id, e])); - let oldMap = new Map(this._experimentList.map(e => [e.id, e])); - - let added = [...newMap.keys()].filter(id => !oldMap.has(id)); - let removed = [...oldMap.keys()].filter(id => !newMap.has(id)); - - for (let id of added) { - this._log.trace("updateExperimentList() - adding " + id); - let wrapper = new PreviousExperimentAddon(newMap.get(id)); - AddonManagerPrivate.callInstallListeners("onExternalInstall", null, wrapper, null, false); - AddonManagerPrivate.callAddonListeners("onInstalling", wrapper, false); - } - - for (let id of removed) { - this._log.trace("updateExperimentList() - removing " + id); - let wrapper = new PreviousExperimentAddon(oldMap.get(id)); - AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false); - } - - this._experimentList = list; - - for (let id of added) { - let wrapper = new PreviousExperimentAddon(newMap.get(id)); - AddonManagerPrivate.callAddonListeners("onInstalled", wrapper); - } - - for (let id of removed) { - let wrapper = new PreviousExperimentAddon(oldMap.get(id)); - AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper); - } - - return this._experimentList; - }); - }, -}); - -/** - * An add-on that represents a previously-installed experiment. - */ -function PreviousExperimentAddon(experiment) { - this._id = experiment.id; - this._name = experiment.name; - this._endDate = experiment.endDate; - this._description = experiment.description; -} - -PreviousExperimentAddon.prototype = Object.freeze({ - // BEGIN REQUIRED ADDON PROPERTIES - - get appDisabled() { - return true; - }, - - get blocklistState() { - Ci.nsIBlocklistService.STATE_NOT_BLOCKED - }, - - get creator() { - return new AddonManagerPrivate.AddonAuthor(""); - }, - - get foreignInstall() { - return false; - }, - - get id() { - return this._id; - }, - - get isActive() { - return false; - }, - - get isCompatible() { - return true; - }, - - get isPlatformCompatible() { - return true; - }, - - get name() { - return this._name; - }, - - get pendingOperations() { - return AddonManager.PENDING_NONE; - }, - - get permissions() { - return 0; - }, - - get providesUpdatesSecurely() { - return true; - }, - - get scope() { - return AddonManager.SCOPE_PROFILE; - }, - - get type() { - return "experiment"; - }, - - get userDisabled() { - return true; - }, - - get version() { - return null; - }, - - // END REQUIRED PROPERTIES - - // BEGIN OPTIONAL PROPERTIES - - get description() { - return this._description; - }, - - get updateDate() { - return new Date(this._endDate); - }, - - // END OPTIONAL PROPERTIES - - // BEGIN REQUIRED METHODS - - isCompatibleWith: function (appVersion, platformVersion) { - return true; - }, - - findUpdates: function (listener, reason, appVersion, platformVersion) { - AddonManagerPrivate.callNoUpdateListeners(this, listener, reason, - appVersion, platformVersion); - }, - - // END REQUIRED METHODS - - /** - * The end-date of the experiment, required for the Addon Manager UI. - */ - - get endDate() { - return this._endDate; - }, - -}); diff --git a/browser/experiments/Experiments.manifest b/browser/experiments/Experiments.manifest deleted file mode 100644 index 4a6a05a60..000000000 --- a/browser/experiments/Experiments.manifest +++ /dev/null @@ -1,6 +0,0 @@ -component {f7800463-3b97-47f9-9341-b7617e6d8d49} ExperimentsService.js -contract @mozilla.org/browser/experiments-service;1 {f7800463-3b97-47f9-9341-b7617e6d8d49} -category update-timer ExperimentsService @mozilla.org/browser/experiments-service;1,getService,experiments-update-timer,experiments.manifest.fetchIntervalSeconds,86400 -category profile-after-change ExperimentsService @mozilla.org/browser/experiments-service;1 - - diff --git a/browser/experiments/ExperimentsService.js b/browser/experiments/ExperimentsService.js deleted file mode 100644 index 53e811251..000000000 --- a/browser/experiments/ExperimentsService.js +++ /dev/null @@ -1,118 +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/. */ - -"use strict"; - -const {interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Preferences.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "OS", - "resource://gre/modules/osfile.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils", - "resource://services-common/utils.js"); - -const PREF_EXPERIMENTS_ENABLED = "experiments.enabled"; -const PREF_ACTIVE_EXPERIMENT = "experiments.activeExperiment"; // whether we have an active experiment -const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled"; -const PREF_TELEMETRY_UNIFIED = "toolkit.telemetry.unified"; -const DELAY_INIT_MS = 30 * 1000; - -// Whether the FHR/Telemetry unification features are enabled. -// Changing this pref requires a restart. -const IS_UNIFIED_TELEMETRY = Preferences.get(PREF_TELEMETRY_UNIFIED, false); - -XPCOMUtils.defineLazyGetter( - this, "gPrefs", () => { - return new Preferences(); - }); - -XPCOMUtils.defineLazyGetter( - this, "gExperimentsEnabled", () => { - // We can enable experiments if either unified Telemetry or FHR is on, and the user - // has opted into Telemetry. - return gPrefs.get(PREF_EXPERIMENTS_ENABLED, false) && - IS_UNIFIED_TELEMETRY && gPrefs.get(PREF_TELEMETRY_ENABLED, false); - }); - -XPCOMUtils.defineLazyGetter( - this, "gActiveExperiment", () => { - return gPrefs.get(PREF_ACTIVE_EXPERIMENT); - }); - -function ExperimentsService() { - this._initialized = false; - this._delayedInitTimer = null; -} - -ExperimentsService.prototype = { - classID: Components.ID("{f7800463-3b97-47f9-9341-b7617e6d8d49}"), - QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback, Ci.nsIObserver]), - - notify: function (timer) { - if (!gExperimentsEnabled) { - return; - } - if (OS.Constants.Path.profileDir === undefined) { - throw Error("Update timer fired before profile was initialized?"); - } - let instance = Experiments.instance(); - if (instance.isReady) { - instance.updateManifest(); - } - }, - - _delayedInit: function () { - if (!this._initialized) { - this._initialized = true; - Experiments.instance(); // for side effects - } - }, - - observe: function (subject, topic, data) { - switch (topic) { - case "profile-after-change": - if (gExperimentsEnabled) { - Services.obs.addObserver(this, "quit-application", false); - Services.obs.addObserver(this, "sessionstore-state-finalized", false); - Services.obs.addObserver(this, "EM-loaded", false); - - if (gActiveExperiment) { - this._initialized = true; - Experiments.instance(); // for side effects - } - } - break; - case "sessionstore-state-finalized": - if (!this._initialized) { - CommonUtils.namedTimer(this._delayedInit, DELAY_INIT_MS, this, "_delayedInitTimer"); - } - break; - case "EM-loaded": - if (!this._initialized) { - Experiments.instance(); // for side effects - this._initialized = true; - - if (this._delayedInitTimer) { - this._delayedInitTimer.clear(); - } - } - break; - case "quit-application": - Services.obs.removeObserver(this, "quit-application"); - Services.obs.removeObserver(this, "sessionstore-state-finalized"); - Services.obs.removeObserver(this, "EM-loaded"); - if (this._delayedInitTimer) { - this._delayedInitTimer.clear(); - } - break; - } - }, -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ExperimentsService]); diff --git a/browser/experiments/Makefile.in b/browser/experiments/Makefile.in deleted file mode 100644 index 5558582a6..000000000 --- a/browser/experiments/Makefile.in +++ /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/. - -include $(topsrcdir)/config/rules.mk - -# This is so hacky. Waiting on bug 988938. -addondir = $(srcdir)/test/addons -testdir = $(topobjdir)/_tests/xpcshell/browser/experiments/test/xpcshell - -misc:: $(call mkdir_deps,$(testdir)) - $(EXIT_ON_ERROR) \ - for dir in $(addondir)/*; do \ - base=`basename $$dir`; \ - (cd $$dir && zip -qr $(testdir)/$$base.xpi *); \ - done diff --git a/browser/experiments/docs/index.rst b/browser/experiments/docs/index.rst deleted file mode 100644 index 11e5d4faa..000000000 --- a/browser/experiments/docs/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -===================== -Telemetry Experiments -===================== - -Telemetry Experiments is a feature of Firefox that allows the installation -of add-ons called experiments to a subset of the Firefox population for -the purposes of experimenting with changes and collecting data on specific -aspects of application usage. - -.. toctree:: - :maxdepth: 1 - - manifest diff --git a/browser/experiments/docs/manifest.rst b/browser/experiments/docs/manifest.rst deleted file mode 100644 index d4fad5243..000000000 --- a/browser/experiments/docs/manifest.rst +++ /dev/null @@ -1,429 +0,0 @@ -.. _experiments_manifests: - -===================== -Experiments Manifests -===================== - -*Experiments Manifests* are documents that describe the set of active -experiments a client may run. - -*Experiments Manifests* are fetched periodically by clients. When -fetched, clients look at the experiments within the manifest and -determine which experiments are applicable. If an experiment is -applicable, the client may download and start the experiment. - -Manifest Format -=============== - -Manifests are JSON documents where the main element is an object. - -The *schema* of the object is versioned and defined by the presence -of a top-level ``version`` property, whose integer value is the -schema version used by that manifest. Each version is documented -in the sections below. - -Version 1 ---------- - -Version 1 is the original manifest format. - -The following properties may exist in the root object: - -experiments - An array of objects describing candidate experiments. The format of - these objects is documented below. - - An array is used to create an explicit priority of experiments. - Experiments listed at the beginning of the array take priority over - experiments that follow. - -Experiments Objects -^^^^^^^^^^^^^^^^^^^ - -Each object in the ``experiments`` array may contain the following -properties: - -id - (required) String identifier of this experiment. The identifier should - be treated as opaque by clients. It is used to uniquely identify an - experiment for all of time. - -xpiURL - (required) String URL of the XPI that implements this experiment. - - If the experiment is activated, the client will download and install this - XPI. - -xpiHash - (required) String hash of the XPI that implements this experiment. - - The value is composed of a hash identifier followed by a colon - followed by the hash value. e.g. - `sha1:f677428b9172e22e9911039aef03f3736e7f78a7`. `sha1` and `sha256` - are the two supported hashing mechanisms. The hash value is the hex - encoding of the binary hash. - - When the client downloads the XPI for the experiment, it should compare - the hash of that XPI against this value. If the hashes don't match, - the client should not install the XPI. - - Clients may also use this hash as a means of determining when an - experiment's XPI has changed and should be refreshed. - -startTime - Integer seconds since UNIX epoch that this experiment should - start. Clients should not start an experiment if *now()* is less than - this value. - -maxStartTime - (optional) Integer seconds since UNIX epoch after which this experiment - should no longer start. - - Some experiments may wish to impose hard deadlines after which no new - clients should activate the experiment. This property may be used to - facilitate that. - -endTime - Integer seconds since UNIX epoch after which this experiment - should no longer run. Clients should cease an experiment when the current - time is beyond this value. - -maxActiveSeconds - Integer seconds defining the max wall time this experiment should be - active for. - - The client should deactivate the experiment this many seconds after - initial activation. - - This value only involves wall time, not browser activity or session time. - -appName - Array of application names this experiment should run on. - - An application name comes from ``nsIXULAppInfo.name``. It is a value - like ``Firefox``, ``Fennec``, or `B2G`. - - The client should compare its application name against the members of - this array. If a match is found, the experiment is applicable. - -minVersion - (optional) String version number of the minimum application version this - experiment should run on. - - A version number is something like ``27.0.0`` or ``28``. - - The client should compare its version number to this value. If the client's - version is greater or equal to this version (using a version-aware comparison - function), the experiment is applicable. - - If this is not specified, there is no lower bound to versions this - experiment should run on. - -maxVersion - (optional) String version number of the maximum application version this - experiment should run on. - - This is similar to ``minVersion`` except it sets the upper bound for - application versions. - - If the client's version is less than or equal to this version, the - experiment is applicable. - - If this is not specified, there is no upper bound to versions this - experiment should run on. - -version - (optional) Array of application versions this experiment should run on. - - This is similar to ``minVersion`` and ``maxVersion`` except only a - whitelisted set of specific versions are allowed. - - The client should compare its version to members of this array. If a match - is found, the experiment is applicable. - -minBuildID - (optional) String minimum Build ID this experiment should run on. - - Build IDs are values like ``201402261424``. - - The client should perform a string comparison of its Build ID against this - value. If its value is greater than or equal to this value, the experiment - is applicable. - -maxBuildID - (optional) String maximum Build ID this experiment should run on. - - This is similar to ``minBuildID`` except it sets the upper bound - for Build IDs. - - The client should perform a string comparison of its Build ID against - this value. If its value is less than or equal to this value, the - experiment is applicable. - -buildIDs - (optional) Array of Build IDs this experiment should run on. - - This is similar to ``minBuildID`` and ``maxBuildID`` except only a - whitelisted set of Build IDs are considered. - - The client should compare its Build ID to members of this array. If a - match is found, the experiment is applicable. - -os - (optional) Array of operating system identifiers this experiment should - run on. - - Values for this array come from ``nsIXULRuntime.OS``. - - The client will compare its operating system identifier to members - of this array. If a match is found, the experiment is applicable to the - client. - -channel - (optional) Array of release channel identifiers this experiment should run - on. - - The client will compare its channel to members of this array. If a match - is found, the experiment is applicable. - - If this property is not defined, the client should assume the experiment - is to run on all channels. - -locale - (optional) Array of locale identifiers this experiment should run on. - - A locale identifier is a string like ``en-US`` or ``zh-CN`` and is - obtained by looking at - ``nsIXULChromeRegistry.getSelectedLocale("global")``. - - The client should compare its locale identifier to members of this array. - If a match is found, the experiment is applicable. - - If this property is not defined, the client should assume the experiment - is to run on all locales. - -sample - (optional) Decimal number indicating the sampling rate for this experiment. - - This will contain a value between ``0.0`` and ``1.0``. The client should - generate a random decimal between ``0.0`` and ``1.0``. If the randomly - generated number is less than or equal to the value of this field, the - experiment is applicable. - -disabled - (optional) Boolean value indicating whether an experiment is disabled. - - Normally, experiments are deactivated after a certain time has passed or - after the experiment itself determines it no longer needs to run (perhaps - it collected sufficient data already). - - This property serves as a backup mechanism to remotely disable an - experiment before it was scheduled to be disabled. It can be used to - kill experiments that are found to be doing wrong or bad things or that - aren't useful. - - If this property is not defined or is false, the client should assume - the experiment is active and a candidate for activation. - -frozen - (optional) Boolean value indicating this experiment is frozen and no - longer accepting new enrollments. - - If a client sees a true value in this field, it should not attempt to - activate an experiment. - -jsfilter - (optional) JavaScript code that will be evaluated to determine experiment - applicability. - - This property contains the string representation of JavaScript code that - will be evaluated in a sandboxed environment using JavaScript's - ``eval()``. - - The string is expected to contain the definition of a JavaScript function - ``filter(context)``. This function receives as its argument an object - holding application state. See the section below for the definition of - this object. - - The purpose of this property is to allow experiments to define complex - rules and logic for evaluating experiment applicability in a manner - that is privacy conscious and doesn't require the transmission of - excessive data. - - The return value of this filter indicates whether the experiment is - applicable. Functions should return true if the experiment is - applicable. - - If an experiment is not applicable, they should throw an Error whose - message contains the reason the experiment is not applicable. This - message may be logged and sent to remote servers, so it should not - contain private or otherwise sensitive data that wouldn't normally - be submitted. - - If a falsey (or undefined) value is returned, the client should - assume the experiment is not applicable. - - If this property is not defined, the client does not consider a custom - JavaScript filter function when determining whether an experiment is - applicable. - -JavaScript Filter Context Objects -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The object passed to a ``jsfilter`` ``filter()`` function contains the -following properties: - -healthReportSubmissionEnabled - This property contains a boolean indicating whether Firefox Health - Report has its data submission flag enabled (whether Firefox Health - Report is sending data to remote servers). - -healthReportPayload - This property contains the current Firefox Health Report payload. - - The payload format is documented at :ref:`healthreport_dataformat`. - -telemetryPayload - This property contains the current Telemetry payload. - -The evaluation sandbox for the JavaScript filters may be destroyed -immediately after ``filter()`` returns. This function should not assume -async code will finish. - -Experiment Applicability and Client Behavior -============================================ - -The point of an experiment manifest is to define which experiments are -available and where and how to run them. This section explains those -rules in more detail. - -Many of the properties in *Experiment Objects* are related to determining -whether an experiment should run on a given client. This evaluation is -performed client side. - -1. Multiple conditions in an experiment ---------------------------------------- - -If multiple conditions are defined for an experiment, the client should -combine each condition with a logical *AND*: all conditions must be -satisfied for an experiment to run. If one condition fails, the experiment -is not applicable. - -2. Active experiment disappears from manifest ---------------------------------------------- - -If a specific experiment disappears from the manifest, the client should -continue conducting an already-active experiment. Furthermore, the -client should remember what the expiration events were for an experiment -and honor them. - -The rationale here is that we want to prevent an accidental deletion -or temporary failure on the server to inadvertantly deactivate -supposed-to-be-active experiments. We also don't want premature deletion -of an experiment from the manifest to result in indefinite activation -periods. - -3. Inactive experiment disappears from manifest ------------------------------------------------ - -If an inactive but scheduled-to-be-active experiment disappears from the -manifest, the client should not activate the experiment. - -If that experiment reappears in the manifest, the client should not -treat that experiment any differently than any other new experiment. Put -another way, the fact an inactive experiment disappears and then -reappears should not be significant. - -The rationale here is that server operators should have complete -control of an inactive experiment up to it's go-live date. - -4. Re-evaluating applicability on manifest refresh --------------------------------------------------- - -When an experiment manifest is refreshed or updated, the client should -re-evaluate the applicability of each experiment therein. - -The rationale here is that the server may change the parameters of an -experiment and want clients to pick those up. - -5. Activating a previously non-applicable experiment ----------------------------------------------------- - -If the conditions of an experiment change or the state of the client -changes to allow an experiment to transition from previously -non-applicable to applicable, the experiment should be activated. - -For example, if a client is running version 28 and the experiment -initially requires version 29 or above, the client will not mark the -experiment as applicable. But if the client upgrades to version 29 or if -the manifest is updated to require 28 or above, the experiment will -become applicable. - -6. Deactivating a previously active experiment ----------------------------------------------- - -If the conditions of an experiment change or the state of the client -changes and an active experiment is no longer applicable, that -experiment should be deactivated. - -7. Calculation of sampling-based applicability ----------------------------------------------- - -For calculating sampling-based applicability, the client will associate -a random value between ``0.0`` and ``1.0`` for each observed experiment -ID. This random value will be generated the first time sampling -applicability is evaluated. This random value will be persisted and used -in future applicability evaluations for this experiment. - -By saving and re-using the value, the client is able to reliably and -consistently evaluate applicability, even if the sampling threshold -in the manifest changes. - -Clients should retain the randomly-generated sampling value for -experiments that no longer appear in a manifest for a period of at least -30 days. The rationale is that if an experiment disappears and reappears -from a manifest, the client will not have multiple opportunities to -generate a random value that satisfies the sampling criteria. - -8. Incompatible version numbers -------------------------------- - -If a client receives a manifest with a version number that it doesn't -recognize, it should ignore the manifest. - -9. Usage of old manifests -------------------------- - -If a client experiences an error fetching a manifest (server not -available) or if the manifest is corrupt, not readable, or compatible, -the client may use a previously-fetched (cached) manifest. - -10. Updating XPIs ------------------ - -If the URL or hash of an active experiment's XPI changes, the client -should fetch the new XPI, uninstall the old XPI, and install the new -XPI. - -Examples -======== - -Here is an example manifest:: - - { - "version": 1, - "experiments": [ - { - "id": "da9d7f4f-f3f9-4f81-bacd-6f0626ffa360", - "xpiURL": "https://experiments.mozilla.org/foo.xpi", - "xpiHash": "sha1:cb1eb32b89d86d78b7326f416cf404548c5e0099", - "startTime": 1393000000, - "endTime": 1394000000, - "appName": ["Firefox", "Fennec"], - "minVersion": "28", - "maxVersion": "30", - "os": ["windows", "linux", "osx"], - "jsfilter": "function filter(context) { return context.healthReportEnabled; }" - } - ] - } diff --git a/browser/experiments/moz.build b/browser/experiments/moz.build deleted file mode 100644 index a11e4b725..000000000 --- a/browser/experiments/moz.build +++ /dev/null @@ -1,18 +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/. - -HAS_MISC_RULE = True - -EXTRA_COMPONENTS += [ - 'Experiments.manifest', - 'ExperimentsService.js', -] - -EXTRA_JS_MODULES.experiments += [ - 'Experiments.jsm', -] - -XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini'] - -SPHINX_TREES['experiments'] = 'docs' diff --git a/browser/experiments/test/addons/experiment-1/install.rdf b/browser/experiments/test/addons/experiment-1/install.rdf deleted file mode 100644 index f9d70054a..000000000 --- a/browser/experiments/test/addons/experiment-1/install.rdf +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>test-experiment-1@tests.mozilla.org</em:id> - <em:version>1</em:version> - <em:type>128</em:type> - - <!-- Front End MetaData --> - <em:name>Test experiment 1</em:name> - <em:description>Yet another experiment that experiments experimentally.</em:description> - - </Description> -</RDF> diff --git a/browser/experiments/test/addons/experiment-1a/install.rdf b/browser/experiments/test/addons/experiment-1a/install.rdf deleted file mode 100644 index 7806b11b1..000000000 --- a/browser/experiments/test/addons/experiment-1a/install.rdf +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>test-experiment-1@tests.mozilla.org</em:id> - <em:version>1.1</em:version> - <em:type>128</em:type> - - <!-- Front End MetaData --> - <em:name>Test experiment 1.1</em:name> - <em:description>And yet another experiment that experiments experimentally.</em:description> - - </Description> -</RDF> diff --git a/browser/experiments/test/addons/experiment-2/install.rdf b/browser/experiments/test/addons/experiment-2/install.rdf deleted file mode 100644 index 69122c0ef..000000000 --- a/browser/experiments/test/addons/experiment-2/install.rdf +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>test-experiment-2@tests.mozilla.org</em:id> - <em:version>1</em:version> - <em:type>128</em:type> - - <!-- Front End MetaData --> - <em:name>Test experiment 2</em:name> - <em:description>And yet another experiment that experiments experimentally.</em:description> - - </Description> -</RDF> diff --git a/browser/experiments/test/addons/experiment-racybranch/bootstrap.js b/browser/experiments/test/addons/experiment-racybranch/bootstrap.js deleted file mode 100644 index e8278f50f..000000000 --- a/browser/experiments/test/addons/experiment-racybranch/bootstrap.js +++ /dev/null @@ -1,35 +0,0 @@ -/* exported startup, shutdown, install, uninstall */ - -var {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -var gStarted = false; - -function startup(data, reasonCode) { - if (gStarted) { - return; - } - gStarted = true; - - // delay realstartup to trigger the race condition - Cc['@mozilla.org/thread-manager;1'].getService(Ci.nsIThreadManager) - .mainThread.dispatch(realstartup, 0); -} - -function realstartup() { - let experiments = Experiments.instance(); - let experiment = experiments._getActiveExperiment(); - if (experiment.branch) { - Cu.reportError("Found pre-existing branch: " + experiment.branch); - return; - } - - let branch = "racy-set"; - experiments.setExperimentBranch(experiment.id, branch) - .then(null, Cu.reportError); -} - -function shutdown() { } -function install() { } -function uninstall() { } diff --git a/browser/experiments/test/addons/experiment-racybranch/install.rdf b/browser/experiments/test/addons/experiment-racybranch/install.rdf deleted file mode 100644 index cebaede56..000000000 --- a/browser/experiments/test/addons/experiment-racybranch/install.rdf +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>test-experiment-racybranch@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>128</em:type>
-
- <!-- Front End MetaData -->
- <em:name>Test experiment racybranch</em:name>
- <em:description>An experiment that sets the experiment branch in a potentially racy way.</em:description>
-
- </Description>
-</RDF>
diff --git a/browser/experiments/test/xpcshell/.eslintrc.js b/browser/experiments/test/xpcshell/.eslintrc.js deleted file mode 100644 index 1f540a05b..000000000 --- a/browser/experiments/test/xpcshell/.eslintrc.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "../../../../testing/xpcshell/xpcshell.eslintrc.js" - ], - - "rules": { - "no-unused-vars": ["error", { - "vars": "all", - "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", - "args": "none" - }] - } -}; diff --git a/browser/experiments/test/xpcshell/experiments_1.manifest b/browser/experiments/test/xpcshell/experiments_1.manifest deleted file mode 100644 index 0401ea328..000000000 --- a/browser/experiments/test/xpcshell/experiments_1.manifest +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "experiments": [ - { - "id": "test-experiment-1@tests.mozilla.org", - "xpiURL": "https://experiments.mozilla.org/foo.xpi", - "xpiHash": "sha1:cb1eb32b89d86d78b7326f416cf404548c5e0099", - "startTime": 1393000000, - "endTime": 1394000000, - "appName": ["Firefox", "Fennec"], - "minVersion": "28", - "maxVersion": "30", - "maxActiveSeconds": 60, - "os": ["windows", "linux", "osx"], - "channel": ["daily", "weekly", "nightly"], - "jsfilter": "function filter(context) { return true; }" - } - ] -} diff --git a/browser/experiments/test/xpcshell/head.js b/browser/experiments/test/xpcshell/head.js deleted file mode 100644 index ae356ea2d..000000000 --- a/browser/experiments/test/xpcshell/head.js +++ /dev/null @@ -1,199 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* exported PREF_EXPERIMENTS_ENABLED, PREF_LOGGING_LEVEL, PREF_LOGGING_DUMP - PREF_MANIFEST_URI, PREF_FETCHINTERVAL, EXPERIMENT1_ID, - EXPERIMENT1_NAME, EXPERIMENT1_XPI_SHA1, EXPERIMENT1A_NAME, - EXPERIMENT1A_XPI_SHA1, EXPERIMENT2_ID, EXPERIMENT2_XPI_SHA1, - EXPERIMENT3_ID, EXPERIMENT4_ID, FAKE_EXPERIMENTS_1, - FAKE_EXPERIMENTS_2, gAppInfo, removeCacheFile, defineNow, - futureDate, dateToSeconds, loadAddonManager, promiseRestartManager, - startAddonManagerOnly, getExperimentAddons, replaceExperiments */ - -var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/osfile.jsm"); -Cu.import("resource://testing-common/AddonManagerTesting.jsm"); -Cu.import("resource://testing-common/AddonTestUtils.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", - "resource://gre/modules/AddonManager.jsm"); - -const PREF_EXPERIMENTS_ENABLED = "experiments.enabled"; -const PREF_LOGGING_LEVEL = "experiments.logging.level"; -const PREF_LOGGING_DUMP = "experiments.logging.dump"; -const PREF_MANIFEST_URI = "experiments.manifest.uri"; -const PREF_FETCHINTERVAL = "experiments.manifest.fetchIntervalSeconds"; -const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled"; - -function getExperimentPath(base) { - let p = do_get_cwd(); - p.append(base); - return p.path; -} - -function sha1File(path) { - let f = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); - f.initWithPath(path); - let hasher = Cc["@mozilla.org/security/hash;1"] - .createInstance(Ci.nsICryptoHash); - hasher.init(hasher.SHA1); - - let is = Cc["@mozilla.org/network/file-input-stream;1"] - .createInstance(Ci.nsIFileInputStream); - is.init(f, -1, 0, 0); - hasher.updateFromStream(is, Math.pow(2, 32) - 1); - is.close(); - let bytes = hasher.finish(false); - - let rv = ""; - for (let i = 0; i < bytes.length; i++) { - rv += ("0" + bytes.charCodeAt(i).toString(16)).substr(-2); - } - return rv; -} - -const EXPERIMENT1_ID = "test-experiment-1@tests.mozilla.org"; -const EXPERIMENT1_XPI_NAME = "experiment-1.xpi"; -const EXPERIMENT1_NAME = "Test experiment 1"; -const EXPERIMENT1_PATH = getExperimentPath(EXPERIMENT1_XPI_NAME); -const EXPERIMENT1_XPI_SHA1 = "sha1:" + sha1File(EXPERIMENT1_PATH); - - -const EXPERIMENT1A_XPI_NAME = "experiment-1a.xpi"; -const EXPERIMENT1A_NAME = "Test experiment 1.1"; -const EXPERIMENT1A_PATH = getExperimentPath(EXPERIMENT1A_XPI_NAME); -const EXPERIMENT1A_XPI_SHA1 = "sha1:" + sha1File(EXPERIMENT1A_PATH); - -const EXPERIMENT2_ID = "test-experiment-2@tests.mozilla.org" -const EXPERIMENT2_XPI_NAME = "experiment-2.xpi"; -const EXPERIMENT2_PATH = getExperimentPath(EXPERIMENT2_XPI_NAME); -const EXPERIMENT2_XPI_SHA1 = "sha1:" + sha1File(EXPERIMENT2_PATH); - -const EXPERIMENT3_ID = "test-experiment-3@tests.mozilla.org"; -const EXPERIMENT4_ID = "test-experiment-4@tests.mozilla.org"; - -const FAKE_EXPERIMENTS_1 = [ - { - id: "id1", - name: "experiment1", - description: "experiment 1", - active: true, - detailUrl: "https://dummy/experiment1", - branch: "foo", - }, -]; - -const FAKE_EXPERIMENTS_2 = [ - { - id: "id2", - name: "experiment2", - description: "experiment 2", - active: false, - endDate: new Date(2014, 2, 11, 2, 4, 35, 42).getTime(), - detailUrl: "https://dummy/experiment2", - branch: null, - }, - { - id: "id1", - name: "experiment1", - description: "experiment 1", - active: false, - endDate: new Date(2014, 2, 10, 0, 0, 0, 0).getTime(), - detailURL: "https://dummy/experiment1", - branch: null, - }, -]; - -var gAppInfo = null; - -function removeCacheFile() { - let path = OS.Path.join(OS.Constants.Path.profileDir, "experiments.json"); - return OS.File.remove(path); -} - -function patchPolicy(policy, data) { - for (let key of Object.keys(data)) { - Object.defineProperty(policy, key, { - value: data[key], - writable: true, - }); - } -} - -function defineNow(policy, time) { - patchPolicy(policy, { now: () => new Date(time) }); -} - -function futureDate(date, offset) { - return new Date(date.getTime() + offset); -} - -function dateToSeconds(date) { - return date.getTime() / 1000; -} - -var gGlobalScope = this; -function loadAddonManager() { - AddonTestUtils.init(gGlobalScope); - AddonTestUtils.overrideCertDB(); - createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); - return AddonTestUtils.promiseStartupManager(); -} - -const { - promiseRestartManager, -} = AddonTestUtils; - -// Starts the addon manager without creating app info. We can't directly use -// |loadAddonManager| defined above in test_conditions.js as it would make the test fail. -function startAddonManagerOnly() { - let addonManager = Cc["@mozilla.org/addons/integration;1"] - .getService(Ci.nsIObserver) - .QueryInterface(Ci.nsITimerCallback); - addonManager.observe(null, "addons-startup", null); -} - -function getExperimentAddons(previous=false) { - let deferred = Promise.defer(); - - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - if (previous) { - deferred.resolve(addons); - } else { - deferred.resolve(addons.filter(a => !a.appDisabled)); - } - }); - - return deferred.promise; -} - -function createAppInfo(ID="xpcshell@tests.mozilla.org", name="XPCShell", - version="1.0", platformVersion="1.0") { - AddonTestUtils.createAppInfo(ID, name, version, platformVersion); - gAppInfo = AddonTestUtils.appInfo; -} - -/** - * Replace the experiments on an Experiments with a new list. - * - * This monkeypatches getExperiments(). It doesn't monkeypatch the internal - * experiments list. So its utility is not as great as it could be. - */ -function replaceExperiments(experiment, list) { - Object.defineProperty(experiment, "getExperiments", { - writable: true, - value: () => { - return Promise.resolve(list); - }, - }); -} - -// Experiments require Telemetry to be enabled, and that's not true for debug -// builds. Let's just enable it here instead of going through each test. -Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true); diff --git a/browser/experiments/test/xpcshell/test_activate.js b/browser/experiments/test/xpcshell/test_activate.js deleted file mode 100644 index 60deafbfb..000000000 --- a/browser/experiments/test/xpcshell/test_activate.js +++ /dev/null @@ -1,151 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -var gHttpServer = null; -var gHttpRoot = null; -var gPolicy = null; - -function ManifestEntry(data) { - this.id = data.id || EXPERIMENT1_ID; - this.xpiURL = data.xpiURL || gHttpRoot + EXPERIMENT1_XPI_NAME; - this.xpiHash = data.xpiHash || EXPERIMENT1_XPI_SHA1; - this.appName = data.appName || ["XPCShell"]; - this.channel = data.appName || ["nightly"]; - this.startTime = data.startTime || new Date(2010, 0, 1, 12).getTime() / 1000; - this.endTime = data.endTime || new Date(9001, 0, 1, 12).getTime() / 1000; - this.maxActiveSeconds = data.maxActiveSeconds || 5 * SEC_IN_ONE_DAY; -} - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - gPolicy = new Experiments.Policy(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gHttpServer.registerDirectory("/", do_get_cwd()); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - }); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); -}); - -function isApplicable(experiment) { - let deferred = Promise.defer(); - experiment.isApplicable().then( - result => deferred.resolve({ applicable: true, reason: null }), - reason => deferred.resolve({ applicable: false, reason: reason }) - ); - - return deferred.promise; -} - -add_task(function* test_startStop() { - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 30 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 60 * MS_IN_ONE_DAY); - let manifestData = new ManifestEntry({ - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - }); - let experiment = new Experiments.ExperimentEntry(gPolicy); - experiment.initFromManifestData(manifestData); - - // We need to associate it with the singleton so the onInstallStarted - // Addon Manager listener will know about it. - Experiments.instance()._experiments = new Map(); - Experiments.instance()._experiments.set(experiment.id, experiment); - - let result; - - defineNow(gPolicy, baseDate); - result = yield isApplicable(experiment); - Assert.equal(result.applicable, false, "Experiment should not be applicable."); - Assert.equal(experiment.enabled, false, "Experiment should not be enabled."); - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons are installed."); - - defineNow(gPolicy, futureDate(startDate, 5 * MS_IN_ONE_DAY)); - result = yield isApplicable(experiment); - Assert.equal(result.applicable, true, "Experiment should now be applicable."); - Assert.equal(experiment.enabled, false, "Experiment should not be enabled."); - - let changes = yield experiment.start(); - Assert.equal(changes, experiment.ADDON_CHANGE_INSTALL, "Add-on was installed."); - addons = yield getExperimentAddons(); - Assert.equal(experiment.enabled, true, "Experiment should now be enabled."); - Assert.equal(addons.length, 1, "1 experiment add-on is installed."); - Assert.equal(addons[0].id, experiment._addonId, "The add-on is the one we expect."); - Assert.equal(addons[0].userDisabled, false, "The add-on is not userDisabled."); - Assert.ok(addons[0].isActive, "The add-on is active."); - - changes = yield experiment.stop(); - Assert.equal(changes, experiment.ADDON_CHANGE_UNINSTALL, "Add-on was uninstalled."); - addons = yield getExperimentAddons(); - Assert.equal(experiment.enabled, false, "Experiment should not be enabled."); - Assert.equal(addons.length, 0, "Experiment should be uninstalled from the Addon Manager."); - - changes = yield experiment.start(); - Assert.equal(changes, experiment.ADDON_CHANGE_INSTALL, "Add-on was installed."); - addons = yield getExperimentAddons(); - Assert.equal(experiment.enabled, true, "Experiment should now be enabled."); - Assert.equal(addons.length, 1, "1 experiment add-on is installed."); - Assert.equal(addons[0].id, experiment._addonId, "The add-on is the one we expect."); - Assert.equal(addons[0].userDisabled, false, "The add-on is not userDisabled."); - Assert.ok(addons[0].isActive, "The add-on is active."); - - result = yield experiment.shouldStop(); - Assert.equal(result.shouldStop, false, "shouldStop should be false."); - Assert.equal(experiment.enabled, true, "Experiment should be enabled."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "Experiment still in add-ons manager."); - Assert.ok(addons[0].isActive, "The add-on is still active."); - - defineNow(gPolicy, futureDate(endDate, MS_IN_ONE_DAY)); - result = yield experiment.shouldStop(); - Assert.equal(result.shouldStop, true, "shouldStop should now be true."); - changes = yield experiment.stop(); - Assert.equal(changes, experiment.ADDON_CHANGE_UNINSTALL, "Add-on should be uninstalled."); - Assert.equal(experiment.enabled, false, "Experiment should be disabled."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Experiment add-on is uninstalled."); - - // Ensure hash validation works. - // We set an incorrect hash and expect the install to fail. - experiment._manifestData.xpiHash = "sha1:41014dcc66b4dcedcd973491a1530a32f0517d8a"; - let errored = false; - try { - yield experiment.start(); - } catch (ex) { - errored = true; - } - Assert.ok(experiment._failedStart, "Experiment failed to start."); - Assert.ok(errored, "start() threw an exception."); - - // Make sure "ignore hashes" mode works. - gPolicy.ignoreHashes = true; - changes = yield experiment.start(); - Assert.equal(changes, experiment.ADDON_CHANGE_INSTALL); - yield experiment.stop(); - gPolicy.ignoreHashes = false; -}); diff --git a/browser/experiments/test/xpcshell/test_api.js b/browser/experiments/test/xpcshell/test_api.js deleted file mode 100644 index 9f0112570..000000000 --- a/browser/experiments/test/xpcshell/test_api.js +++ /dev/null @@ -1,1647 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource://testing-common/AddonManagerTesting.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); - -const MANIFEST_HANDLER = "manifests/handler"; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -var gHttpServer = null; -var gHttpRoot = null; -var gDataRoot = null; -var gPolicy = null; -var gManifestObject = null; -var gManifestHandlerURI = null; -var gTimerScheduleOffset = -1; - -function uninstallExperimentAddons() { - return Task.spawn(function* () { - let addons = yield getExperimentAddons(); - for (let a of addons) { - yield AddonManagerTesting.uninstallAddonByID(a.id); - } - }); -} - -function testCleanup(experimentsInstance) { - return Task.spawn(function* () { - yield promiseRestartManager(); - yield uninstallExperimentAddons(); - yield removeCacheFile(); - }); -} - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gDataRoot = gHttpRoot + "data/"; - gManifestHandlerURI = gHttpRoot + MANIFEST_HANDLER; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/" + MANIFEST_HANDLER, (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify(gManifestObject)); - response.processAsync(); - response.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, gManifestHandlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - gPolicy = new Experiments.Policy(); - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - oneshotTimer: (callback, timeout, thisObj, name) => gTimerScheduleOffset = timeout, - }); -}); - -add_task(function* test_contract() { - Cc["@mozilla.org/browser/experiments-service;1"].getService(); -}); - -// Test basic starting and stopping of experiments. - -add_task(function* test_getExperiments() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate1 = futureDate(baseDate, 50 * MS_IN_ONE_DAY); - let endDate1 = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let startDate2 = futureDate(baseDate, 150 * MS_IN_ONE_DAY); - let endDate2 = futureDate(baseDate, 200 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: dateToSeconds(startDate2), - endTime: dateToSeconds(endDate2), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate1), - endTime: dateToSeconds(endDate1), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - // Data to compare the result of Experiments.getExperiments() against. - - let experimentListData = [ - { - id: EXPERIMENT2_ID, - name: "Test experiment 2", - description: "And yet another experiment that experiments experimentally.", - }, - { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }, - ]; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - // Use updateManifest() to provide for coverage of that path. - - let now = baseDate; - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - Assert.equal(experiments.getActiveExperimentID(), null, - "getActiveExperimentID should return null"); - - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are installed."); - - try { - yield experiments.getExperimentBranch(); - Assert.ok(false, "getExperimentBranch should fail with no experiment"); - } - catch (e) { - Assert.ok(true, "getExperimentBranch correctly threw"); - } - - // Trigger update, clock set for experiment 1 to start. - - now = futureDate(startDate1, 5 * MS_IN_ONE_DAY); - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - Assert.equal(experiments.getActiveExperimentID(), EXPERIMENT1_ID, - "getActiveExperimentID should return the active experiment1"); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "An experiment add-on was installed."); - - experimentListData[1].active = true; - experimentListData[1].endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - for (let k of Object.keys(experimentListData[1])) { - Assert.equal(experimentListData[1][k], list[0][k], - "Property " + k + " should match reference data."); - } - - let b = yield experiments.getExperimentBranch(); - Assert.strictEqual(b, null, "getExperimentBranch should return null by default"); - - b = yield experiments.getExperimentBranch(EXPERIMENT1_ID); - Assert.strictEqual(b, null, "getExperimentsBranch should return null (with id)"); - - yield experiments.setExperimentBranch(EXPERIMENT1_ID, "foo"); - b = yield experiments.getExperimentBranch(); - Assert.strictEqual(b, "foo", "getExperimentsBranch should return the set value"); - - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - Assert.equal(gTimerScheduleOffset, 10 * MS_IN_ONE_DAY, - "Experiment re-evaluation should have been scheduled correctly."); - - // Trigger update, clock set for experiment 1 to stop. - - now = futureDate(endDate1, 1000); - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - Assert.equal(experiments.getActiveExperimentID(), null, - "getActiveExperimentID should return null again"); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "The experiment add-on should be uninstalled."); - - experimentListData[1].active = false; - experimentListData[1].endDate = now.getTime(); - for (let k of Object.keys(experimentListData[1])) { - Assert.equal(experimentListData[1][k], list[0][k], - "Property " + k + " should match reference data."); - } - - Assert.equal(gTimerScheduleOffset, startDate2 - now, - "Experiment re-evaluation should have been scheduled correctly."); - - // Trigger update, clock set for experiment 2 to start. - // Use notify() to provide for coverage of that path. - - now = startDate2; - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - - yield experiments.notify(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - Assert.equal(experiments.getActiveExperimentID(), EXPERIMENT2_ID, - "getActiveExperimentID should return the active experiment2"); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries now."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "An experiment add-on is installed."); - - experimentListData[0].active = true; - experimentListData[0].endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - for (let i=0; i<experimentListData.length; ++i) { - let entry = experimentListData[i]; - for (let k of Object.keys(entry)) { - Assert.equal(entry[k], list[i][k], - "Entry " + i + " - Property '" + k + "' should match reference data."); - } - } - - Assert.equal(gTimerScheduleOffset, 10 * MS_IN_ONE_DAY, - "Experiment re-evaluation should have been scheduled correctly."); - - // Trigger update, clock set for experiment 2 to stop. - - now = futureDate(startDate2, 10 * MS_IN_ONE_DAY + 1000); - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - yield experiments.notify(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - Assert.equal(experiments.getActiveExperimentID(), null, - "getActiveExperimentID should return null again2"); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries now."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiments add-ons are installed."); - - experimentListData[0].active = false; - experimentListData[0].endDate = now.getTime(); - for (let i=0; i<experimentListData.length; ++i) { - let entry = experimentListData[i]; - for (let k of Object.keys(entry)) { - Assert.equal(entry[k], list[i][k], - "Entry " + i + " - Property '" + k + "' should match reference data."); - } - } - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -add_task(function* test_getActiveExperimentID() { - // Check that getActiveExperimentID returns the correct result even - // after .uninit() - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate1 = futureDate(baseDate, 50 * MS_IN_ONE_DAY); - let endDate1 = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate1), - endTime: dateToSeconds(endDate1), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let now = futureDate(startDate1, 5 * MS_IN_ONE_DAY); - gTimerScheduleOffset = -1; - defineNow(gPolicy, now); - - let experiments = new Experiments.Experiments(gPolicy); - yield experiments.updateManifest(); - - Assert.equal(experiments.getActiveExperimentID(), EXPERIMENT1_ID, - "getActiveExperimentID should return the active experiment1"); - - yield promiseRestartManager(); - Assert.equal(experiments.getActiveExperimentID(), EXPERIMENT1_ID, - "getActiveExperimentID should return the active experiment1 after uninit()"); - - yield testCleanup(experiments); -}); - -// Test that we handle the experiments addon already being -// installed properly. -// We should just pave over them. - -add_task(function* test_addonAlreadyInstalled() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "1 add-on is installed."); - - // Install conflicting addon. - - yield AddonManagerTesting.installXPIFromURL(gDataRoot + EXPERIMENT1_XPI_NAME, EXPERIMENT1_XPI_SHA1); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "1 add-on is installed."); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should still have 1 entry."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -add_task(function* test_lastActiveToday() { - let experiments = new Experiments.Experiments(gPolicy); - - replaceExperiments(experiments, FAKE_EXPERIMENTS_1); - - let e = yield experiments.getExperiments(); - Assert.equal(e.length, 1, "Monkeypatch successful."); - Assert.equal(e[0].id, "id1", "ID looks sane"); - Assert.ok(e[0].active, "Experiment is active."); - - let lastActive = yield experiments.lastActiveToday(); - Assert.equal(e[0], lastActive, "Last active object is expected."); - - replaceExperiments(experiments, FAKE_EXPERIMENTS_2); - e = yield experiments.getExperiments(); - Assert.equal(e.length, 2, "Monkeypatch successful."); - - defineNow(gPolicy, e[0].endDate); - - lastActive = yield experiments.lastActiveToday(); - Assert.ok(lastActive, "Have a last active experiment"); - Assert.equal(lastActive, e[0], "Last active object is expected."); - - yield testCleanup(experiments); -}); - -// Test explicitly disabling experiments. - -add_task(function* test_disableExperiment() { - // Dates this test is based on. - - let startDate = new Date(2004, 10, 9, 12); - let endDate = futureDate(startDate, 100 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - // Data to compare the result of Experiments.getExperiments() against. - - let experimentInfo = { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set for the experiment to start. - - let now = futureDate(startDate, 5 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - - experimentInfo.active = true; - experimentInfo.endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - // Test disabling the experiment. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.disableExperiment("foo"); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - experimentInfo.active = false; - experimentInfo.endDate = now.getTime(); - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - // Test that updating the list doesn't re-enable it. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - yield testCleanup(experiments); -}); - -add_task(function* test_disableExperimentsFeature() { - // Dates this test is based on. - - let startDate = new Date(2004, 10, 9, 12); - let endDate = futureDate(startDate, 100 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - // Data to compare the result of Experiments.getExperiments() against. - - let experimentInfo = { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }; - - let experiments = new Experiments.Experiments(gPolicy); - Assert.equal(experiments.enabled, true, "Experiments feature should be enabled."); - - // Trigger update, clock set for the experiment to start. - - let now = futureDate(startDate, 5 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - - experimentInfo.active = true; - experimentInfo.endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - // Test disabling experiments. - - experiments._toggleExperimentsEnabled(false); - yield experiments.notify(); - Assert.equal(experiments.enabled, false, "Experiments feature should be disabled now."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - experimentInfo.active = false; - experimentInfo.endDate = now.getTime(); - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - // Test that updating the list doesn't re-enable it. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - try { - yield experiments.updateManifest(); - } catch (e) { - // Exception expected, the feature is disabled. - } - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - for (let k of Object.keys(experimentInfo)) { - Assert.equal(experimentInfo[k], list[0][k], - "Property " + k + " should match reference data."); - } - - yield testCleanup(experiments); -}); - -// Test that after a failed experiment install: -// * the next applicable experiment gets installed -// * changing the experiments data later triggers re-evaluation - -add_task(function* test_installFailure() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - // Data to compare the result of Experiments.getExperiments() against. - - let experimentListData = [ - { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }, - { - id: EXPERIMENT2_ID, - name: "Test experiment 2", - description: "And yet another experiment that experiments experimentally.", - }, - ]; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for experiment 1 & 2 to start, - // invalid hash for experiment 1. - // Order in the manifest matters, so we should start experiment 1, - // fail to install it & start experiment 2 instead. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].xpiHash = "sha1:0000000000000000000000000000000000000000"; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT2_ID, "Experiment 2 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 2 should be active."); - - // Trigger update, clock set for experiment 2 to stop. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - experimentListData[0].active = false; - experimentListData[0].endDate = now; - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT2_ID, "Experiment 2 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment should not be active."); - - // Trigger update with a fixed entry for experiment 1, - // which should get re-evaluated & started now. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].xpiHash = EXPERIMENT1_XPI_SHA1; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - experimentListData[0].active = true; - experimentListData[0].endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries now."); - - for (let i=0; i<experimentListData.length; ++i) { - let entry = experimentListData[i]; - for (let k of Object.keys(entry)) { - Assert.equal(entry[k], list[i][k], - "Entry " + i + " - Property '" + k + "' should match reference data."); - } - } - - yield testCleanup(experiments); -}); - -// Test that after an experiment was disabled by user action, -// the experiment is not activated again if manifest data changes. - -add_task(function* test_userDisabledAndUpdated() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for experiment 1 to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - let todayActive = yield experiments.lastActiveToday(); - Assert.ok(todayActive, "Last active for today reports a value."); - Assert.equal(todayActive.id, list[0].id, "The entry is what we expect."); - - // Explicitly disable an experiment. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.disableExperiment("foo"); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment should not be active anymore."); - todayActive = yield experiments.lastActiveToday(); - Assert.ok(todayActive, "Last active for today still returns a value."); - Assert.equal(todayActive.id, list[0].id, "The ID is still the same."); - - // Trigger an update with a faked change for experiment 1. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - experiments._experiments.get(EXPERIMENT1_ID)._manifestData.xpiHash = - "sha1:0000000000000000000000000000000000000000"; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, expectedObserverFireCount, - "Experiments observer should not have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment should still be inactive."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that changing the hash for an active experiments triggers an -// update for it. - -add_task(function* test_updateActiveExperiment() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - let todayActive = yield experiments.lastActiveToday(); - Assert.equal(todayActive, null, "No experiment active today."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - Assert.equal(list[0].name, EXPERIMENT1_NAME, "Experiments name should match."); - todayActive = yield experiments.lastActiveToday(); - Assert.ok(todayActive, "todayActive() returns a value."); - Assert.equal(todayActive.id, list[0].id, "It returns the active experiment."); - - // Trigger an update for the active experiment by changing it's hash (and xpi) - // in the manifest. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].xpiHash = EXPERIMENT1A_XPI_SHA1; - gManifestObject.experiments[0].xpiURL = gDataRoot + EXPERIMENT1A_XPI_NAME; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should still be active."); - Assert.equal(list[0].name, EXPERIMENT1A_NAME, "Experiments name should have been updated."); - todayActive = yield experiments.lastActiveToday(); - Assert.equal(todayActive.id, list[0].id, "last active today is still sane."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Tests that setting the disable flag for an active experiment -// stops it. - -add_task(function* test_disableActiveExperiment() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - - // Trigger an update with the experiment being disabled. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].disabled = true; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment 1 should be disabled."); - - // Check that the experiment stays disabled. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - delete gManifestObject.experiments[0].disabled; - yield experiments.updateManifest(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment 1 should still be disabled."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that: -// * setting the frozen flag for a not-yet-started experiment keeps -// it from starting -// * after a removing the frozen flag, the experiment can still start - -add_task(function* test_freezePendingExperiment() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start but frozen. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].frozen = true; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, expectedObserverFireCount, - "Experiments observer should have not been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should have no entries yet."); - - // Trigger an update with the experiment not being frozen anymore. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - delete gManifestObject.experiments[0].frozen; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active now."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that setting the frozen flag for an active experiment doesn't -// stop it. - -add_task(function* test_freezeActiveExperiment() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - Assert.equal(list[0].name, EXPERIMENT1_NAME, "Experiments name should match."); - - // Trigger an update with the experiment being disabled. - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].frozen = true; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should still be active."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that removing an active experiment from the manifest doesn't -// stop it. - -add_task(function* test_removeActiveExperiment() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - let startDate2 = futureDate(baseDate, 20000 * MS_IN_ONE_DAY); - let endDate2 = futureDate(baseDate, 30000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: dateToSeconds(startDate2), - endTime: dateToSeconds(endDate2), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - Assert.equal(list[0].name, EXPERIMENT1_NAME, "Experiments name should match."); - - // Trigger an update with experiment 1 missing from the manifest - - now = futureDate(now, 1 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].frozen = true; - yield experiments.updateManifest(); - Assert.equal(observerFireCount, expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should still be active."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that we correctly handle experiment start & install failures. - -add_task(function* test_invalidUrl() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME + ".invalid", - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: 0, - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set for the experiment to start. - - let now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gTimerScheduleOffset = null; - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - Assert.equal(gTimerScheduleOffset, null, "No new timer should have been scheduled."); - - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// Test that we handle it properly when active experiment addons are being -// uninstalled. - -add_task(function* test_unexpectedUninstall() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(baseDate, 10000 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Trigger update, clock set for the experiment to start. - - now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, true, "Experiment 1 should be active."); - - // Uninstall the addon through the addon manager instead of stopping it through - // the experiments API. - - yield AddonManagerTesting.uninstallAddonByID(EXPERIMENT1_ID); - yield experiments._mainTask; - - yield experiments.notify(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.equal(list[0].active, false, "Experiment 1 should not be active anymore."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield testCleanup(experiments); -}); - -// If the Addon Manager knows of an experiment that we don't, it should get -// uninstalled. -add_task(function* testUnknownExperimentsUninstalled() { - let experiments = new Experiments.Experiments(gPolicy); - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are present."); - - // Simulate us not listening. - experiments._unregisterWithAddonManager(); - yield AddonManagerTesting.installXPIFromURL(gDataRoot + EXPERIMENT1_XPI_NAME, EXPERIMENT1_XPI_SHA1); - experiments._registerWithAddonManager(); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "Experiment 1 installed via AddonManager"); - - // Simulate no known experiments. - gManifestObject = { - "version": 1, - experiments: [], - }; - - yield experiments.updateManifest(); - let fromManifest = yield experiments.getExperiments(); - Assert.equal(fromManifest.length, 0, "No experiments known in manifest."); - - // And the unknown add-on should be gone. - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Experiment 1 was uninstalled."); - - yield testCleanup(experiments); -}); - -// If someone else installs an experiment add-on, we detect and stop that. -add_task(function* testForeignExperimentInstall() { - let experiments = new Experiments.Experiments(gPolicy); - - gManifestObject = { - "version": 1, - experiments: [], - }; - - yield experiments.init(); - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons present."); - - let failed = false; - try { - yield AddonManagerTesting.installXPIFromURL(gDataRoot + EXPERIMENT1_XPI_NAME, EXPERIMENT1_XPI_SHA1); - } catch (ex) { - failed = true; - } - Assert.ok(failed, "Add-on install should not have completed successfully"); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Add-on install should have been cancelled."); - - yield testCleanup(experiments); -}); - -// Experiment add-ons will be disabled after Addon Manager restarts. Ensure -// we enable them automatically. -add_task(function* testEnabledAfterRestart() { - let experiments = new Experiments.Experiments(gPolicy); - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: gPolicy.now().getTime() / 1000 - 60, - endTime: gPolicy.now().getTime() / 1000 + 60, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons installed."); - - yield experiments.updateManifest(); - let fromManifest = yield experiments.getExperiments(); - Assert.equal(fromManifest.length, 1, "A single experiment is known."); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "A single experiment add-on is installed."); - Assert.ok(addons[0].isActive, "That experiment is active."); - - dump("Restarting Addon Manager\n"); - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "The experiment is still there after restart."); - Assert.ok(addons[0].userDisabled, "But it is disabled."); - Assert.equal(addons[0].isActive, false, "And not active."); - - yield experiments.updateManifest(); - Assert.ok(addons[0].isActive, "It activates when the manifest is evaluated."); - - yield testCleanup(experiments); -}); - -// If experiment add-ons were ever started, maxStartTime shouldn't be evaluated -// anymore. Ensure that if maxStartTime is passed but experiment has started -// already, maxStartTime does not cause deactivation. - -add_task(function* testMaxStartTimeEvaluation() { - - // Dates the following tests are based on. - - let startDate = new Date(2014, 5, 1, 12); - let now = futureDate(startDate, 10 * MS_IN_ONE_DAY); - let maxStartDate = futureDate(startDate, 100 * MS_IN_ONE_DAY); - let endDate = futureDate(startDate, 1000 * MS_IN_ONE_DAY); - - defineNow(gPolicy, now); - - // The manifest data we test with. - // We set a value for maxStartTime. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate), - endTime: dateToSeconds(endDate), - maxActiveSeconds: 1000 * SEC_IN_ONE_DAY, - maxStartTime: dateToSeconds(maxStartDate), - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons installed."); - - yield experiments.updateManifest(); - let fromManifest = yield experiments.getExperiments(); - Assert.equal(fromManifest.length, 1, "A single experiment is known."); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "A single experiment add-on is installed."); - Assert.ok(addons[0].isActive, "That experiment is active."); - - dump("Setting current time to maxStartTime + 100 days and reloading manifest\n"); - now = futureDate(maxStartDate, 100 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - yield experiments.updateManifest(); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "The experiment is still there."); - Assert.ok(addons[0].isActive, "It is still active."); - - yield testCleanup(experiments); -}); - -// Test coverage for an add-on uninstall disabling the experiment and that it stays -// disabled over restarts. -add_task(function* test_foreignUninstallAndRestart() { - let experiments = new Experiments.Experiments(gPolicy); - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: gPolicy.now().getTime() / 1000 - 60, - endTime: gPolicy.now().getTime() / 1000 + 60, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons installed."); - - yield experiments.updateManifest(); - let experimentList = yield experiments.getExperiments(); - Assert.equal(experimentList.length, 1, "A single experiment is known."); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "A single experiment add-on is installed."); - Assert.ok(addons[0].isActive, "That experiment is active."); - - yield AddonManagerTesting.uninstallAddonByID(EXPERIMENT1_ID); - yield experiments._mainTask; - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Experiment add-on should have been removed."); - - experimentList = yield experiments.getExperiments(); - Assert.equal(experimentList.length, 1, "A single experiment is known."); - Assert.equal(experimentList[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.ok(!experimentList[0].active, "Experiment 1 should not be active anymore."); - - // Fake restart behaviour. - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments.updateManifest(); - - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "No experiment add-ons installed."); - - experimentList = yield experiments.getExperiments(); - Assert.equal(experimentList.length, 1, "A single experiment is known."); - Assert.equal(experimentList[0].id, EXPERIMENT1_ID, "Experiment 1 should be the sole entry."); - Assert.ok(!experimentList[0].active, "Experiment 1 should not be active."); - - yield testCleanup(experiments); -}); diff --git a/browser/experiments/test/xpcshell/test_cache.js b/browser/experiments/test/xpcshell/test_cache.js deleted file mode 100644 index 4f2bce881..000000000 --- a/browser/experiments/test/xpcshell/test_cache.js +++ /dev/null @@ -1,399 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); - -const MANIFEST_HANDLER = "manifests/handler"; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -var gHttpServer = null; -var gHttpRoot = null; -var gDataRoot = null; -var gPolicy = null; -var gManifestObject = null; -var gManifestHandlerURI = null; - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - yield removeCacheFile(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gDataRoot = gHttpRoot + "data/"; - gManifestHandlerURI = gHttpRoot + MANIFEST_HANDLER; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/" + MANIFEST_HANDLER, (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify(gManifestObject)); - response.processAsync(); - response.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, gManifestHandlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - gPolicy = new Experiments.Policy(); - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - oneshotTimer: (callback, timeout, thisObj, name) => {}, - }); -}); - -function checkExperimentListsEqual(list, list2) { - Assert.equal(list.length, list2.length, "Lists should have the same length.") - - for (let i=0; i<list.length; ++i) { - for (let k of Object.keys(list[i])) { - Assert.equal(list[i][k], list2[i][k], - "Field '" + k + "' should match for list entry " + i + "."); - } - } -} - -function checkExperimentSerializations(experimentEntryIterator) { - for (let experiment of experimentEntryIterator) { - let experiment2 = new Experiments.ExperimentEntry(gPolicy); - let jsonStr = JSON.stringify(experiment.toJSON()); - Assert.ok(experiment2.initFromCacheData(JSON.parse(jsonStr)), - "Should have initialized successfully from JSON serialization."); - Assert.equal(JSON.stringify(experiment), JSON.stringify(experiment2), - "Object stringifications should match."); - } -} - -function validateCache(cachedExperiments, experimentIds) { - let cachedExperimentIds = new Set(cachedExperiments); - Assert.equal(cachedExperimentIds.size, experimentIds.length, - "The number of cached experiments does not match with the provided list"); - for (let id of experimentIds) { - Assert.ok(cachedExperimentIds.has(id), "The cache must contain the experiment with id " + id); - } -} - -// Set up an experiments instance and check if it is properly restored from cache. - -add_task(function* test_cache() { - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT3_ID, - xpiURL: "https://inval.id/foo.xpi", - xpiHash: "sha1:0000000000000000000000000000000000000000", - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - // Setup dates for the experiments. - - let baseDate = new Date(2014, 5, 1, 12); - let startDates = []; - let endDates = []; - - for (let i=0; i<gManifestObject.experiments.length; ++i) { - let experiment = gManifestObject.experiments[i]; - startDates.push(futureDate(baseDate, (50 + (150 * i)) * MS_IN_ONE_DAY)); - endDates .push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY)); - experiment.startTime = dateToSeconds(startDates[i]); - experiment.endTime = dateToSeconds(endDates[i]); - } - - // Data to compare the result of Experiments.getExperiments() against. - - let experimentListData = [ - { - id: EXPERIMENT2_ID, - name: "Test experiment 2", - description: "And yet another experiment that experiments experimentally.", - }, - { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }, - ]; - - // Trigger update & re-init, clock set to before any activation. - - let now = baseDate; - defineNow(gPolicy, now); - - let experiments = new Experiments.Experiments(gPolicy); - yield experiments.updateManifest(); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - checkExperimentSerializations(experiments._experiments.values()); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - - yield experiments._run(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - checkExperimentSerializations(experiments._experiments.values()); - - // Re-init, clock set for experiment 1 to start. - - now = futureDate(startDates[0], 5 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments._run(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - - experimentListData[1].active = true; - experimentListData[1].endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - checkExperimentListsEqual(experimentListData.slice(1), list); - checkExperimentSerializations(experiments._experiments.values()); - - let branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID); - Assert.strictEqual(branch, null); - - yield experiments.setExperimentBranch(EXPERIMENT1_ID, "testbranch"); - branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID); - Assert.strictEqual(branch, "testbranch"); - - // Re-init, clock set for experiment 1 to stop. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments._run(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - experimentListData[1].active = false; - experimentListData[1].endDate = now.getTime(); - checkExperimentListsEqual(experimentListData.slice(1), list); - checkExperimentSerializations(experiments._experiments.values()); - - branch = yield experiments.getExperimentBranch(EXPERIMENT1_ID); - Assert.strictEqual(branch, "testbranch"); - - // Re-init, clock set for experiment 2 to start. - - now = futureDate(startDates[1], 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments._run(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries."); - - experimentListData[0].active = true; - experimentListData[0].endDate = now.getTime() + 10 * MS_IN_ONE_DAY; - checkExperimentListsEqual(experimentListData, list); - checkExperimentSerializations(experiments._experiments.values()); - - // Re-init, clock set for experiment 2 to stop. - - now = futureDate(now, 20 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments._run(); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries."); - - experimentListData[0].active = false; - experimentListData[0].endDate = now.getTime(); - checkExperimentListsEqual(experimentListData, list); - checkExperimentSerializations(experiments._experiments.values()); - - // Cleanup. - - yield experiments._toggleExperimentsEnabled(false); - yield promiseRestartManager(); - yield removeCacheFile(); -}); - -add_task(function* test_expiration() { - // The manifest data we test with. - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - maxActiveSeconds: 50 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - // The 3rd experiment will never run, so it's ok to use experiment's 2 data. - { - id: EXPERIMENT3_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - } - ], - }; - - // Data to compare the result of Experiments.getExperiments() against. - let experimentListData = [ - { - id: EXPERIMENT2_ID, - name: "Test experiment 2", - description: "And yet another experiment that experiments experimentally.", - }, - { - id: EXPERIMENT1_ID, - name: EXPERIMENT1_NAME, - description: "Yet another experiment that experiments experimentally.", - }, - ]; - - // Setup dates for the experiments. - let baseDate = new Date(2014, 5, 1, 12); - let startDates = []; - let endDates = []; - - for (let i=0; i<gManifestObject.experiments.length; ++i) { - let experiment = gManifestObject.experiments[i]; - // Spread out experiments in time so that one experiment can end and expire while - // the next is still running. - startDates.push(futureDate(baseDate, (50 + (200 * i)) * MS_IN_ONE_DAY)); - endDates .push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY)); - experiment.startTime = dateToSeconds(startDates[i]); - experiment.endTime = dateToSeconds(endDates[i]); - } - - let now = null; - let experiments = null; - - let setDateAndRestartExperiments = new Task.async(function* (newDate) { - now = newDate; - defineNow(gPolicy, now); - - yield promiseRestartManager(); - experiments = new Experiments.Experiments(gPolicy); - yield experiments._run(); - }); - - // Trigger update & re-init, clock set to before any activation. - now = baseDate; - defineNow(gPolicy, now); - - experiments = new Experiments.Experiments(gPolicy); - yield experiments.updateManifest(); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - // Re-init, clock set for experiment 1 to start... - yield setDateAndRestartExperiments(startDates[0]); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "The first experiment should have started."); - - // ... init again, and set the clock so that the first experiment ends. - yield setDateAndRestartExperiments(endDates[0]); - - // The experiment just ended, it should still be in the cache, but marked - // as finished. - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - experimentListData[1].active = false; - experimentListData[1].endDate = now.getTime(); - checkExperimentListsEqual(experimentListData.slice(1), list); - validateCache([...experiments._experiments.keys()], [EXPERIMENT1_ID, EXPERIMENT2_ID, EXPERIMENT3_ID]); - - // Start the second experiment. - yield setDateAndRestartExperiments(startDates[1]); - - // The experiments cache should contain the finished experiment and the - // one that's still running. - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries."); - - experimentListData[0].active = true; - experimentListData[0].endDate = now.getTime() + 50 * MS_IN_ONE_DAY; - checkExperimentListsEqual(experimentListData, list); - - // Move the clock in the future, just 31 days after the start date of the second experiment, - // so that the cache for the first experiment expires and the second experiment is still running. - yield setDateAndRestartExperiments(futureDate(startDates[1], 31 * MS_IN_ONE_DAY)); - validateCache([...experiments._experiments.keys()], [EXPERIMENT2_ID, EXPERIMENT3_ID]); - - // Make sure that the expired experiment is not reported anymore. - let history = yield experiments.getExperiments(); - Assert.equal(history.length, 1, "Experiments older than 180 days must be removed from the cache."); - - // Test that we don't write expired experiments in the cache. - yield setDateAndRestartExperiments(now); - validateCache([...experiments._experiments.keys()], [EXPERIMENT2_ID, EXPERIMENT3_ID]); - - // The first experiment should be expired and not in the cache, it ended more than - // 180 days ago. We should see the one still running in the cache. - history = yield experiments.getExperiments(); - Assert.equal(history.length, 1, "Expired experiments must not be saved to cache."); - checkExperimentListsEqual(experimentListData.slice(0, 1), history); - - // Test that experiments that are cached locally but never ran are removed from cache - // when they are removed from the manifest (this is cached data, not really history). - gManifestObject["experiments"] = gManifestObject["experiments"].slice(1, 1); - yield experiments.updateManifest(); - validateCache([...experiments._experiments.keys()], [EXPERIMENT2_ID]); - - // Cleanup. - yield experiments._toggleExperimentsEnabled(false); - yield promiseRestartManager(); - yield removeCacheFile(); -}); diff --git a/browser/experiments/test/xpcshell/test_cacherace.js b/browser/experiments/test/xpcshell/test_cacherace.js deleted file mode 100644 index ff77cfdc4..000000000 --- a/browser/experiments/test/xpcshell/test_cacherace.js +++ /dev/null @@ -1,102 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource://gre/modules/Timer.jsm"); - -const MANIFEST_HANDLER = "manifests/handler"; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -var gHttpServer = null; -var gHttpRoot = null; -var gDataRoot = null; -var gPolicy = null; -var gManifestObject = null; -var gManifestHandlerURI = null; - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - yield removeCacheFile(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gDataRoot = gHttpRoot + "data/"; - gManifestHandlerURI = gHttpRoot + MANIFEST_HANDLER; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/" + MANIFEST_HANDLER, (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify(gManifestObject)); - response.processAsync(); - response.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, gManifestHandlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - let ExperimentsScope = Cu.import("resource:///modules/experiments/Experiments.jsm"); - let Experiments = ExperimentsScope.Experiments; - - gPolicy = new Experiments.Policy(); - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - delayCacheWrite: (promise) => { - return new Promise((resolve, reject) => { - promise.then( - (result) => { setTimeout(() => resolve(result), 500); }, - (err) => { reject(err); } - ); - }); - }, - }); - - let now = new Date(2014, 5, 1, 12); - defineNow(gPolicy, now); - - let experimentName = "experiment-racybranch.xpi"; - let experimentPath = getExperimentPath(experimentName); - let experimentHash = "sha1:" + sha1File(experimentPath); - - gManifestObject = { - version: 1, - experiments: [ - { - id: "test-experiment-racybranch@tests.mozilla.org", - xpiURL: gDataRoot + "experiment-racybranch.xpi", - xpiHash: experimentHash, - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - startTime: dateToSeconds(futureDate(now, -MS_IN_ONE_DAY)), - endTime: dateToSeconds(futureDate(now, MS_IN_ONE_DAY)), - }, - ], - }; - - do_print("gManifestObject: " + JSON.stringify(gManifestObject)); - - // In order for the addon manager to work properly, we hack - // Experiments.instance which is used by the XPIProvider - let experiments = new Experiments.Experiments(gPolicy); - Assert.strictEqual(ExperimentsScope.gExperiments, null); - ExperimentsScope.gExperiments = experiments; - - yield experiments.updateManifest(); - let active = experiments._getActiveExperiment(); - Assert.ok(active); - Assert.equal(active.branch, "racy-set"); - Assert.ok(!experiments._dirty); -}); diff --git a/browser/experiments/test/xpcshell/test_conditions.js b/browser/experiments/test/xpcshell/test_conditions.js deleted file mode 100644 index 23c147fdb..000000000 --- a/browser/experiments/test/xpcshell/test_conditions.js +++ /dev/null @@ -1,325 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - - -Cu.import("resource:///modules/experiments/Experiments.jsm"); -Cu.import("resource://gre/modules/TelemetryController.jsm", this); - -const SEC_IN_ONE_DAY = 24 * 60 * 60; - -var gPolicy = null; - -function ManifestEntry(data) { - this.id = EXPERIMENT1_ID; - this.xpiURL = "http://localhost:1/dummy.xpi"; - this.xpiHash = EXPERIMENT1_XPI_SHA1; - this.startTime = new Date(2010, 0, 1, 12).getTime() / 1000; - this.endTime = new Date(9001, 0, 1, 12).getTime() / 1000; - this.maxActiveSeconds = SEC_IN_ONE_DAY; - this.appName = ["XPCShell"]; - this.channel = ["nightly"]; - - data = data || {}; - for (let k of Object.keys(data)) { - this[k] = data[k]; - } - - if (!this.endTime) { - this.endTime = this.startTime + 5 * SEC_IN_ONE_DAY; - } -} - -function applicableFromManifestData(data, policy) { - let manifestData = new ManifestEntry(data); - let entry = new Experiments.ExperimentEntry(policy); - entry.initFromManifestData(manifestData); - return entry.isApplicable(); -} - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - createAppInfo(); - do_get_profile(); - startAddonManagerOnly(); - yield TelemetryController.testSetup(); - gPolicy = new Experiments.Policy(); - - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - locale: () => "en-US", - random: () => 0.5, - }); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); -}); - -function arraysEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - for (let i=0; i<a.length; ++i) { - if (a[i] !== b[i]) { - return false; - } - } - - return true; -} - -// This function exists solely to be .toSource()d -const sanityFilter = function filter(c) { - if (c.telemetryEnvironment === undefined) { - throw Error("No .telemetryEnvironment"); - } - if (c.telemetryEnvironment.build == undefined) { - throw Error("No .telemetryEnvironment.build"); - } - return true; -} - -// Utility function to generate build ID for previous/next date. -function addDate(buildId, diff) { - let m = /^([0-9]{4})([0-9]{2})([0-9]{2})(.*)$/.exec(buildId); - if (!m) { - throw Error("Unsupported build ID: " + buildId); - } - let year = Number.parseInt(m[1], 10); - let month = Number.parseInt(m[2], 10); - let date = Number.parseInt(m[3], 10); - let remainingParts = m[4]; - - let d = new Date(); - d.setUTCFullYear(year, month - 1, date); - d.setTime(d.getTime() + diff * 24 * 60 * 60 * 1000); - - let yearStr = String(d.getUTCFullYear()); - let monthStr = ("0" + String(d.getUTCMonth() + 1)).slice(-2); - let dateStr = ("0" + String(d.getUTCDate())).slice(-2); - return yearStr + monthStr + dateStr + remainingParts; -} -function prevDate(buildId) { - return addDate(buildId, -1); -} -function nextDate(buildId) { - return addDate(buildId, 1); -} - -add_task(function* test_simpleFields() { - let testData = [ - // "expected applicable?", failure reason or null, manifest data - - // misc. environment - - [false, ["appName"], {appName: []}], - [false, ["appName"], {appName: ["foo", gAppInfo.name + "-invalid"]}], - [true, null, {appName: ["not-an-app-name", gAppInfo.name]}], - - [false, ["os"], {os: []}], - [false, ["os"], {os: ["42", "abcdef"]}], - [true, null, {os: [gAppInfo.OS, "plan9"]}], - - [false, ["channel"], {channel: []}], - [false, ["channel"], {channel: ["foo", gPolicy.updatechannel() + "-invalid"]}], - [true, null, {channel: ["not-a-channel", gPolicy.updatechannel()]}], - - [false, ["locale"], {locale: []}], - [false, ["locale"], {locale: ["foo", gPolicy.locale + "-invalid"]}], - [true, null, {locale: ["not-a-locale", gPolicy.locale()]}], - - // version - - [false, ["version"], {version: []}], - [false, ["version"], {version: ["-1", gAppInfo.version + "-invalid", "asdf", "0,4", "99.99", "0.1.1.1"]}], - [true, null, {version: ["99999999.999", "-1", gAppInfo.version]}], - - [false, ["minVersion"], {minVersion: "1.0.1"}], - [true, null, {minVersion: "1.0b1"}], - [true, null, {minVersion: "1.0"}], - [true, null, {minVersion: "0.9"}], - - [false, ["maxVersion"], {maxVersion: "0.1"}], - [false, ["maxVersion"], {maxVersion: "0.9.9"}], - [false, ["maxVersion"], {maxVersion: "1.0b1"}], - [true, ["maxVersion"], {maxVersion: "1.0"}], - [true, ["maxVersion"], {maxVersion: "1.7pre"}], - - // build id - - [false, ["buildIDs"], {buildIDs: []}], - [false, ["buildIDs"], {buildIDs: ["not-a-build-id", gAppInfo.platformBuildID + "-invalid"]}], - [true, null, {buildIDs: ["not-a-build-id", gAppInfo.platformBuildID]}], - - [true, null, {minBuildID: prevDate(gAppInfo.platformBuildID)}], - [true, null, {minBuildID: gAppInfo.platformBuildID}], - [false, ["minBuildID"], {minBuildID: nextDate(gAppInfo.platformBuildID)}], - - [false, ["maxBuildID"], {maxBuildID: prevDate(gAppInfo.platformBuildID)}], - [true, null, {maxBuildID: gAppInfo.platformBuildID}], - [true, null, {maxBuildID: nextDate(gAppInfo.platformBuildID)}], - - // sample - - [false, ["sample"], {sample: -1 }], - [false, ["sample"], {sample: 0.0}], - [false, ["sample"], {sample: 0.1}], - [true, null, {sample: 0.5}], - [true, null, {sample: 0.6}], - [true, null, {sample: 1.0}], - [true, null, {sample: 0.5}], - - // experiment control - - [false, ["disabled"], {disabled: true}], - [true, null, {disabled: false}], - - [false, ["frozen"], {frozen: true}], - [true, null, {frozen: false}], - - [false, null, {frozen: true, disabled: true}], - [false, null, {frozen: true, disabled: false}], - [false, null, {frozen: false, disabled: true}], - [true, null, {frozen: false, disabled: false}], - - // jsfilter - - [true, null, {jsfilter: "function filter(c) { return true; }"}], - [false, ["jsfilter-false"], {jsfilter: "function filter(c) { return false; }"}], - [true, null, {jsfilter: "function filter(c) { return 123; }"}], // truthy - [false, ["jsfilter-false"], {jsfilter: "function filter(c) { return ''; }"}], // falsy - [false, ["jsfilter-false"], {jsfilter: "function filter(c) { var a = []; }"}], // undefined - [false, ["jsfilter-threw", "some error"], {jsfilter: "function filter(c) { throw new Error('some error'); }"}], - [false, ["jsfilter-evalfailed"], {jsfilter: "123, this won't work"}], - [true, null, {jsfilter: "var filter = " + sanityFilter.toSource()}], - ]; - - for (let i=0; i<testData.length; ++i) { - let entry = testData[i]; - let applicable; - let reason = null; - - yield applicableFromManifestData(entry[2], gPolicy).then( - value => applicable = value, - value => { - applicable = false; - reason = value; - } - ); - - Assert.equal(applicable, entry[0], - "Experiment entry applicability should match for test " - + i + ": " + JSON.stringify(entry[2])); - - let expectedReason = entry[1]; - if (!applicable && expectedReason) { - Assert.ok(arraysEqual(reason, expectedReason), - "Experiment rejection reasons should match for test " + i + ". " - + "Got " + JSON.stringify(reason) + ", expected " - + JSON.stringify(expectedReason)); - } - } -}); - -add_task(function* test_times() { - let now = new Date(2014, 5, 6, 12); - let nowSec = now.getTime() / 1000; - let testData = [ - // "expected applicable?", rejection reason or null, fake now date, manifest data - - // start time - - [true, null, now, - {startTime: nowSec - 5 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {startTime: nowSec, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [false, "startTime", now, - {startTime: nowSec + 5 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - - // end time - - [false, "endTime", now, - {startTime: nowSec - 5 * SEC_IN_ONE_DAY, - endTime: nowSec - 10 * SEC_IN_ONE_DAY}], - [false, "endTime", now, - {startTime: nowSec - 5 * SEC_IN_ONE_DAY, - endTime: nowSec - 5 * SEC_IN_ONE_DAY}], - - // max start time - - [false, "maxStartTime", now, - {maxStartTime: nowSec - 15 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [false, "maxStartTime", now, - {maxStartTime: nowSec - 1 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [false, "maxStartTime", now, - {maxStartTime: nowSec - 10 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {maxStartTime: nowSec, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {maxStartTime: nowSec + 1 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - - // max active seconds - - [true, null, now, - {maxActiveSeconds: 5 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {maxActiveSeconds: 15 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - [true, null, now, - {maxActiveSeconds: 20 * SEC_IN_ONE_DAY, - startTime: nowSec - 10 * SEC_IN_ONE_DAY, - endTime: nowSec + 10 * SEC_IN_ONE_DAY}], - ]; - - for (let i=0; i<testData.length; ++i) { - let entry = testData[i]; - let applicable; - let reason = null; - defineNow(gPolicy, entry[2]); - - yield applicableFromManifestData(entry[3], gPolicy).then( - value => applicable = value, - value => { - applicable = false; - reason = value; - } - ); - - Assert.equal(applicable, entry[0], - "Experiment entry applicability should match for test " - + i + ": " + JSON.stringify([entry[2], entry[3]])); - if (!applicable && entry[1]) { - Assert.equal(reason, entry[1], "Experiment rejection reason should match for test " + i); - } - } -}); - -add_task(function* test_shutdown() { - yield TelemetryController.testShutdown(); -}); diff --git a/browser/experiments/test/xpcshell/test_disableExperiments.js b/browser/experiments/test/xpcshell/test_disableExperiments.js deleted file mode 100644 index 8441b922d..000000000 --- a/browser/experiments/test/xpcshell/test_disableExperiments.js +++ /dev/null @@ -1,180 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource://testing-common/AddonManagerTesting.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "Experiments", - "resource:///modules/experiments/Experiments.jsm"); - -const MANIFEST_HANDLER = "manifests/handler"; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - -var gHttpServer = null; -var gHttpRoot = null; -var gDataRoot = null; -var gPolicy = null; -var gManifestObject = null; -var gManifestHandlerURI = null; - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gDataRoot = gHttpRoot + "data/"; - gManifestHandlerURI = gHttpRoot + MANIFEST_HANDLER; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/" + MANIFEST_HANDLER, (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify(gManifestObject)); - response.processAsync(); - response.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, gManifestHandlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - gPolicy = new Experiments.Policy(); - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - oneshotTimer: (callback, timeout, thisObj, name) => {}, - }); -}); - -// Test disabling the feature stops current and future experiments. - -add_task(function* test_disableExperiments() { - const OBSERVER_TOPIC = "experiments-changed"; - let observerFireCount = 0; - let expectedObserverFireCount = 0; - let observer = () => ++observerFireCount; - Services.obs.addObserver(observer, OBSERVER_TOPIC, false); - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate1 = futureDate(baseDate, 50 * MS_IN_ONE_DAY); - let endDate1 = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let startDate2 = futureDate(baseDate, 150 * MS_IN_ONE_DAY); - let endDate2 = futureDate(baseDate, 200 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: dateToSeconds(startDate2), - endTime: dateToSeconds(endDate2), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate1), - endTime: dateToSeconds(endDate1), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - // Use updateManifest() to provide for coverage of that path. - - let now = baseDate; - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - let addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "Precondition: No experiment add-ons are installed."); - - // Trigger update, clock set for experiment 1 to start. - - now = futureDate(startDate1, 5 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - Assert.equal(list[0].active, true, "Experiment should be active."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 1, "An experiment add-on was installed."); - - // Disable the experiments feature. Check that we stop the running experiment. - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, false); - yield experiments._mainTask; - - Assert.equal(observerFireCount, ++expectedObserverFireCount, - "Experiments observer should have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - Assert.equal(list[0].active, false, "Experiment entry should not be active."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "The experiment add-on should be uninstalled."); - - // Trigger update, clock set for experiment 2 to start. Verify we don't start it. - - now = startDate2; - defineNow(gPolicy, now); - - try { - yield experiments.updateManifest(); - } catch (e) { - // This exception is expected, we rethrow everything else - if (e.message != "experiments are disabled") { - throw e; - } - } - - experiments.notify(); - yield experiments._mainTask; - - Assert.equal(observerFireCount, expectedObserverFireCount, - "Experiments observer should not have been called."); - - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should still have 1 entry."); - Assert.equal(list[0].active, false, "Experiment entry should not be active."); - addons = yield getExperimentAddons(); - Assert.equal(addons.length, 0, "There should still be no experiment add-on installed."); - - // Cleanup. - - Services.obs.removeObserver(observer, OBSERVER_TOPIC); - yield promiseRestartManager(); - yield removeCacheFile(); -}); diff --git a/browser/experiments/test/xpcshell/test_fetch.js b/browser/experiments/test/xpcshell/test_fetch.js deleted file mode 100644 index e8d76fa35..000000000 --- a/browser/experiments/test/xpcshell/test_fetch.js +++ /dev/null @@ -1,68 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/osfile.jsm"); -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -var gHttpServer = null; -var gHttpRoot = null; -var gPolicy = new Experiments.Policy(); - -function run_test() { - loadAddonManager(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gHttpServer.registerDirectory("/", do_get_cwd()); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - }); - - run_next_test(); -} - -add_task(function* test_fetchAndCache() { - Services.prefs.setCharPref(PREF_MANIFEST_URI, gHttpRoot + "experiments_1.manifest"); - let ex = new Experiments.Experiments(gPolicy); - - Assert.equal(ex._experiments, null, "There should be no cached experiments yet."); - yield ex.updateManifest(); - Assert.notEqual(ex._experiments.size, 0, "There should be cached experiments now."); - - yield promiseRestartManager(); -}); - -add_task(function* test_checkCache() { - let ex = new Experiments.Experiments(gPolicy); - yield ex.notify(); - Assert.notEqual(ex._experiments.size, 0, "There should be cached experiments now."); - - yield promiseRestartManager(); -}); - -add_task(function* test_fetchInvalid() { - yield removeCacheFile(); - - Services.prefs.setCharPref(PREF_MANIFEST_URI, gHttpRoot + "experiments_1.manifest"); - let ex = new Experiments.Experiments(gPolicy); - yield ex.updateManifest(); - Assert.notEqual(ex._experiments.size, 0, "There should be experiments"); - - Services.prefs.setCharPref(PREF_MANIFEST_URI, gHttpRoot + "invalid.manifest"); - yield ex.updateManifest() - Assert.notEqual(ex._experiments.size, 0, "There should still be experiments: fetch failure shouldn't remove them."); - - yield promiseRestartManager(); -}); diff --git a/browser/experiments/test/xpcshell/test_nethang_bug1012924.js b/browser/experiments/test/xpcshell/test_nethang_bug1012924.js deleted file mode 100644 index 7ef604901..000000000 --- a/browser/experiments/test/xpcshell/test_nethang_bug1012924.js +++ /dev/null @@ -1,47 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -const MANIFEST_HANDLER = "manifests/handler"; - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - do_get_profile(); - - let httpServer = new HttpServer(); - httpServer.start(-1); - let port = httpServer.identity.primaryPort; - let httpRoot = "http://localhost:" + port + "/"; - let handlerURI = httpRoot + MANIFEST_HANDLER; - httpServer.registerPathHandler("/" + MANIFEST_HANDLER, - (request, response) => { - response.processAsync(); - response.setStatus(null, 200, "OK"); - response.write("["); // never finish! - }); - - do_register_cleanup(() => httpServer.stop(() => {})); - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, handlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - let experiments = Experiments.instance(); - experiments.updateManifest().then( - () => { - Assert.ok(true, "updateManifest finished successfully"); - }, - (e) => { - do_throw("updateManifest should not have failed: got error " + e); - }); - yield experiments.uninit(); -}); diff --git a/browser/experiments/test/xpcshell/test_previous_provider.js b/browser/experiments/test/xpcshell/test_previous_provider.js deleted file mode 100644 index f7186e159..000000000 --- a/browser/experiments/test/xpcshell/test_previous_provider.js +++ /dev/null @@ -1,179 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource:///modules/experiments/Experiments.jsm"); -Cu.import("resource://testing-common/httpd.js"); - -var gDataRoot; -var gHttpServer; -var gManifestObject; - -function run_test() { - run_next_test(); -} - -add_task(function test_setup() { - loadAddonManager(); - do_get_profile(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let httpRoot = "http://localhost:" + gHttpServer.identity.primaryPort + "/"; - gDataRoot = httpRoot + "data/"; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/manifests/handler", (req, res) => { - res.setStatusLine(null, 200, "OK"); - res.write(JSON.stringify(gManifestObject)); - res.processAsync(); - res.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref("experiments.enabled", true); - Services.prefs.setCharPref("experiments.manifest.uri", - httpRoot + "manifests/handler"); - Services.prefs.setBoolPref("experiments.logging.dump", true); - Services.prefs.setCharPref("experiments.logging.level", "Trace"); -}); - -add_task(function* test_provider_basic() { - let e = Experiments.instance(); - - let provider = new Experiments.PreviousExperimentProvider(e); - e._setPreviousExperimentsProvider(provider); - - let deferred = Promise.defer(); - provider.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - let experimentAddons = yield deferred.promise; - Assert.ok(Array.isArray(experimentAddons), "getAddonsByTypes returns an Array."); - Assert.equal(experimentAddons.length, 0, "No previous add-ons returned."); - - gManifestObject = { - version: 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: Date.now() / 1000 - 60, - endTime: Date.now() / 1000 + 60, - maxActiveSeconds: 60, - appName: ["XPCShell"], - channel: [e._policy.updatechannel()], - }, - ], - }; - - yield e.updateManifest(); - - deferred = Promise.defer(); - provider.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - experimentAddons = yield deferred.promise; - Assert.equal(experimentAddons.length, 0, "Still no previous experiment."); - - let experiments = yield e.getExperiments(); - Assert.equal(experiments.length, 1, "1 experiment present."); - Assert.ok(experiments[0].active, "It is active."); - - // Deactivate it. - defineNow(e._policy, new Date(gManifestObject.experiments[0].endTime * 1000 + 1000)); - yield e.updateManifest(); - - experiments = yield e.getExperiments(); - Assert.equal(experiments.length, 1, "1 experiment present."); - Assert.equal(experiments[0].active, false, "It isn't active."); - - deferred = Promise.defer(); - provider.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - experimentAddons = yield deferred.promise; - Assert.equal(experimentAddons.length, 1, "1 previous add-on known."); - Assert.equal(experimentAddons[0].id, EXPERIMENT1_ID, "ID matches expected."); - - deferred = Promise.defer(); - provider.getAddonByID(EXPERIMENT1_ID, (addon) => { - deferred.resolve(addon); - }); - let addon = yield deferred.promise; - Assert.ok(addon, "We got an add-on from its ID."); - Assert.equal(addon.id, EXPERIMENT1_ID, "ID matches expected."); - Assert.ok(addon.appDisabled, "Add-on is a previous experiment."); - Assert.ok(addon.userDisabled, "Add-on is disabled."); - Assert.equal(addon.type, "experiment", "Add-on is an experiment."); - Assert.equal(addon.isActive, false, "Add-on is not active."); - Assert.equal(addon.permissions, 0, "Add-on has no permissions."); - - deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - experimentAddons = yield deferred.promise; - Assert.equal(experimentAddons.length, 1, "Got 1 experiment from add-on manager."); - Assert.equal(experimentAddons[0].id, EXPERIMENT1_ID, "ID matches expected."); - Assert.ok(experimentAddons[0].appDisabled, "It is a previous experiment add-on."); -}); - -add_task(function* test_active_and_previous() { - // Building on the previous test, activate experiment 2. - let e = Experiments.instance(); - let provider = new Experiments.PreviousExperimentProvider(e); - e._setPreviousExperimentsProvider(provider); - - gManifestObject = { - version: 1, - experiments: [ - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: Date.now() / 1000 - 60, - endTime: Date.now() / 1000 + 60, - maxActiveSeconds: 60, - appName: ["XPCShell"], - channel: [e._policy.updatechannel()], - }, - ], - }; - - defineNow(e._policy, new Date()); - yield e.updateManifest(); - - let experiments = yield e.getExperiments(); - Assert.equal(experiments.length, 2, "2 experiments known."); - - let deferred = Promise.defer(); - provider.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - let experimentAddons = yield deferred.promise; - Assert.equal(experimentAddons.length, 1, "1 previous experiment."); - - deferred = Promise.defer(); - AddonManager.getAddonsByTypes(["experiment"], (addons) => { - deferred.resolve(addons); - }); - experimentAddons = yield deferred.promise; - Assert.equal(experimentAddons.length, 2, "2 experiment add-ons known."); - - for (let addon of experimentAddons) { - if (addon.id == EXPERIMENT1_ID) { - Assert.equal(addon.isActive, false, "Add-on is not active."); - Assert.ok(addon.appDisabled, "Should be a previous experiment."); - } - else if (addon.id == EXPERIMENT2_ID) { - Assert.ok(addon.isActive, "Add-on is active."); - Assert.ok(!addon.appDisabled, "Should not be a previous experiment."); - } - else { - throw new Error("Unexpected add-on ID: " + addon.id); - } - } -}); diff --git a/browser/experiments/test/xpcshell/test_telemetry.js b/browser/experiments/test/xpcshell/test_telemetry.js deleted file mode 100644 index 02bd15d2b..000000000 --- a/browser/experiments/test/xpcshell/test_telemetry.js +++ /dev/null @@ -1,294 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource://testing-common/httpd.js"); -Cu.import("resource://gre/modules/TelemetryLog.jsm"); -var bsp = Cu.import("resource:///modules/experiments/Experiments.jsm"); - - -const MANIFEST_HANDLER = "manifests/handler"; - -const SEC_IN_ONE_DAY = 24 * 60 * 60; -const MS_IN_ONE_DAY = SEC_IN_ONE_DAY * 1000; - - -var gHttpServer = null; -var gHttpRoot = null; -var gDataRoot = null; -var gPolicy = null; -var gManifestObject = null; -var gManifestHandlerURI = null; - -const TLOG = bsp.TELEMETRY_LOG; - -function checkEvent(event, id, data) -{ - do_print("Checking message " + id); - Assert.equal(event[0], id, "id should match"); - Assert.ok(event[1] > 0, "timestamp should be greater than 0"); - - if (data === undefined) { - Assert.equal(event.length, 2, "event array should have 2 entries"); - } else { - Assert.equal(event.length, data.length + 2, "event entry count should match expected count"); - for (var i = 0; i < data.length; ++i) { - Assert.equal(typeof(event[i + 2]), "string", "event entry should be a string"); - Assert.equal(event[i + 2], data[i], "event entry should match expected entry"); - } - } -} - -function run_test() { - run_next_test(); -} - -add_task(function* test_setup() { - loadAddonManager(); - - gHttpServer = new HttpServer(); - gHttpServer.start(-1); - let port = gHttpServer.identity.primaryPort; - gHttpRoot = "http://localhost:" + port + "/"; - gDataRoot = gHttpRoot + "data/"; - gManifestHandlerURI = gHttpRoot + MANIFEST_HANDLER; - gHttpServer.registerDirectory("/data/", do_get_cwd()); - gHttpServer.registerPathHandler("/" + MANIFEST_HANDLER, (request, response) => { - response.setStatusLine(null, 200, "OK"); - response.write(JSON.stringify(gManifestObject)); - response.processAsync(); - response.finish(); - }); - do_register_cleanup(() => gHttpServer.stop(() => {})); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setIntPref(PREF_LOGGING_LEVEL, 0); - Services.prefs.setBoolPref(PREF_LOGGING_DUMP, true); - Services.prefs.setCharPref(PREF_MANIFEST_URI, gManifestHandlerURI); - Services.prefs.setIntPref(PREF_FETCHINTERVAL, 0); - - gPolicy = new Experiments.Policy(); - let dummyTimer = { cancel: () => {}, clear: () => {} }; - patchPolicy(gPolicy, { - updatechannel: () => "nightly", - oneshotTimer: (callback, timeout, thisObj, name) => dummyTimer, - }); - - yield removeCacheFile(); -}); - -// Test basic starting and stopping of experiments. - -add_task(function* test_telemetryBasics() { - // Check TelemetryLog instead of TelemetrySession.getPayload().log because - // TelemetrySession gets Experiments.instance() and side-effects log entries. - - let expectedLogLength = 0; - - // Dates the following tests are based on. - - let baseDate = new Date(2014, 5, 1, 12); - let startDate1 = futureDate(baseDate, 50 * MS_IN_ONE_DAY); - let endDate1 = futureDate(baseDate, 100 * MS_IN_ONE_DAY); - let startDate2 = futureDate(baseDate, 150 * MS_IN_ONE_DAY); - let endDate2 = futureDate(baseDate, 200 * MS_IN_ONE_DAY); - - // The manifest data we test with. - - gManifestObject = { - "version": 1, - experiments: [ - { - id: EXPERIMENT1_ID, - xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME, - xpiHash: EXPERIMENT1_XPI_SHA1, - startTime: dateToSeconds(startDate1), - endTime: dateToSeconds(endDate1), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - { - id: EXPERIMENT2_ID, - xpiURL: gDataRoot + EXPERIMENT2_XPI_NAME, - xpiHash: EXPERIMENT2_XPI_SHA1, - startTime: dateToSeconds(startDate2), - endTime: dateToSeconds(endDate2), - maxActiveSeconds: 10 * SEC_IN_ONE_DAY, - appName: ["XPCShell"], - channel: ["nightly"], - }, - ], - }; - - let experiments = new Experiments.Experiments(gPolicy); - - // Trigger update, clock set to before any activation. - // Use updateManifest() to provide for coverage of that path. - - let now = baseDate; - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - let list = yield experiments.getExperiments(); - Assert.equal(list.length, 0, "Experiment list should be empty."); - - expectedLogLength += 2; - let log = TelemetryLog.entries(); - do_print("Telemetry log: " + JSON.stringify(log)); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-2], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.REJECTED, EXPERIMENT1_ID, "startTime"]); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.REJECTED, EXPERIMENT2_ID, "startTime"]); - - // Trigger update, clock set for experiment 1 to start. - - now = futureDate(startDate1, 5 * MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry now."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries. Got " + log.toSource()); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.ACTIVATED, EXPERIMENT1_ID]); - - // Trigger update, clock set for experiment 1 to stop. - - now = futureDate(endDate1, 1000); - defineNow(gPolicy, now); - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entry."); - - expectedLogLength += 2; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-2], TLOG.TERMINATION_KEY, - [TLOG.TERMINATION.EXPIRED, EXPERIMENT1_ID]); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.REJECTED, EXPERIMENT2_ID, "startTime"]); - - // Trigger update, clock set for experiment 2 to start with invalid hash. - - now = startDate2; - defineNow(gPolicy, now); - gManifestObject.experiments[1].xpiHash = "sha1:0000000000000000000000000000000000000000"; - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 1, "Experiment list should have 1 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.INSTALL_FAILURE, EXPERIMENT2_ID]); - - // Trigger update, clock set for experiment 2 to properly start now. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[1].xpiHash = EXPERIMENT2_XPI_SHA1; - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.ACTIVATED, EXPERIMENT2_ID]); - - // Fake user uninstall of experiment via add-on manager. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield experiments.disableExperiment(TLOG.TERMINATION.ADDON_UNINSTALLED); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 2, "Experiment list should have 2 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.TERMINATION_KEY, - [TLOG.TERMINATION.ADDON_UNINSTALLED, EXPERIMENT2_ID]); - - // Trigger update with experiment 1a ready to start. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].id = EXPERIMENT3_ID; - gManifestObject.experiments[0].endTime = dateToSeconds(futureDate(now, 50 * MS_IN_ONE_DAY)); - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 3, "Experiment list should have 3 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.ACTIVATED, EXPERIMENT3_ID]); - - // Trigger disable of an experiment via the API. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - - yield experiments.disableExperiment(TLOG.TERMINATION.FROM_API); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 3, "Experiment list should have 3 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.TERMINATION_KEY, - [TLOG.TERMINATION.FROM_API, EXPERIMENT3_ID]); - - // Trigger update with experiment 1a ready to start. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].id = EXPERIMENT4_ID; - gManifestObject.experiments[0].endTime = dateToSeconds(futureDate(now, 50 * MS_IN_ONE_DAY)); - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 4, "Experiment list should have 4 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY, - [TLOG.ACTIVATION.ACTIVATED, EXPERIMENT4_ID]); - - // Trigger experiment termination by something other than expiry via the manifest. - - now = futureDate(now, MS_IN_ONE_DAY); - defineNow(gPolicy, now); - gManifestObject.experiments[0].os = "Plan9"; - - yield experiments.updateManifest(); - list = yield experiments.getExperiments(); - Assert.equal(list.length, 4, "Experiment list should have 4 entries."); - - expectedLogLength += 1; - log = TelemetryLog.entries(); - Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries."); - checkEvent(log[log.length-1], TLOG.TERMINATION_KEY, - [TLOG.TERMINATION.RECHECK, EXPERIMENT4_ID, "os"]); - - // Cleanup. - - yield promiseRestartManager(); - yield removeCacheFile(); -}); diff --git a/browser/experiments/test/xpcshell/test_telemetry_disabled.js b/browser/experiments/test/xpcshell/test_telemetry_disabled.js deleted file mode 100644 index 74f85ccfc..000000000 --- a/browser/experiments/test/xpcshell/test_telemetry_disabled.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -add_test(function test_experiments_activation() { - do_get_profile(); - loadAddonManager(); - - Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true); - Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, false); - - let experiments = Experiments.instance(); - Assert.ok(!experiments.enabled, "Experiments must be disabled if Telemetry is disabled."); - - // TODO: Test that Experiments are turned back on when bug 1232648 lands. - - run_next_test(); -}); diff --git a/browser/experiments/test/xpcshell/test_upgrade.js b/browser/experiments/test/xpcshell/test_upgrade.js deleted file mode 100644 index f094a406d..000000000 --- a/browser/experiments/test/xpcshell/test_upgrade.js +++ /dev/null @@ -1,52 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; -Cu.import("resource:///modules/experiments/Experiments.jsm"); - -var cacheData = { - _enabled: true, - _manifestData: { - id: "foobartestid", - xpiURL: "http://example.com/foo.xpi", - xpiHash: "sha256:abcde", - startTime: 0, - endTime: 2000000000, - maxActiveSeconds: 40000000, - appName: "TestApp", - channel: "test-foo", - }, - _needsUpdate: false, - _randomValue: 0.5, - _failedStart: false, - _name: "Foo", - _description: "Foobar", - _homepageURL: "", - _addonId: "foo@test", - _startDate: 0, - _endDate: 2000000000, - _branch: null -}; - -add_task(function* test_valid() { - let e = new Experiments.ExperimentEntry(); - Assert.ok(e.initFromCacheData(cacheData)); - Assert.ok(e.enabled); -}); - -add_task(function* test_upgrade() { - let e = new Experiments.ExperimentEntry(); - delete cacheData._branch; - Assert.ok(e.initFromCacheData(cacheData)); - Assert.ok(e.enabled); -}); - -add_task(function* test_missing() { - let e = new Experiments.ExperimentEntry(); - delete cacheData._name; - Assert.ok(!e.initFromCacheData(cacheData)); -}); - -function run_test() { - run_next_test(); -} diff --git a/browser/experiments/test/xpcshell/xpcshell.ini b/browser/experiments/test/xpcshell/xpcshell.ini deleted file mode 100644 index 5921c9c47..000000000 --- a/browser/experiments/test/xpcshell/xpcshell.ini +++ /dev/null @@ -1,31 +0,0 @@ -[DEFAULT] -head = head.js -tail = -tags = addons -firefox-appdir = browser -skip-if = toolkit == 'android' -support-files = - experiments_1.manifest - experiment-1.xpi - experiment-1a.xpi - experiment-2.xpi - experiment-racybranch.xpi - !/toolkit/mozapps/webextensions/test/xpcshell/head_addons.js -generated-files = - experiment-1.xpi - experiment-1a.xpi - experiment-2.xpi - experiment-racybranch.xpi - -[test_activate.js] -[test_api.js] -[test_cache.js] -[test_cacherace.js] -[test_conditions.js] -[test_disableExperiments.js] -[test_fetch.js] -[test_telemetry.js] -[test_telemetry_disabled.js] -[test_previous_provider.js] -[test_upgrade.js] -[test_nethang_bug1012924.js] diff --git a/browser/extensions/aushelper/bootstrap.js b/browser/extensions/aushelper/bootstrap.js deleted file mode 100644 index f57f621e1..000000000 --- a/browser/extensions/aushelper/bootstrap.js +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* 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; - -const APP_UPDATE_URL_PREF = "app.update.url"; -const REPLACE_KEY = "%OS_VERSION%"; - -const AUSHELPER_CPU_RESULT_CODE_HISTOGRAM_ID = "AUSHELPER_CPU_RESULT_CODE"; -// The system is not vulnerable to Bug 1296630. -const CPU_NO_BUG1296630 = 1; -// The system is vulnerable to Bug 1296630. -const CPU_YES_BUG1296630 = 2; -// An error occured when checking if the system is vulnerable to Bug 1296630. -const CPU_ERR_BUG1296630 = 3; -// It is unknown whether the system is vulnerable to Bug 1296630 (should never happen). -const CPU_UNKNOWN_BUG1296630 = 4; - -const AUSHELPER_CPU_ERROR_CODE_HISTOGRAM_ID = "AUSHELPER_CPU_ERROR_CODE"; -const CPU_SUCCESS = 0; -const CPU_REG_OPEN_ERROR = 1; -const CPU_VENDOR_ID_ERROR = 2; -const CPU_ID_ERROR = 4; -const CPU_REV_ERROR = 8; - -const AUSHELPER_WEBSENSE_REG_VERSION_SCALAR_NAME = "aushelper.websense_reg_version"; -const AUSHELPER_WEBSENSE_REG_EXISTS_HISTOGRAM_ID = "AUSHELPER_WEBSENSE_REG_EXISTS"; - -const AUSHELPER_WEBSENSE_ERROR_CODE_HISTOGRAM_ID = "AUSHELPER_WEBSENSE_ERROR_CODE"; -const WEBSENSE_SUCCESS = 0; -const WEBSENSE_REG_OPEN_ERROR = 1; -const WEBSENSE_REG_READ_ERROR = 2; -const WEBSENSE_ALREADY_MODIFIED = 4; - -Cu.import("resource://gre/modules/Services.jsm"); - -function startup() { - if (Services.appinfo.OS != "WINNT") { - return; - } - - const regCPUPath = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"; - let wrk; - let cpuErrorCode = CPU_SUCCESS; - try { - wrk = Cc["@mozilla.org/windows-registry-key;1"].createInstance(Ci.nsIWindowsRegKey); - wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE, regCPUPath, wrk.ACCESS_READ); - } catch (e) { - Cu.reportError("AUSHelper - unable to open registry. Exception: " + e); - cpuErrorCode |= CPU_REG_OPEN_ERROR; - } - - // If any of the following values are successfully retrieved and they don't - // match the condition for that value then it is safe to update. Hence why the - // following checks are somewhat convoluted. The possible values for the - // variable set by each check is as follows: - // - // | Match | No Match | Error | - // variable | true | false | null | - - let cpuVendorIDMatch = false; - try { - let cpuVendorID = wrk.readStringValue("VendorIdentifier"); - if (cpuVendorID.toLowerCase() == "genuineintel") { - cpuVendorIDMatch = true; - } - } catch (e) { - Cu.reportError("AUSHelper - error getting CPU vendor indentifier. Exception: " + e); - cpuVendorIDMatch = null; - cpuErrorCode |= CPU_VENDOR_ID_ERROR; - } - - let cpuIDMatch = false; - try { - let cpuID = wrk.readStringValue("Identifier"); - if (cpuID.toLowerCase().indexOf("family 6 model 61 stepping 4") != -1) { - cpuIDMatch = true; - } - } catch (e) { - Cu.reportError("AUSHelper - error getting CPU indentifier. Exception: " + e); - cpuIDMatch = null; - cpuErrorCode |= CPU_ID_ERROR; - } - - let microCodeVersions = [0xe, 0x11, 0x12, 0x13, 0x16, 0x18, 0x19]; - let cpuRevMatch = null; - try { - let keyNames = ["Update Revision", "Update Signature"]; - for (let i = 0; i < keyNames.length; ++i) { - try { - let regVal = wrk.readBinaryValue(keyNames[i]); - if (regVal.length == 8) { - let hexVal = []; - // We are only inyterested in the upper 4 bytes and the little endian - // value for it. - for (let j = 4; j < 8; j++) { - let c = regVal.charCodeAt(j).toString(16); - if (c.length == 1) { - c = "0" + c; - } - hexVal.unshift(c); - } - cpuRevMatch = false; - if (microCodeVersions.indexOf(parseInt(hexVal.join(''))) != -1) { - cpuRevMatch = true; - } - break; - } - } catch (e) { - if (i == keyNames.length - 1) { - // The registry key name's value was not successfully queried. - cpuRevMatch = null; - cpuErrorCode |= CPU_REV_ERROR; - } - } - } - wrk.close(); - } catch (ex) { - Cu.reportError("AUSHelper - error getting CPU revision. Exception: " + ex); - cpuRevMatch = null; - cpuErrorCode |= CPU_REV_ERROR; - } - - let cpuResult = CPU_UNKNOWN_BUG1296630; - let cpuValue = "(unkBug1296630v1)"; - // The following uses strict equality checks since the values can be true, - // false, or null. - if (cpuVendorIDMatch === false || cpuIDMatch === false || cpuRevMatch === false) { - // Since one of the values is false then the system won't be affected by - // bug 1296630 according to the conditions set out in bug 1311515. - cpuValue = "(noBug1296630v1)"; - cpuResult = CPU_NO_BUG1296630; - } else if (cpuVendorIDMatch === null || cpuIDMatch === null || cpuRevMatch === null) { - // Since one of the values is null we can't say for sure if the system will - // be affected by bug 1296630. - cpuValue = "(errBug1296630v1)"; - cpuResult = CPU_ERR_BUG1296630; - } else if (cpuVendorIDMatch === true && cpuIDMatch === true && cpuRevMatch === true) { - // Since all of the values are true we can say that the system will be - // affected by bug 1296630. - cpuValue = "(yesBug1296630v1)"; - cpuResult = CPU_YES_BUG1296630; - } - - Services.telemetry.getHistogramById(AUSHELPER_CPU_RESULT_CODE_HISTOGRAM_ID).add(cpuResult); - Services.telemetry.getHistogramById(AUSHELPER_CPU_ERROR_CODE_HISTOGRAM_ID).add(cpuErrorCode); - - const regWebsensePath = "Websense\\Agent"; - let websenseErrorCode = WEBSENSE_SUCCESS; - let websenseVersion = ""; - try { - let regModes = [wrk.ACCESS_READ, wrk.ACCESS_READ | wrk.WOW64_64]; - for (let i = 0; i < regModes.length; ++i) { - wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE", regModes[i]); - try { - if (wrk.hasChild(regWebsensePath)) { - let childKey = wrk.openChild(regWebsensePath, wrk.ACCESS_READ); - websenseVersion = childKey.readStringValue("InstallVersion"); - Services.telemetry.scalarSet(AUSHELPER_WEBSENSE_REG_VERSION_SCALAR_NAME, websenseVersion); - } - wrk.close(); - } catch (e) { - Cu.reportError("AUSHelper - unable to read registry. Exception: " + e); - websenseErrorCode |= WEBSENSE_REG_READ_ERROR; - } - } - } catch (ex) { - Cu.reportError("AUSHelper - unable to open registry. Exception: " + ex); - websenseErrorCode |= WEBSENSE_REG_OPEN_ERROR; - } - - Services.telemetry.getHistogramById(AUSHELPER_WEBSENSE_REG_EXISTS_HISTOGRAM_ID).add(!!websenseVersion); - let websenseValue = "(" + (websenseVersion ? "websense-" + websenseVersion : "nowebsense") + ")"; - - let branch = Services.prefs.getDefaultBranch(""); - let curValue = branch.getCharPref(APP_UPDATE_URL_PREF); - if (curValue.indexOf(REPLACE_KEY + "/") > -1) { - let newValue = curValue.replace(REPLACE_KEY + "/", REPLACE_KEY + cpuValue + websenseValue + "/"); - branch.setCharPref(APP_UPDATE_URL_PREF, newValue); - } else { - websenseErrorCode |= WEBSENSE_ALREADY_MODIFIED; - } - Services.telemetry.getHistogramById(AUSHELPER_WEBSENSE_ERROR_CODE_HISTOGRAM_ID).add(websenseErrorCode); -} -function shutdown() {} -function install() {} -function uninstall() {} diff --git a/browser/extensions/aushelper/install.rdf.in b/browser/extensions/aushelper/install.rdf.in deleted file mode 100644 index 78e841d88..000000000 --- a/browser/extensions/aushelper/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>aushelper@mozilla.org</em:id> - <em:version>2.0</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this extension can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>Application Update Service Helper</em:name> - <em:description>Sets value(s) in the update url based on custom checks.</em:description> - </Description> -</RDF> diff --git a/browser/extensions/aushelper/moz.build b/browser/extensions/aushelper/moz.build deleted file mode 100644 index a4ff06055..000000000 --- a/browser/extensions/aushelper/moz.build +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -FINAL_TARGET_FILES.features['aushelper@mozilla.org'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['aushelper@mozilla.org'] += [ - 'install.rdf.in' -] diff --git a/browser/extensions/e10srollout/bootstrap.js b/browser/extensions/e10srollout/bootstrap.js deleted file mode 100644 index 0da7ac225..000000000 --- a/browser/extensions/e10srollout/bootstrap.js +++ /dev/null @@ -1,197 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* 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/. */ -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Preferences.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/UpdateUtils.jsm"); -Cu.import("resource://gre/modules/AppConstants.jsm"); - - // The amount of people to be part of e10s -const TEST_THRESHOLD = { - "beta" : 0.5, // 50% - "release" : 1.0, // 100% - "esr" : 1.0, // 100% -}; - -const ADDON_ROLLOUT_POLICY = { - "beta" : "51alladdons", // Any WebExtension or addon except with mpc = false - "release" : "51set1", - "esr" : "esrA", // WebExtensions and Addons with mpc=true -}; - -if (AppConstants.RELEASE_OR_BETA) { - // Bug 1348576 - e10s is never enabled for non-official release builds - // This is hacky, but the problem it solves is the following: - // the e10s rollout is controlled by the channel name, which - // is the only way to distinguish between Beta and Release. - // However, non-official release builds (like the ones done by distros - // to ship Firefox on their package managers) do not set a value - // for the release channel, which gets them to the default value - // of.. (drumroll) "default". - // But we can't just always configure the same settings for the - // "default" channel because that's also the name that a locally - // built Firefox gets, and e10s is managed in a different way - // there (directly by prefs, on Nightly and Aurora). - TEST_THRESHOLD.default = TEST_THRESHOLD.release; - ADDON_ROLLOUT_POLICY.default = ADDON_ROLLOUT_POLICY.release; -} - - -const PREF_COHORT_SAMPLE = "e10s.rollout.cohortSample"; -const PREF_COHORT_NAME = "e10s.rollout.cohort"; -const PREF_E10S_OPTED_IN = "browser.tabs.remote.autostart"; -const PREF_E10S_FORCE_ENABLED = "browser.tabs.remote.force-enable"; -const PREF_E10S_FORCE_DISABLED = "browser.tabs.remote.force-disable"; -const PREF_TOGGLE_E10S = "browser.tabs.remote.autostart.2"; -const PREF_E10S_ADDON_POLICY = "extensions.e10s.rollout.policy"; -const PREF_E10S_ADDON_BLOCKLIST = "extensions.e10s.rollout.blocklist"; -const PREF_E10S_HAS_NONEXEMPT_ADDON = "extensions.e10s.rollout.hasAddon"; - -function startup() { - // In theory we only need to run this once (on install()), but - // it's better to also run it on every startup. If the user has - // made manual changes to the prefs, this will keep the data - // reported more accurate. - // It's also fine (and preferred) to just do it here on startup - // (instead of observing prefs), because e10s takes a restart - // to take effect, so we keep the data based on how it was when - // the session started. - defineCohort(); -} - -function install() { - defineCohort(); -} - -let cohortDefinedOnThisSession = false; - -function defineCohort() { - // Avoid running twice when it was called by install() first - if (cohortDefinedOnThisSession) { - return; - } - cohortDefinedOnThisSession = true; - - let updateChannel = UpdateUtils.getUpdateChannel(false); - if (!(updateChannel in TEST_THRESHOLD)) { - setCohort("unsupportedChannel"); - return; - } - - let addonPolicy = "unknown"; - if (updateChannel in ADDON_ROLLOUT_POLICY) { - addonPolicy = ADDON_ROLLOUT_POLICY[updateChannel]; - Preferences.set(PREF_E10S_ADDON_POLICY, addonPolicy); - // This is also the proper place to set the blocklist pref - // in case it is necessary. - - Preferences.set(PREF_E10S_ADDON_BLOCKLIST, - // bug 1185672 - Tab Mix Plus - "{dc572301-7619-498c-a57d-39143191b318};" + - // bug 1332692 - LastPass - "support@lastpass.com;"); - } else { - Preferences.reset(PREF_E10S_ADDON_POLICY); - } - - let userOptedOut = optedOut(); - let userOptedIn = optedIn(); - let disqualified = (Services.appinfo.multiprocessBlockPolicy != 0); - let testGroup = (getUserSample() < TEST_THRESHOLD[updateChannel]); - let hasNonExemptAddon = Preferences.get(PREF_E10S_HAS_NONEXEMPT_ADDON, false); - let temporaryDisqualification = getTemporaryDisqualification(); - - let cohortPrefix = ""; - if (disqualified) { - cohortPrefix = "disqualified-"; - } else if (hasNonExemptAddon) { - cohortPrefix = `addons-set${addonPolicy}-`; - } - - if (userOptedOut) { - setCohort("optedOut"); - } else if (userOptedIn) { - setCohort("optedIn"); - } else if (temporaryDisqualification != "") { - // Users who are disqualified by the backend (from multiprocessBlockPolicy) - // can be put into either the test or control groups, because e10s will - // still be denied by the backend, which is useful so that the E10S_STATUS - // telemetry probe can be correctly set. - - // For these volatile disqualification reasons, however, we must not try - // to activate e10s because the backend doesn't know about it. E10S_STATUS - // here will be accumulated as "2 - Disabled", which is fine too. - setCohort(`temp-disqualified-${temporaryDisqualification}`); - Preferences.reset(PREF_TOGGLE_E10S); - } else if (testGroup) { - setCohort(`${cohortPrefix}test`); - Preferences.set(PREF_TOGGLE_E10S, true); - } else { - setCohort(`${cohortPrefix}control`); - Preferences.reset(PREF_TOGGLE_E10S); - } -} - -function shutdown(data, reason) { -} - -function uninstall() { -} - -function getUserSample() { - let prefValue = Preferences.get(PREF_COHORT_SAMPLE, undefined); - let value = 0.0; - - if (typeof(prefValue) == "string") { - value = parseFloat(prefValue, 10); - return value; - } - - if (typeof(prefValue) == "number") { - // convert old integer value - value = prefValue / 100; - } else { - value = Math.random(); - } - - Preferences.set(PREF_COHORT_SAMPLE, value.toString().substr(0, 8)); - return value; -} - -function setCohort(cohortName) { - Preferences.set(PREF_COHORT_NAME, cohortName); - try { - if (Ci.nsICrashReporter) { - Services.appinfo.QueryInterface(Ci.nsICrashReporter).annotateCrashReport("E10SCohort", cohortName); - } - } catch (e) {} -} - -function optedIn() { - return Preferences.get(PREF_E10S_OPTED_IN, false) || - Preferences.get(PREF_E10S_FORCE_ENABLED, false); -} - -function optedOut() { - // Users can also opt-out by toggling back the pref to false. - // If they reset the pref instead they might be re-enabled if - // they are still part of the threshold. - return Preferences.get(PREF_E10S_FORCE_DISABLED, false) || - (Preferences.isSet(PREF_TOGGLE_E10S) && - Preferences.get(PREF_TOGGLE_E10S) == false); -} - -/* If this function returns a non-empty string, it - * means that this particular user should be temporarily - * disqualified due to some particular reason. - * If a user shouldn't be disqualified, then an empty - * string must be returned. - */ -function getTemporaryDisqualification() { - return ""; -} diff --git a/browser/extensions/e10srollout/install.rdf.in b/browser/extensions/e10srollout/install.rdf.in deleted file mode 100644 index 19ff58471..000000000 --- a/browser/extensions/e10srollout/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>e10srollout@mozilla.org</em:id> - <em:version>1.10</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this theme can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>Multi-process staged rollout</em:name> - <em:description>Staged rollout of Firefox multi-process feature.</em:description> - </Description> -</RDF> diff --git a/browser/extensions/e10srollout/moz.build b/browser/extensions/e10srollout/moz.build deleted file mode 100644 index 9b5a16d5a..000000000 --- a/browser/extensions/e10srollout/moz.build +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -FINAL_TARGET_FILES.features['e10srollout@mozilla.org'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['e10srollout@mozilla.org'] += [ - 'install.rdf.in' -] diff --git a/browser/extensions/flyweb/bootstrap.js b/browser/extensions/flyweb/bootstrap.js deleted file mode 100644 index 089226519..000000000 --- a/browser/extensions/flyweb/bootstrap.js +++ /dev/null @@ -1,297 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* 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"); - -XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", - "resource:///modules/CustomizableUI.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Console", - "resource://gre/modules/Console.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Services", - "resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Integration", - "resource://gre/modules/Integration.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PermissionUI", - "resource:///modules/PermissionUI.jsm"); - -XPCOMUtils.defineLazyGetter(this, "gFlyWebBundle", function() { - const tns = { - "flyweb-button.label": "FlyWeb", - "flyweb-button.tooltiptext": "Discover nearby FlyWeb services", - "flyweb-items-empty": "There are no FlyWeb services currently nearby" - }; - return { - GetStringFromName(name) { - return tns[name]; - } - }; -}); - -const FLYWEB_ENABLED_PREF = "dom.flyweb.enabled"; - -function install(aData, aReason) {} - -function uninstall(aData, aReason) {} - -function startup(aData, aReason) { - // Observe pref changes and enable/disable as necessary. - Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver, false); - - // Only initialize if pref is enabled. - let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF); - if (enabled) { - FlyWebView.init(); - } -} - -function shutdown(aData, aReason) { - Services.prefs.removeObserver(FLYWEB_ENABLED_PREF, prefObserver); - - let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF); - if (enabled) { - FlyWebView.uninit(); - } -} - -// use enabled pref as a way for tests (e.g. test_contextmenu.html) to disable -// the addon when running. -function prefObserver(aSubject, aTopic, aData) { - let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF); - if (enabled) { - FlyWebView.init(); - } else { - FlyWebView.uninit(); - } -} - -let gDiscoveryManagerInstance; - -class DiscoveryManager { - constructor(aWindow) { - this._discoveryManager = new aWindow.FlyWebDiscoveryManager(); - } - - destroy() { - if (this._id) { - this.stop(); - } - - this._discoveryManager = null; - } - - start(callback) { - if (!this._id) { - this._id = this._discoveryManager.startDiscovery(this); - } - - this._callback = callback; - } - - stop() { - this._discoveryManager.stopDiscovery(this._id); - - this._id = null; - } - - pairWith(serviceId, callback) { - this._discoveryManager.pairWithService(serviceId, { - pairingSucceeded(service) { - callback(service); - }, - - pairingFailed(error) { - console.error("FlyWeb failed to pair with service " + serviceId, error); - } - }); - } - - onDiscoveredServicesChanged(services) { - if (!this._id || !this._callback) { - return; - } - - this._callback(services); - } -} - -const FlyWebPermissionPromptIntegration = (base) => ({ - __proto__: base, - createPermissionPrompt(type, request) { - if (type != "flyweb-publish-server") { - return super.createPermissionPrompt(...arguments); - } - - return { - __proto__: PermissionUI.PermissionPromptForRequestPrototype, - get request() { - return request; - }, - get permissionKey() { - return "flyweb-publish-server"; - }, - get popupOptions() { - return { - learnMoreURL: "https://flyweb.github.io", - popupIconURL: "chrome://flyweb/skin/icon-64.png", - }; - }, - get notificationID() { - return "flyweb-publish-server"; - }, - get anchorID() { - const kAnchorID = "flyweb-publish-server-notification-icon"; - let chromeDoc = this.browser.ownerDocument; - let anchor = chromeDoc.getElementById(kAnchorID); - if (!anchor) { - let notificationPopupBox = - chromeDoc.getElementById("notification-popup-box"); - let notificationIcon = chromeDoc.createElement("image"); - notificationIcon.id = kAnchorID; - notificationIcon.setAttribute("src", - "chrome://flyweb/skin/icon-64.png"); - notificationIcon.classList.add("notification-anchor-icon"); - notificationIcon.setAttribute("role", "button"); - notificationIcon.setAttribute("aria-label", - "View the publish-server request"); - notificationIcon.style.filter = - "url('chrome://browser/skin/filters.svg#fill')"; - notificationIcon.style.fill = "currentcolor"; - notificationIcon.style.opacity = "0.4"; - notificationPopupBox.appendChild(notificationIcon); - } - - return kAnchorID; - }, - get message() { - return "Would you like to let this site start a server accessible " + - "to nearby devices and people?"; - }, - get promptActions() { - return [{ - label: "Allow Server", - accessKey: "A", - action: Ci.nsIPermissionManager.ALLOW_ACTION, - expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, - }, { - label: "Block Server", - accessKey: "B", - action: Ci.nsIPermissionManager.DENY_ACTION, - expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, - }]; - }, - }; - }, -}); - -let FlyWebView = { - init() { - // Create widget and add it to the menu panel. - CustomizableUI.createWidget({ - id: "flyweb-button", - type: "view", - viewId: "flyweb-panel", - label: gFlyWebBundle.GetStringFromName("flyweb-button.label"), - tooltiptext: gFlyWebBundle.GetStringFromName("flyweb-button.tooltiptext"), - - onBeforeCreated(aDocument) { - let panel = aDocument.createElement("panelview"); - panel.id = "flyweb-panel"; - panel.setAttribute("class", "PanelUI-subView"); - panel.setAttribute("flex", "1"); - - let label = aDocument.createElement("label"); - label.setAttribute("class", "panel-subview-header"); - label.setAttribute("value", gFlyWebBundle.GetStringFromName("flyweb-button.label")); - - let empty = aDocument.createElement("description"); - empty.id = "flyweb-items-empty"; - empty.setAttribute("mousethrough", "always"); - empty.textContent = gFlyWebBundle.GetStringFromName("flyweb-items-empty"); - - let items = aDocument.createElement("vbox"); - items.id = "flyweb-items"; - items.setAttribute("class", "panel-subview-body"); - - panel.appendChild(label); - panel.appendChild(empty); - panel.appendChild(items); - - panel.addEventListener("command", this); - - aDocument.getElementById("PanelUI-multiView").appendChild(panel); - - this._sheetURI = Services.io.newURI("chrome://flyweb/skin/flyweb.css", null, null); - aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor). - getInterface(Ci.nsIDOMWindowUtils).loadSheet(this._sheetURI, 1); - }, - - onDestroyed(aDocument) { - aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor). - getInterface(Ci.nsIDOMWindowUtils).removeSheet(this._sheetURI, 1); - }, - - onViewShowing(aEvent) { - let doc = aEvent.target.ownerDocument; - - let items = doc.getElementById("flyweb-items"); - let empty = doc.getElementById("flyweb-items-empty"); - - if (!gDiscoveryManagerInstance) { - gDiscoveryManagerInstance = new DiscoveryManager(doc.defaultView); - } - - gDiscoveryManagerInstance.start((services) => { - while (items.firstChild) { - items.firstChild.remove(); - } - - let fragment = doc.createDocumentFragment(); - - for (let service of services) { - let button = doc.createElement("toolbarbutton"); - button.setAttribute("class", "subviewbutton cui-withicon"); - button.setAttribute("label", service.displayName); - button.setAttribute("data-service-id", service.serviceId); - fragment.appendChild(button); - } - - items.appendChild(fragment); - - empty.hidden = services.length > 0; - }); - }, - - onViewHiding(aEvent) { - gDiscoveryManagerInstance.stop(); - }, - - handleEvent(aEvent) { - if (aEvent.type === "command") { - let serviceId = aEvent.target.getAttribute("data-service-id"); - gDiscoveryManagerInstance.pairWith(serviceId, (service) => { - aEvent.view.openUILinkIn(service.uiUrl, "tab"); - }); - } - } - }); - - Integration.contentPermission - .register(FlyWebPermissionPromptIntegration); - }, - - uninit() { - CustomizableUI.destroyWidget("flyweb-button"); - - if (gDiscoveryManagerInstance) { - gDiscoveryManagerInstance.destroy(); - gDiscoveryManagerInstance = null; - } - - Integration.contentPermission - .unregister(FlyWebPermissionPromptIntegration); - } -}; diff --git a/browser/extensions/flyweb/install.rdf.in b/browser/extensions/flyweb/install.rdf.in deleted file mode 100644 index 17f746f9b..000000000 --- a/browser/extensions/flyweb/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>flyweb@mozilla.org</em:id> - <em:version>1.0.0</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this theme can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>FlyWeb</em:name> - <em:description>Discover nearby services in the browser</em:description> - </Description> -</RDF> diff --git a/browser/extensions/flyweb/jar.mn b/browser/extensions/flyweb/jar.mn deleted file mode 100644 index 8eed2135b..000000000 --- a/browser/extensions/flyweb/jar.mn +++ /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/. - -[features/flyweb@mozilla.org] chrome.jar: -% skin flyweb classic/1.0 %skin/linux/ -% skin flyweb classic/1.0 %skin/osx/ os=Darwin -% skin flyweb classic/1.0 %skin/windows/ os=WINNT -% skin flyweb-shared classic/1.0 %skin/shared/ - skin/ (skin/*) diff --git a/browser/extensions/flyweb/moz.build b/browser/extensions/flyweb/moz.build deleted file mode 100644 index 7f71bfb55..000000000 --- a/browser/extensions/flyweb/moz.build +++ /dev/null @@ -1,18 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -FINAL_TARGET_FILES.features['flyweb@mozilla.org'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['flyweb@mozilla.org'] += [ - 'install.rdf.in' -] - -JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/extensions/flyweb/skin/flyweb-icon.svg b/browser/extensions/flyweb/skin/flyweb-icon.svg deleted file mode 100644 index 1b247e645..000000000 --- a/browser/extensions/flyweb/skin/flyweb-icon.svg +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"> -<circle fill="#797C80" cx="32" cy="52" r="6"/> -<g> - <path fill="#797C80" d="M6.894,15.255c-2.254,1.547-4.386,3.304-6.361,5.279L0.18,20.887l3.536,3.536l0.354-0.354 - c1.621-1.62,3.363-3.072,5.196-4.369C8.126,18.464,7.296,16.943,6.894,15.255z"/> - <path fill="#797C80" d="M63.465,20.532C55.061,12.128,43.887,7.5,32,7.5c-2.265,0-4.504,0.17-6.703,0.501 - c0.822,1.44,1.3,3.1,1.312,4.87C28.382,12.631,30.181,12.5,32,12.5c10.55,0,20.468,4.108,27.928,11.567l0.354,0.354l3.537-3.535 - L63.465,20.532z"/> -</g> -<g> - <path fill="#797C80" d="M16.613,10.94c1.103,0,2,0.897,2,2s-0.897,2-2,2s-2-0.897-2-2S15.51,10.94,16.613,10.94 M16.613,6.94 - c-3.313,0-6,2.687-6,6s2.687,6,6,6s6-2.687,6-6S19.926,6.94,16.613,6.94L16.613,6.94z"/> -</g> -<g> - <path fill="#797C80" d="M46.492,37.502c-1.853-1.852-4.002-3.292-6.334-4.305c0.031,0.324,0.05,0.652,0.05,0.984 - c0,1.477-0.33,2.874-0.906,4.137c1.329,0.712,2.561,1.623,3.657,2.719l0.354,0.354l3.533-3.535L46.492,37.502z"/> - <path fill="#797C80" d="M20.262,35.207c-0.972,0.683-1.9,1.439-2.758,2.297l-0.354,0.354l3.536,3.537l0.354-0.354 - c0.35-0.35,0.715-0.679,1.091-0.99C21.118,38.66,20.446,37.007,20.262,35.207z"/> -</g> -<g> - <path fill="#797C80" d="M30.209,32.182c1.102,0,1.999,0.897,1.999,2s-0.896,2-1.999,2c-1.103,0-2-0.897-2-2 - S29.106,32.182,30.209,32.182 M30.209,28.182c-3.313,0-6,2.686-6,6c0,3.312,2.687,6,6,6c3.313,0,5.999-2.688,5.999-6 - C36.208,30.867,33.522,28.182,30.209,28.182L30.209,28.182z"/> -</g> -<g> - <path fill="#797C80" d="M32.207,23.716c0-1.497,0.34-2.912,0.932-4.188C32.76,19.515,32.381,19.5,32,19.5 - c-8.681,0-16.843,3.381-22.981,9.52l-0.354,0.354l3.535,3.535l0.354-0.354C17.748,27.36,24.654,24.5,32,24.5 - c0.083,0,0.165,0.005,0.247,0.006C32.227,24.245,32.207,23.982,32.207,23.716z"/> - <path fill="#797C80" d="M54.98,29.018c-0.987-0.987-2.033-1.896-3.119-2.738c-0.447,1.68-1.313,3.188-2.491,4.399 - c0.717,0.586,1.409,1.21,2.073,1.874l0.354,0.354l3.537-3.535L54.98,29.018z"/> -</g> -<g> - <path fill="#797C80" d="M42.207,21.716c1.103,0,2,0.897,2,2s-0.897,2-2,2s-2-0.897-2-2S41.104,21.716,42.207,21.716 M42.207,17.716 - c-3.313,0-6,2.687-6,6s2.687,6,6,6s6-2.687,6-6S45.521,17.716,42.207,17.716L42.207,17.716z"/> -</g> -</svg> diff --git a/browser/extensions/flyweb/skin/linux/flyweb.css b/browser/extensions/flyweb/skin/linux/flyweb.css deleted file mode 100644 index c549248da..000000000 --- a/browser/extensions/flyweb/skin/linux/flyweb.css +++ /dev/null @@ -1,5 +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/. */ - -@import url("chrome://flyweb-shared/skin/flyweb.css"); diff --git a/browser/extensions/flyweb/skin/linux/icon-16.png b/browser/extensions/flyweb/skin/linux/icon-16.png Binary files differdeleted file mode 100644 index 3a6c2e43a..000000000 --- a/browser/extensions/flyweb/skin/linux/icon-16.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/linux/icon-32-anchored.png b/browser/extensions/flyweb/skin/linux/icon-32-anchored.png Binary files differdeleted file mode 100644 index b05590dda..000000000 --- a/browser/extensions/flyweb/skin/linux/icon-32-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/linux/icon-32.png b/browser/extensions/flyweb/skin/linux/icon-32.png Binary files differdeleted file mode 100644 index a04ec20b9..000000000 --- a/browser/extensions/flyweb/skin/linux/icon-32.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/linux/icon-64-anchored.png b/browser/extensions/flyweb/skin/linux/icon-64-anchored.png Binary files differdeleted file mode 100644 index b617b9208..000000000 --- a/browser/extensions/flyweb/skin/linux/icon-64-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/linux/icon-64.png b/browser/extensions/flyweb/skin/linux/icon-64.png Binary files differdeleted file mode 100644 index be8ece467..000000000 --- a/browser/extensions/flyweb/skin/linux/icon-64.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/osx/flyweb.css b/browser/extensions/flyweb/skin/osx/flyweb.css deleted file mode 100644 index c549248da..000000000 --- a/browser/extensions/flyweb/skin/osx/flyweb.css +++ /dev/null @@ -1,5 +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/. */ - -@import url("chrome://flyweb-shared/skin/flyweb.css"); diff --git a/browser/extensions/flyweb/skin/osx/icon-16.png b/browser/extensions/flyweb/skin/osx/icon-16.png Binary files differdeleted file mode 100644 index 7c87435a4..000000000 --- a/browser/extensions/flyweb/skin/osx/icon-16.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/osx/icon-32-anchored.png b/browser/extensions/flyweb/skin/osx/icon-32-anchored.png Binary files differdeleted file mode 100644 index b05590dda..000000000 --- a/browser/extensions/flyweb/skin/osx/icon-32-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/osx/icon-32.png b/browser/extensions/flyweb/skin/osx/icon-32.png Binary files differdeleted file mode 100644 index 5b0140ffa..000000000 --- a/browser/extensions/flyweb/skin/osx/icon-32.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/osx/icon-64-anchored.png b/browser/extensions/flyweb/skin/osx/icon-64-anchored.png Binary files differdeleted file mode 100644 index b617b9208..000000000 --- a/browser/extensions/flyweb/skin/osx/icon-64-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/osx/icon-64.png b/browser/extensions/flyweb/skin/osx/icon-64.png Binary files differdeleted file mode 100644 index eb67c29ec..000000000 --- a/browser/extensions/flyweb/skin/osx/icon-64.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/shared/flyweb.css b/browser/extensions/flyweb/skin/shared/flyweb.css deleted file mode 100644 index acc8a743d..000000000 --- a/browser/extensions/flyweb/skin/shared/flyweb.css +++ /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/. */ - -#flyweb-panel { - width: 20em; -} - -#flyweb-items-empty { - box-sizing: border-box; - color: GrayText; - padding: 10px 20px; - text-align: center; -} - -#flyweb-button { - list-style-image: url("chrome://flyweb/skin/icon-16.png"); -} - -#flyweb-button[cui-areatype="menu-panel"], -toolbarpaletteitem[place="palette"] > #flyweb-button { - list-style-image: url("chrome://flyweb/skin/icon-32.png"); -} - -#flyweb-button[cui-areatype="menu-panel"][panel-multiview-anchor="true"] { - list-style-image: url("chrome://flyweb/skin/icon-32-anchored.png"); -} - -#flyweb-items > toolbarbutton { - list-style-image: url("chrome://flyweb/skin/icon-16.png"); -} - -@media (min-resolution: 2dppx) { - #flyweb-button { - list-style-image: url("chrome://flyweb/skin/icon-32.png"); - } - - #flyweb-button[cui-areatype="menu-panel"], - toolbarpaletteitem[place="palette"] > #flyweb-button { - list-style-image: url("chrome://flyweb/skin/icon-64.png"); - } - - #flyweb-button[cui-areatype="menu-panel"][panel-multiview-anchor="true"] { - list-style-image: url("chrome://flyweb/skin/icon-64-anchored.png"); - } - - #flyweb-items > toolbarbutton { - list-style-image: url("chrome://flyweb/skin/icon-32.png"); - } - - #flyweb-items > toolbarbutton > .toolbarbutton-icon { - width: 16px; - } -} diff --git a/browser/extensions/flyweb/skin/windows/flyweb.css b/browser/extensions/flyweb/skin/windows/flyweb.css deleted file mode 100644 index c549248da..000000000 --- a/browser/extensions/flyweb/skin/windows/flyweb.css +++ /dev/null @@ -1,5 +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/. */ - -@import url("chrome://flyweb-shared/skin/flyweb.css"); diff --git a/browser/extensions/flyweb/skin/windows/icon-16.png b/browser/extensions/flyweb/skin/windows/icon-16.png Binary files differdeleted file mode 100644 index 3a6c2e43a..000000000 --- a/browser/extensions/flyweb/skin/windows/icon-16.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/windows/icon-32-anchored.png b/browser/extensions/flyweb/skin/windows/icon-32-anchored.png Binary files differdeleted file mode 100644 index b05590dda..000000000 --- a/browser/extensions/flyweb/skin/windows/icon-32-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/windows/icon-32.png b/browser/extensions/flyweb/skin/windows/icon-32.png Binary files differdeleted file mode 100644 index a04ec20b9..000000000 --- a/browser/extensions/flyweb/skin/windows/icon-32.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/windows/icon-64-anchored.png b/browser/extensions/flyweb/skin/windows/icon-64-anchored.png Binary files differdeleted file mode 100644 index b617b9208..000000000 --- a/browser/extensions/flyweb/skin/windows/icon-64-anchored.png +++ /dev/null diff --git a/browser/extensions/flyweb/skin/windows/icon-64.png b/browser/extensions/flyweb/skin/windows/icon-64.png Binary files differdeleted file mode 100644 index be8ece467..000000000 --- a/browser/extensions/flyweb/skin/windows/icon-64.png +++ /dev/null diff --git a/browser/extensions/formautofill/.eslintrc.js b/browser/extensions/formautofill/.eslintrc.js deleted file mode 100644 index ec89029e5..000000000 --- a/browser/extensions/formautofill/.eslintrc.js +++ /dev/null @@ -1,474 +0,0 @@ -"use strict"; - -module.exports = { // eslint-disable-line no-undef - "extends": "../../.eslintrc.js", - - "globals": { - "Components": true, - "dump": true, - "TextDecoder": false, - "TextEncoder": false, - }, - - "rules": { - // Rules from the mozilla plugin - "mozilla/balanced-listeners": "error", - "mozilla/no-aArgs": "warn", - "mozilla/no-cpows-in-tests": "warn", - "mozilla/var-only-at-top-level": "warn", - - "valid-jsdoc": ["error", { - "prefer": { - "return": "returns", - }, - "preferType": { - "Boolean": "boolean", - "Number": "number", - "String": "string", - "bool": "boolean", - }, - "requireParamDescription": false, - "requireReturn": false, - "requireReturnDescription": false, - }], - - // Braces only needed for multi-line arrow function blocks - // "arrow-body-style": ["error", "as-needed"], - - // Require spacing around => - "arrow-spacing": "error", - - // Always require spacing around a single line block - "block-spacing": "warn", - - // Forbid spaces inside the square brackets of array literals. - "array-bracket-spacing": ["error", "never"], - - // Forbid spaces inside the curly brackets of object literals. - "object-curly-spacing": ["error", "never"], - - // No space padding in parentheses - "space-in-parens": ["error", "never"], - - // Enforce one true brace style (opening brace on the same line) and avoid - // start and end braces on the same line. - "brace-style": ["error", "1tbs", {"allowSingleLine": true}], - - // No space before always a space after a comma - "comma-spacing": ["error", {"before": false, "after": true}], - - // Commas at the end of the line not the start - "comma-style": "error", - - // Don't require spaces around computed properties - "computed-property-spacing": ["warn", "never"], - - // Functions are not required to consistently return something or nothing - "consistent-return": "off", - - // Require braces around blocks that start a new line - "curly": ["error", "all"], - - // Always require a trailing EOL - "eol-last": "error", - - // Require function* name() - "generator-star-spacing": ["error", {"before": false, "after": true}], - - // Two space indent - "indent": ["error", 2, {"SwitchCase": 1}], - - // Space after colon not before in property declarations - "key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "minimum"}], - - // Require spaces before and after finally, catch, etc. - "keyword-spacing": "error", - - // Unix linebreaks - "linebreak-style": ["error", "unix"], - - // Always require parenthesis for new calls - "new-parens": "error", - - // Use [] instead of Array() - "no-array-constructor": "error", - - // No duplicate arguments in function declarations - "no-dupe-args": "error", - - // No duplicate keys in object declarations - "no-dupe-keys": "error", - - // No duplicate cases in switch statements - "no-duplicate-case": "error", - - // If an if block ends with a return no need for an else block - // "no-else-return": "error", - - // Disallow empty statements. This will report an error for: - // try { something(); } catch (e) {} - // but will not report it for: - // try { something(); } catch (e) { /* Silencing the error because ...*/ } - // which is a valid use case. - "no-empty": "error", - - // No empty character classes in regex - "no-empty-character-class": "error", - - // Disallow empty destructuring - "no-empty-pattern": "error", - - // No assiging to exception variable - "no-ex-assign": "error", - - // No using !! where casting to boolean is already happening - "no-extra-boolean-cast": "warn", - - // No double semicolon - "no-extra-semi": "error", - - // No overwriting defined functions - "no-func-assign": "error", - - // No invalid regular expresions - "no-invalid-regexp": "error", - - // No odd whitespace characters - "no-irregular-whitespace": "error", - - // No single if block inside an else block - "no-lonely-if": "warn", - - // No mixing spaces and tabs in indent - "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], - - // Disallow use of multiple spaces (sometimes used to align const values, - // array or object items, etc.). It's hard to maintain and doesn't add that - // much benefit. - "no-multi-spaces": "warn", - - // No reassigning native JS objects - "no-native-reassign": "error", - - // No (!foo in bar) - "no-negated-in-lhs": "error", - - // Nested ternary statements are confusing - "no-nested-ternary": "error", - - // Use {} instead of new Object() - "no-new-object": "error", - - // No Math() or JSON() - "no-obj-calls": "error", - - // No octal literals - "no-octal": "error", - - // No redeclaring variables - "no-redeclare": "error", - - // No unnecessary comparisons - "no-self-compare": "error", - - // No spaces between function name and parentheses - "no-spaced-func": "warn", - - // No trailing whitespace - "no-trailing-spaces": "error", - - // Error on newline where a semicolon is needed - "no-unexpected-multiline": "error", - - // No unreachable statements - "no-unreachable": "error", - - // No expressions where a statement is expected - "no-unused-expressions": "error", - - // No declaring variables that are never used - "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}], - - // No using variables before defined - "no-use-before-define": "error", - - // No using with - "no-with": "error", - - // Always require semicolon at end of statement - "semi": ["error", "always"], - - // Require space before blocks - "space-before-blocks": "error", - - // Never use spaces before function parentheses - "space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}], - - // Require spaces around operators, except for a|"off". - "space-infix-ops": ["error", {"int32Hint": true}], - - // ++ and -- should not need spacing - "space-unary-ops": ["warn", {"nonwords": false}], - - // No comparisons to NaN - "use-isnan": "error", - - // Only check typeof against valid results - "valid-typeof": "error", - - // Disallow using variables outside the blocks they are defined (especially - // since only let and const are used, see "no-var"). - "block-scoped-var": "error", - - // Allow trailing commas for easy list extension. Having them does not - // impair readability, but also not required either. - "comma-dangle": ["error", "always-multiline"], - - // Warn about cyclomatic complexity in functions. - "complexity": "warn", - - // Don't warn for inconsistent naming when capturing this (not so important - // with auto-binding fat arrow functions). - // "consistent-this": ["error", "self"], - - // Don't require a default case in switch statements. Avoid being forced to - // add a bogus default when you know all possible cases are handled. - "default-case": "off", - - // Enforce dots on the next line with property name. - "dot-location": ["error", "property"], - - // Encourage the use of dot notation whenever possible. - "dot-notation": "error", - - // Allow using == instead of ===, in the interest of landing something since - // the devtools codebase is split on convention here. - "eqeqeq": "off", - - // Don't require function expressions to have a name. - // This makes the code more verbose and hard to read. Our engine already - // does a fantastic job assigning a name to the function, which includes - // the enclosing function name, and worst case you have a line number that - // you can just look up. - "func-names": "off", - - // Allow use of function declarations and expressions. - "func-style": "off", - - // Don't enforce the maximum depth that blocks can be nested. The complexity - // rule is a better rule to check this. - "max-depth": "off", - - // Maximum length of a line. - // Disabled because we exceed this in too many places. - "max-len": ["off", 80], - - // Maximum depth callbacks can be nested. - "max-nested-callbacks": ["error", 4], - - // Don't limit the number of parameters that can be used in a function. - "max-params": "off", - - // Don't limit the maximum number of statement allowed in a function. We - // already have the complexity rule that's a better measurement. - "max-statements": "off", - - // Don't require a capital letter for constructors, only check if all new - // operators are followed by a capital letter. Don't warn when capitalized - // functions are used without the new operator. - "new-cap": ["off", {"capIsNew": false}], - - // Allow use of bitwise operators. - "no-bitwise": "off", - - // Disallow use of arguments.caller or arguments.callee. - "no-caller": "error", - - // Disallow the catch clause parameter name being the same as a variable in - // the outer scope, to avoid confusion. - "no-catch-shadow": "off", - - // Disallow assignment in conditional expressions. - "no-cond-assign": "error", - - // Disallow using the console API. - "no-console": "error", - - // Allow using constant expressions in conditions like while (true) - "no-constant-condition": "off", - - // Allow use of the continue statement. - "no-continue": "off", - - // Disallow control characters in regular expressions. - "no-control-regex": "error", - - // Disallow use of debugger. - "no-debugger": "error", - - // Disallow deletion of variables (deleting properties is fine). - "no-delete-var": "error", - - // Allow division operators explicitly at beginning of regular expression. - "no-div-regex": "off", - - // Disallow use of eval(). We have other APIs to evaluate code in content. - "no-eval": "error", - - // Disallow adding to native types - "no-extend-native": "error", - - // Disallow unnecessary function binding. - "no-extra-bind": "error", - - // Allow unnecessary parentheses, as they may make the code more readable. - "no-extra-parens": "off", - - // Disallow fallthrough of case statements, except if there is a comment. - "no-fallthrough": "error", - - // Allow the use of leading or trailing decimal points in numeric literals. - "no-floating-decimal": "off", - - // Allow comments inline after code. - "no-inline-comments": "off", - - // Disallow use of labels for anything other then loops and switches. - "no-labels": ["error", {"allowLoop": true}], - - // Disallow use of multiline strings (use template strings instead). - "no-multi-str": "warn", - - // Disallow multiple empty lines. - "no-multiple-empty-lines": ["warn", {"max": 2}], - - // Allow reassignment of function parameters. - "no-param-reassign": "off", - - // Allow string concatenation with __dirname and __filename (not a node env). - "no-path-concat": "off", - - // Allow use of unary operators, ++ and --. - "no-plusplus": "off", - - // Allow using process.env (not a node environment). - "no-process-env": "off", - - // Allow using process.exit (not a node environment). - "no-process-exit": "off", - - // Disallow usage of __proto__ property. - "no-proto": "error", - - // Disallow multiple spaces in a regular expression literal. - "no-regex-spaces": "error", - - // Allow reserved words being used as object literal keys. - "no-reserved-keys": "off", - - // Don't restrict usage of specified node modules (not a node environment). - "no-restricted-modules": "off", - - // Disallow use of assignment in return statement. It is preferable for a - // single line of code to have only one easily predictable effect. - "no-return-assign": "error", - - // Don't warn about declaration of variables already declared in the outer scope. - "no-shadow": "off", - - // Disallow shadowing of names such as arguments. - "no-shadow-restricted-names": "error", - - // Allow use of synchronous methods (not a node environment). - "no-sync": "off", - - // Allow the use of ternary operators. - "no-ternary": "off", - - // Disallow throwing literals (eg. throw "error" instead of - // throw new Error("error")). - "no-throw-literal": "error", - - // Disallow use of undeclared variables unless mentioned in a /* global */ - // block. Note that globals from head.js are automatically imported in tests - // by the import-headjs-globals rule form the mozilla eslint plugin. - "no-undef": "error", - - // Allow dangling underscores in identifiers (for privates). - "no-underscore-dangle": "off", - - // Allow use of undefined variable. - "no-undefined": "off", - - // Disallow the use of Boolean literals in conditional expressions. - "no-unneeded-ternary": "error", - - // We use var-only-at-top-level instead of no-var as we allow top level - // vars. - "no-var": "off", - - // Allow using TODO/FIXME comments. - "no-warning-comments": "off", - - // Don't require method and property shorthand syntax for object literals. - // We use this in the code a lot, but not consistently, and this seems more - // like something to check at code review time. - "object-shorthand": "off", - - // Allow more than one variable declaration per function. - "one-var": "off", - - // Disallow padding within blocks. - "padded-blocks": ["warn", "never"], - - // Don't require quotes around object literal property names. - "quote-props": "off", - - // Double quotes should be used. - "quotes": ["warn", "double", {"avoidEscape": true, "allowTemplateLiterals": true}], - - // Require use of the second argument for parseInt(). - "radix": "error", - - // Enforce spacing after semicolons. - "semi-spacing": ["error", {"before": false, "after": true}], - - // Don't require to sort variables within the same declaration block. - // Anyway, one-var is disabled. - "sort-vars": "off", - - // Require a space immediately following the // in a line comment. - "spaced-comment": ["error", "always"], - - // Require "use strict" to be defined globally in the script. - "strict": ["error", "global"], - - // Allow vars to be declared anywhere in the scope. - "vars-on-top": "off", - - // Don't require immediate function invocation to be wrapped in parentheses. - "wrap-iife": "off", - - // Don't require regex literals to be wrapped in parentheses (which - // supposedly prevent them from being mistaken for division operators). - "wrap-regex": "off", - - // Disallow Yoda conditions (where literal value comes first). - "yoda": "error", - - // disallow use of eval()-like methods - "no-implied-eval": "error", - - // Disallow function or variable declarations in nested blocks - "no-inner-declarations": "error", - - // Disallow usage of __iterator__ property - "no-iterator": "error", - - // Disallow labels that share a name with a variable - "no-label-var": "error", - - // Disallow creating new instances of String, Number, and Boolean - "no-new-wrappers": "error", - }, -}; diff --git a/browser/extensions/formautofill/bootstrap.js b/browser/extensions/formautofill/bootstrap.js deleted file mode 100644 index 0b3f355bd..000000000 --- a/browser/extensions/formautofill/bootstrap.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/. */ - -"use strict"; - -/* exported startup, shutdown, install, uninstall */ - -function startup() {} -function shutdown() {} -function install() {} -function uninstall() {} diff --git a/browser/extensions/formautofill/content/FormAutofillContent.jsm b/browser/extensions/formautofill/content/FormAutofillContent.jsm deleted file mode 100644 index bde397580..000000000 --- a/browser/extensions/formautofill/content/FormAutofillContent.jsm +++ /dev/null @@ -1,134 +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/. */ - -/* - * Implements a service used by DOM content to request Form Autofill. - */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -/** - * Handles profile autofill for a DOM Form element. - * @param {HTMLFormElement} form Form that need to be auto filled - */ -function FormAutofillHandler(form) { - this.form = form; - this.fieldDetails = []; -} - -FormAutofillHandler.prototype = { - /** - * DOM Form element to which this object is attached. - */ - form: null, - - /** - * Array of collected data about relevant form fields. Each item is an object - * storing the identifying details of the field and a reference to the - * originally associated element from the form. - * - * The "section", "addressType", "contactType", and "fieldName" values are - * used to identify the exact field when the serializable data is received - * from the backend. There cannot be multiple fields which have - * the same exact combination of these values. - * - * A direct reference to the associated element cannot be sent to the user - * interface because processing may be done in the parent process. - */ - fieldDetails: null, - - /** - * Returns information from the form about fields that can be autofilled, and - * populates the fieldDetails array on this object accordingly. - * - * @returns {Array<Object>} Serializable data structure that can be sent to the user - * interface, or null if the operation failed because the constraints - * on the allowed fields were not honored. - */ - collectFormFields() { - let autofillData = []; - - for (let element of this.form.elements) { - // Query the interface and exclude elements that cannot be autocompleted. - if (!(element instanceof Ci.nsIDOMHTMLInputElement)) { - continue; - } - - // Exclude elements to which no autocomplete field has been assigned. - let info = element.getAutocompleteInfo(); - if (!info.fieldName || ["on", "off"].includes(info.fieldName)) { - continue; - } - - // Store the association between the field metadata and the element. - if (this.fieldDetails.some(f => f.section == info.section && - f.addressType == info.addressType && - f.contactType == info.contactType && - f.fieldName == info.fieldName)) { - // A field with the same identifier already exists. - return null; - } - - let inputFormat = { - section: info.section, - addressType: info.addressType, - contactType: info.contactType, - fieldName: info.fieldName, - }; - // Clone the inputFormat for caching the fields and elements together - let formatWithElement = Object.assign({}, inputFormat); - - inputFormat.index = autofillData.length; - autofillData.push(inputFormat); - - formatWithElement.element = element; - this.fieldDetails.push(formatWithElement); - } - - return autofillData; - }, - - /** - * Processes form fields that can be autofilled, and populates them with the - * data provided by backend. - * - * @param {Array<Object>} autofillResult - * Data returned by the user interface. - * [{ - * section: Value originally provided to the user interface. - * addressType: Value originally provided to the user interface. - * contactType: Value originally provided to the user interface. - * fieldName: Value originally provided to the user interface. - * value: String with which the field should be updated. - * index: Index to match the input in fieldDetails - * }], - * } - */ - autofillFormFields(autofillResult) { - for (let field of autofillResult) { - // Get the field details, if it was processed by the user interface. - let fieldDetail = this.fieldDetails[field.index]; - - // Avoid the invalid value set - if (!fieldDetail || !field.value) { - continue; - } - - let info = fieldDetail.element.getAutocompleteInfo(); - if (field.section != info.section || - field.addressType != info.addressType || - field.contactType != info.contactType || - field.fieldName != info.fieldName) { - Cu.reportError("Autocomplete tokens mismatched"); - continue; - } - - fieldDetail.element.setUserInput(field.value); - } - }, -}; - -this.EXPORTED_SYMBOLS = ["FormAutofillHandler"]; diff --git a/browser/extensions/formautofill/content/FormAutofillParent.jsm b/browser/extensions/formautofill/content/FormAutofillParent.jsm deleted file mode 100644 index bdfe0f478..000000000 --- a/browser/extensions/formautofill/content/FormAutofillParent.jsm +++ /dev/null @@ -1,173 +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/. */ - -/* - * Implements a service used to access storage and communicate with content. - * - * A "fields" array is used to communicate with FormAutofillContent. Each item - * represents a single input field in the content page as well as its - * @autocomplete properties. The schema is as below. Please refer to - * FormAutofillContent.jsm for more details. - * - * [ - * { - * section, - * addressType, - * contactType, - * fieldName, - * value, - * index - * }, - * { - * // ... - * } - * ] - */ - -/* exported FormAutofillParent */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "OS", - "resource://gre/modules/osfile.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ProfileStorage", - "resource://formautofill/ProfileStorage.jsm"); - -const PROFILE_JSON_FILE_NAME = "autofill-profiles.json"; - -let FormAutofillParent = { - _profileStore: null, - - /** - * Initializes ProfileStorage and registers the message handler. - */ - init: function() { - let storePath = - OS.Path.join(OS.Constants.Path.profileDir, PROFILE_JSON_FILE_NAME); - - this._profileStore = new ProfileStorage(storePath); - this._profileStore.initialize(); - - let mm = Cc["@mozilla.org/globalmessagemanager;1"] - .getService(Ci.nsIMessageListenerManager); - mm.addMessageListener("FormAutofill:PopulateFieldValues", this); - }, - - /** - * Handles the message coming from FormAutofillContent. - * - * @param {string} message.name The name of the message. - * @param {object} message.data The data of the message. - * @param {nsIFrameMessageManager} message.target Caller's message manager. - */ - receiveMessage: function({name, data, target}) { - switch (name) { - case "FormAutofill:PopulateFieldValues": - this._populateFieldValues(data, target); - break; - } - }, - - /** - * Returns the instance of ProfileStorage. To avoid syncing issues, anyone - * who needs to access the profile should request the instance by this instead - * of creating a new one. - * - * @returns {ProfileStorage} - */ - getProfileStore: function() { - return this._profileStore; - }, - - /** - * Uninitializes FormAutofillParent. This is for testing only. - * - * @private - */ - _uninit: function() { - if (this._profileStore) { - this._profileStore._saveImmediately(); - this._profileStore = null; - } - - let mm = Cc["@mozilla.org/globalmessagemanager;1"] - .getService(Ci.nsIMessageListenerManager); - mm.removeMessageListener("FormAutofill:PopulateFieldValues", this); - }, - - /** - * Populates the field values and notifies content to fill in. Exception will - * be thrown if there's no matching profile. - * - * @private - * @param {string} data.guid - * Indicates which profile to populate - * @param {Fields} data.fields - * The "fields" array collected from content. - * @param {nsIFrameMessageManager} target - * Content's message manager. - */ - _populateFieldValues({guid, fields}, target) { - this._profileStore.notifyUsed(guid); - this._fillInFields(this._profileStore.get(guid), fields); - target.sendAsyncMessage("FormAutofill:fillForm", {fields}); - }, - - /** - * Transforms a word with hyphen into camel case. - * (e.g. transforms "address-type" into "addressType".) - * - * @private - * @param {string} str The original string with hyphen. - * @returns {string} The camel-cased output string. - */ - _camelCase(str) { - return str.toLowerCase().replace(/-([a-z])/g, s => s[1].toUpperCase()); - }, - - /** - * Get the corresponding value from the specified profile according to a valid - * @autocomplete field name. - * - * Note that the field name doesn't need to match the property name defined in - * Profile object. This method can transform the raw data to fulfill it. (e.g. - * inputting "country-name" as "fieldName" will get a full name transformed - * from the country code that is recorded in "country" field.) - * - * @private - * @param {Profile} profile The specified profile. - * @param {string} fieldName A valid @autocomplete field name. - * @returns {string} The corresponding value. Returns "undefined" if there's - * no matching field. - */ - _getDataByFieldName(profile, fieldName) { - let key = this._camelCase(fieldName); - - // TODO: Transform the raw profile data to fulfill "fieldName" here. - - return profile[key]; - }, - - /** - * Fills in the "fields" array by the specified profile. - * - * @private - * @param {Profile} profile The specified profile to fill in. - * @param {Fields} fields The "fields" array collected from content. - */ - _fillInFields(profile, fields) { - for (let field of fields) { - let value = this._getDataByFieldName(profile, field.fieldName); - if (value !== undefined) { - field.value = value; - } - } - }, -}; - -this.EXPORTED_SYMBOLS = ["FormAutofillParent"]; diff --git a/browser/extensions/formautofill/content/ProfileStorage.jsm b/browser/extensions/formautofill/content/ProfileStorage.jsm deleted file mode 100644 index 843177d4e..000000000 --- a/browser/extensions/formautofill/content/ProfileStorage.jsm +++ /dev/null @@ -1,251 +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/. */ - -/* - * Implements an interface of the storage of Form Autofill. - * - * The data is stored in JSON format, without indentation, using UTF-8 encoding. - * With indentation applied, the file would look like this: - * - * { - * version: 1, - * profiles: [ - * { - * guid, // 12 character... - * - * // profile - * organization, // Company - * streetAddress, // (Multiline) - * addressLevel2, // City/Town - * addressLevel1, // Province (Standardized code if possible) - * postalCode, - * country, // ISO 3166 - * tel, - * email, - * - * // metadata - * timeCreated, // in ms - * timeLastUsed, // in ms - * timeLastModified, // in ms - * timesUsed - * }, - * { - * // ... - * } - * ] - * } - */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "JSONFile", - "resource://gre/modules/JSONFile.jsm"); - -XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator", - "@mozilla.org/uuid-generator;1", - "nsIUUIDGenerator"); - -const SCHEMA_VERSION = 1; - -// Name-related fields will be handled in follow-up bugs due to the complexity. -const VALID_FIELDS = [ - "organization", - "streetAddress", - "addressLevel2", - "addressLevel1", - "postalCode", - "country", - "tel", - "email", -]; - -function ProfileStorage(path) { - this._path = path; -} - -ProfileStorage.prototype = { - /** - * Loads the profile data from file to memory. - * - * @returns {Promise} - * @resolves When the operation finished successfully. - * @rejects JavaScript exception. - */ - initialize() { - this._store = new JSONFile({ - path: this._path, - dataPostProcessor: this._dataPostProcessor.bind(this), - }); - return this._store.load(); - }, - - /** - * Adds a new profile. - * - * @param {Profile} profile - * The new profile for saving. - */ - add(profile) { - this._store.ensureDataReady(); - - let profileToSave = this._normalizeProfile(profile); - - profileToSave.guid = gUUIDGenerator.generateUUID().toString() - .replace(/[{}-]/g, "").substring(0, 12); - - // Metadata - let now = Date.now(); - profileToSave.timeCreated = now; - profileToSave.timeLastModified = now; - profileToSave.timeLastUsed = 0; - profileToSave.timesUsed = 0; - - this._store.data.profiles.push(profileToSave); - - this._store.saveSoon(); - }, - - /** - * Update the specified profile. - * - * @param {string} guid - * Indicates which profile to update. - * @param {Profile} profile - * The new profile used to overwrite the old one. - */ - update(guid, profile) { - this._store.ensureDataReady(); - - let profileFound = this._findByGUID(guid); - if (!profileFound) { - throw new Error("No matching profile."); - } - - let profileToUpdate = this._normalizeProfile(profile); - for (let field of VALID_FIELDS) { - if (profileToUpdate[field] !== undefined) { - profileFound[field] = profileToUpdate[field]; - } else { - delete profileFound[field]; - } - } - - profileFound.timeLastModified = Date.now(); - - this._store.saveSoon(); - }, - - /** - * Notifies the stroage of the use of the specified profile, so we can update - * the metadata accordingly. - * - * @param {string} guid - * Indicates which profile to be notified. - */ - notifyUsed(guid) { - this._store.ensureDataReady(); - - let profileFound = this._findByGUID(guid); - if (!profileFound) { - throw new Error("No matching profile."); - } - - profileFound.timesUsed++; - profileFound.timeLastUsed = Date.now(); - - this._store.saveSoon(); - }, - - /** - * Removes the specified profile. No error occurs if the profile isn't found. - * - * @param {string} guid - * Indicates which profile to remove. - */ - remove(guid) { - this._store.ensureDataReady(); - - this._store.data.profiles = - this._store.data.profiles.filter(profile => profile.guid != guid); - this._store.saveSoon(); - }, - - /** - * Returns the profile with the specified GUID. - * - * @param {string} guid - * Indicates which profile to retrieve. - * @returns {Profile} - * A clone of the profile. - */ - get(guid) { - this._store.ensureDataReady(); - - let profileFound = this._findByGUID(guid); - if (!profileFound) { - throw new Error("No matching profile."); - } - - // Profile is cloned to avoid accidental modifications from outside. - return this._clone(profileFound); - }, - - /** - * Returns all profiles. - * - * @returns {Array.<Profile>} - * An array containing clones of all profiles. - */ - getAll() { - this._store.ensureDataReady(); - - // Profiles are cloned to avoid accidental modifications from outside. - return this._store.data.profiles.map(this._clone); - }, - - _clone(profile) { - return Object.assign({}, profile); - }, - - _findByGUID(guid) { - return this._store.data.profiles.find(profile => profile.guid == guid); - }, - - _normalizeProfile(profile) { - let result = {}; - for (let key in profile) { - if (!VALID_FIELDS.includes(key)) { - throw new Error(`"${key}" is not a valid field.`); - } - if (typeof profile[key] !== "string" && - typeof profile[key] !== "number") { - throw new Error(`"${key}" contains invalid data type.`); - } - - result[key] = profile[key]; - } - return result; - }, - - _dataPostProcessor(data) { - data.version = SCHEMA_VERSION; - if (!data.profiles) { - data.profiles = []; - } - return data; - }, - - // For test only. - _saveImmediately() { - return this._store._save(); - }, -}; - -this.EXPORTED_SYMBOLS = ["ProfileStorage"]; diff --git a/browser/extensions/formautofill/install.rdf.in b/browser/extensions/formautofill/install.rdf.in deleted file mode 100644 index 5e34051ba..000000000 --- a/browser/extensions/formautofill/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>formautofill@mozilla.org</em:id> - <em:version>1.0</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this extension can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>Form Autofill</em:name> - <em:description>Autofill forms with saved profiles</em:description> - </Description> -</RDF> diff --git a/browser/extensions/formautofill/jar.mn b/browser/extensions/formautofill/jar.mn deleted file mode 100644 index 0cba721ef..000000000 --- a/browser/extensions/formautofill/jar.mn +++ /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/. - -[features/formautofill@mozilla.org] chrome.jar: -% resource formautofill %content/ - content/ (content/*) diff --git a/browser/extensions/formautofill/moz.build b/browser/extensions/formautofill/moz.build deleted file mode 100644 index abcc659ee..000000000 --- a/browser/extensions/formautofill/moz.build +++ /dev/null @@ -1,18 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -FINAL_TARGET_FILES.features['formautofill@mozilla.org'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['formautofill@mozilla.org'] += [ - 'install.rdf.in' -] - -JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build index 4f95704e6..69d6af6d6 100644 --- a/browser/extensions/moz.build +++ b/browser/extensions/moz.build @@ -5,16 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ -# 'aushelper', -# 'e10srollout', 'pdfjs', -# 'pocket', -# 'webcompat', ] -# Only include the following system add-ons if building Aurora or Nightly -if 'a' in CONFIG['GRE_MILESTONE']: - DIRS += [ - 'flyweb', - 'formautofill', - ] diff --git a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm index 3b9f9de26..5e337bbc5 100644 --- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm +++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm @@ -29,7 +29,8 @@ const MOZ_CENTRAL = JSON.parse('true'); const PDFJS_EVENT_ID = 'pdf.js.message'; const PDF_CONTENT_TYPE = 'application/pdf'; const PREF_PREFIX = 'pdfjs'; -const PDF_VIEWER_WEB_PAGE = 'resource://pdf.js/web/viewer.html'; +const PDF_VIEWER_ORIGIN = "resource://pdf.js"; +const PDF_VIEWER_WEB_PAGE = "resource://pdf.js/web/viewer.html"; const MAX_NUMBER_OF_PREFS = 50; const MAX_STRING_PREF_LENGTH = 128; @@ -110,11 +111,15 @@ function log(aMsg) { dump(msg + '\n'); } -function getDOMWindow(aChannel) { +function getDOMWindow(aChannel, aPrincipal) { var requestor = aChannel.notificationCallbacks ? aChannel.notificationCallbacks : aChannel.loadGroup.notificationCallbacks; var win = requestor.getInterface(Components.interfaces.nsIDOMWindow); + // Ensure the window wasn't navigated to something that is not PDF.js. + if (!win.document.nodePrincipal.equals(aPrincipal)) { + return null; + } return win; } @@ -632,7 +637,7 @@ var RangedChromeActions = (function RangedChromeActionsClosure() { loaded: loaded, total: total, chunk: self.dataListener.readData() - }, '*'); + }, PDF_VIEWER_ORIGIN); }; this.dataListener.oncomplete = function () { self.dataListener = null; @@ -646,7 +651,7 @@ var RangedChromeActions = (function RangedChromeActionsClosure() { pdfUrl: this.pdfUrl, length: this.contentLength, data: data - }, '*'); + }, PDF_VIEWER_ORIGIN); return true; }; @@ -668,13 +673,13 @@ var RangedChromeActions = (function RangedChromeActionsClosure() { pdfjsLoadAction: 'range', begin: args.begin, chunk: args.chunk - }, '*'); + }, PDF_VIEWER_ORIGIN); }, onProgress: function RangedChromeActions_onProgress(evt) { domWindow.postMessage({ pdfjsLoadAction: 'rangeProgress', loaded: evt.loaded, - }, '*'); + }, PDF_VIEWER_ORIGIN); } }); }; @@ -723,7 +728,7 @@ var StandardChromeActions = (function StandardChromeActionsClosure() { pdfjsLoadAction: 'progress', loaded: loaded, total: total - }, '*'); + }, PDF_VIEWER_ORIGIN); }; this.dataListener.oncomplete = @@ -732,7 +737,7 @@ var StandardChromeActions = (function StandardChromeActionsClosure() { pdfjsLoadAction: 'complete', data: data, errorCode: errorCode - }, '*'); + }, PDF_VIEWER_ORIGIN); self.dataListener = null; self.originalRequest = null; @@ -977,10 +982,14 @@ PdfStreamConverter.prototype = { listener.onDataAvailable(aRequest, aContext, inputStream, offset, count); }, - onStopRequest: function(request, context, statusCode) { - // We get the DOM window here instead of before the request since it - // may have changed during a redirect. - var domWindow = getDOMWindow(channel); + onStopRequest(request, context, statusCode) { + var domWindow = getDOMWindow(channel, resourcePrincipal); + if (!Components.isSuccessCode(statusCode) || !domWindow) { + // The request may have been aborted and the document may have been + // replaced with something that is not PDF.js, abort attaching. + listener.onStopRequest(aRequest, context, statusCode); + return; + } var actions; if (rangeRequest || streamRequest) { actions = new RangedChromeActions( @@ -991,7 +1000,7 @@ PdfStreamConverter.prototype = { domWindow, contentDispositionFilename, aRequest, dataListener); } var requestListener = new RequestListener(actions); - domWindow.addEventListener(PDFJS_EVENT_ID, function(event) { + domWindow.document.addEventListener(PDFJS_EVENT_ID, function(event) { requestListener.receive(event); }, false, true); if (actions.supportsIntegratedFind()) { diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index 4c35bd401..6ce519940 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -41653,6 +41653,22 @@ var isStream = corePrimitives.isStream; var PostScriptLexer = corePsParser.PostScriptLexer; var PostScriptParser = corePsParser.PostScriptParser; + function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; + } + var length = arr.length; + for (var i = 0; i < length; i++) { + if (typeof arr[i] !== 'number') { + var result = new Array(length); + for (var j = 0; j < length; j++) { + result[j] = +arr[j]; + } + return result; + } + } + return arr; + } var PDFFunction = function PDFFunctionClosure() { var CONSTRUCT_SAMPLED = 0; var CONSTRUCT_INTERPOLATED = 2; @@ -41752,8 +41768,8 @@ } return out; } - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); + var domain = toNumberArray(dict.getArray('Domain')); + var range = toNumberArray(dict.getArray('Range')); if (!domain || !range) { error('No domain or range'); } @@ -41761,7 +41777,7 @@ var outputSize = range.length / 2; domain = toMultiArray(domain); range = toMultiArray(range); - var size = dict.get('Size'); + var size = toNumberArray(dict.get('Size')); var bps = dict.get('BitsPerSample'); var order = dict.get('Order') || 1; if (order !== 1) { @@ -41769,16 +41785,16 @@ // As in poppler, ignoring order, linear interpolation may work as good info('No support for cubic spline interpolation: ' + order); } - var encode = dict.getArray('Encode'); + var encode = toNumberArray(dict.getArray('Encode')); if (!encode) { encode = []; for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); + encode.push([0, size[i] - 1]); } + } else { + encode = toMultiArray(encode); } - encode = toMultiArray(encode); - var decode = dict.getArray('Decode'); + var decode = toNumberArray(dict.getArray('Decode')); if (!decode) { decode = range; } else { @@ -41873,12 +41889,9 @@ }; }, constructInterpolated: function PDFFunction_constructInterpolated(str, dict) { - var c0 = dict.getArray('C0') || [0]; - var c1 = dict.getArray('C1') || [1]; + var c0 = toNumberArray(dict.getArray('C0')) || [0]; + var c1 = toNumberArray(dict.getArray('C1')) || [1]; var n = dict.get('N'); - if (!isArray(c0) || !isArray(c1)) { - error('Illegal dictionary for interpolated function'); - } var length = c0.length; var diff = []; for (var i = 0; i < length; ++i) { @@ -41904,7 +41917,7 @@ }; }, constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.getArray('Domain'); + var domain = toNumberArray(dict.getArray('Domain')); if (!domain) { error('No domain'); } @@ -41915,10 +41928,10 @@ var fnRefs = dict.get('Functions'); var fns = []; for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); + fns.push(PDFFunction.parse(xref, xref.fetchIfRef(fnRefs[i]))); } - var bounds = dict.getArray('Bounds'); - var encode = dict.getArray('Encode'); + var bounds = toNumberArray(dict.getArray('Bounds')); + var encode = toNumberArray(dict.getArray('Encode')); return [ CONSTRUCT_STICHED, domain, @@ -41931,12 +41944,8 @@ var domain = IR[1]; var bounds = IR[2]; var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; + var fns = IR[4]; var tmpBuf = new Float32Array(1); - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { var clip = function constructStichedFromIRClip(v, min, max) { if (v > max) { @@ -41973,8 +41982,8 @@ }; }, constructPostScript: function PDFFunction_constructPostScript(fn, dict, xref) { - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); + var domain = toNumberArray(dict.getArray('Domain')); + var range = toNumberArray(dict.getArray('Range')); if (!domain) { error('No domain.'); } @@ -42933,8 +42942,8 @@ case 'AlternateCS': var numComps = IR[1]; var alt = IR[2]; - var tintFnIR = IR[3]; - return new AlternateCS(numComps, ColorSpace.fromIR(alt), PDFFunction.fromIR(tintFnIR)); + var tintFn = IR[3]; + return new AlternateCS(numComps, ColorSpace.fromIR(alt), tintFn); case 'LabCS': whitePoint = IR[1]; blackPoint = IR[2]; @@ -43072,12 +43081,12 @@ numComps = name.length; } alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); + var tintFn = PDFFunction.parse(xref, xref.fetchIfRef(cs[3])); return [ 'AlternateCS', numComps, alt, - tintFnIR + tintFn ]; case 'Lab': params = xref.fetchIfRef(cs[1]); @@ -52488,4 +52497,4 @@ })); }.call(pdfjsLibs)); exports.WorkerMessageHandler = pdfjsLibs.pdfjsCoreWorker.WorkerMessageHandler; -}));
\ No newline at end of file +})); diff --git a/browser/extensions/pocket/bootstrap.js b/browser/extensions/pocket/bootstrap.js deleted file mode 100644 index c470eb8d3..000000000 --- a/browser/extensions/pocket/bootstrap.js +++ /dev/null @@ -1,511 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* 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, manager: Cm} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Preferences.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Services", - "resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", - "resource:///modules/RecentWindow.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", - "resource:///modules/CustomizableUI.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", - "resource://gre/modules/AddonManager.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", - "resource://gre/modules/ReaderMode.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Pocket", - "chrome://pocket/content/Pocket.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AboutPocket", - "chrome://pocket/content/AboutPocket.jsm"); -XPCOMUtils.defineLazyGetter(this, "gPocketBundle", function() { - return Services.strings.createBundle("chrome://pocket/locale/pocket.properties"); -}); -XPCOMUtils.defineLazyGetter(this, "gPocketStyleURI", function() { - return Services.io.newURI("chrome://pocket/skin/pocket.css", null, null); -}); - -// Due to bug 1051238 frame scripts are cached forever, so we can't update them -// as a restartless add-on. The Math.random() is the work around for this. -const PROCESS_SCRIPT = "chrome://pocket/content/pocket-content-process.js?" + Math.random(); - -const PREF_BRANCH = "extensions.pocket."; -const PREFS = { - enabled: true, // bug 1229937, figure out ui tour support - api: "api.getpocket.com", - site: "getpocket.com", - oAuthConsumerKey: "40249-e88c401e1b1f2242d9e441c4" -}; - -function setDefaultPrefs() { - let branch = Services.prefs.getDefaultBranch(PREF_BRANCH); - for (let [key, val] of Object.entries(PREFS)) { - // If someone beat us to setting a default, don't overwrite it. This can - // happen if distribution.ini sets the default first. - if (branch.getPrefType(key) != branch.PREF_INVALID) - continue; - switch (typeof val) { - case "boolean": - branch.setBoolPref(key, val); - break; - case "number": - branch.setIntPref(key, val); - break; - case "string": - branch.setCharPref(key, val); - break; - } - } -} - -function createElementWithAttrs(document, type, attrs) { - let element = document.createElement(type); - Object.keys(attrs).forEach(function (attr) { - element.setAttribute(attr, attrs[attr]); - }) - return element; -} - -function CreatePocketWidget(reason) { - let id = "pocket-button" - let widget = CustomizableUI.getWidget(id); - // The widget is only null if we've created then destroyed the widget. - // Once we've actually called createWidget the provider will be set to - // PROVIDER_API. - if (widget && widget.provider == CustomizableUI.PROVIDER_API) - return; - // if upgrading from builtin version and the button was placed in ui, - // seenWidget will not be null - let seenWidget = CustomizableUI.getPlacementOfWidget("pocket-button", false, true); - let pocketButton = { - id: "pocket-button", - defaultArea: CustomizableUI.AREA_NAVBAR, - introducedInVersion: "pref", - type: "view", - tabSpecific: true, - viewId: "PanelUI-pocketView", - label: gPocketBundle.GetStringFromName("pocket-button.label"), - tooltiptext: gPocketBundle.GetStringFromName("pocket-button.tooltiptext"), - // Use forwarding functions here to avoid loading Pocket.jsm on startup: - onViewShowing: function() { - return Pocket.onPanelViewShowing.apply(this, arguments); - }, - onViewHiding: function() { - return Pocket.onPanelViewHiding.apply(this, arguments); - }, - onBeforeCreated: function(doc) { - // Bug 1223127,CUI should make this easier to do. - if (doc.getElementById("PanelUI-pocketView")) - return; - let view = doc.createElement("panelview"); - view.id = "PanelUI-pocketView"; - let panel = doc.createElement("vbox"); - panel.setAttribute("class", "panel-subview-body"); - view.appendChild(panel); - doc.getElementById("PanelUI-multiView").appendChild(view); - } - }; - - CustomizableUI.createWidget(pocketButton); - CustomizableUI.addListener(pocketButton); - // placed is null if location is palette - let placed = CustomizableUI.getPlacementOfWidget("pocket-button"); - - // a first time install will always have placed the button somewhere, and will - // not have a placement prior to creating the widget. Thus, !seenWidget && - // placed. - if (reason == ADDON_ENABLE && !seenWidget && placed) { - // initially place the button after the bookmarks button if it is in the UI - let widgets = CustomizableUI.getWidgetIdsInArea(CustomizableUI.AREA_NAVBAR); - let bmbtn = widgets.indexOf("bookmarks-menu-button"); - if (bmbtn > -1) { - CustomizableUI.moveWidgetWithinArea("pocket-button", bmbtn + 1); - } - } - - // Uninstall the Pocket social provider if it exists, but only if we haven't - // already uninstalled it in this manner. That way the user can reinstall - // it if they prefer it without its being uninstalled every time they start - // the browser. - let SocialService; - try { - // For Firefox 51+ - SocialService = Cu.import("resource:///modules/SocialService.jsm", {}).SocialService; - } catch (e) { - SocialService = Cu.import("resource://gre/modules/SocialService.jsm", {}).SocialService; - } - - let origin = "https://getpocket.com"; - SocialService.getProvider(origin, provider => { - if (provider) { - let pref = "social.backup.getpocket-com"; - if (!Services.prefs.prefHasUserValue(pref)) { - let str = Cc["@mozilla.org/supports-string;1"]. - createInstance(Ci.nsISupportsString); - str.data = JSON.stringify(provider.manifest); - Services.prefs.setComplexValue(pref, Ci.nsISupportsString, str); - SocialService.uninstallProvider(origin, () => {}); - } - } - }); - -} - -// PocketContextMenu -// When the context menu is opened check if we need to build and enable pocket UI. -var PocketContextMenu = { - init: function() { - Services.obs.addObserver(this, "on-build-contextmenu", false); - }, - shutdown: function() { - Services.obs.removeObserver(this, "on-build-contextmenu"); - // loop through windows and remove context menus - // iterate through all windows and add pocket to them - for (let win of CustomizableUI.windows) { - let document = win.document; - for (let id of ["context-pocket", "context-savelinktopocket"]) { - let element = document.getElementById(id); - if (element) - element.remove(); - } - } - }, - observe: function(aSubject, aTopic, aData) { - let subject = aSubject.wrappedJSObject; - let document = subject.menu.ownerDocument; - let pocketEnabled = CustomizableUI.getPlacementOfWidget("pocket-button"); - - let showSaveCurrentPageToPocket = !(subject.onTextInput || subject.onLink || - subject.isContentSelected || subject.onImage || - subject.onCanvas || subject.onVideo || subject.onAudio); - let targetUrl = subject.onLink ? subject.linkUrl : subject.pageUrl; - let targetURI = Services.io.newURI(targetUrl, null, null); - let canPocket = pocketEnabled && (targetURI.schemeIs("http") || targetURI.schemeIs("https") || - (targetURI.schemeIs("about") && ReaderMode.getOriginalUrl(targetUrl))); - - let showSaveLinkToPocket = canPocket && !showSaveCurrentPageToPocket && subject.onLink; - - // create menu entries if necessary - let menu = document.getElementById("context-pocket"); - if (!menu) { - menu = createElementWithAttrs(document, "menuitem", { - "id": "context-pocket", - "label": gPocketBundle.GetStringFromName("saveToPocketCmd.label"), - "accesskey": gPocketBundle.GetStringFromName("saveToPocketCmd.accesskey"), - "oncommand": "Pocket.savePage(gContextMenu.browser, gContextMenu.browser.currentURI.spec, gContextMenu.browser.contentTitle);" - }); - let sibling = document.getElementById("context-savepage"); - if (sibling.nextSibling) { - sibling.parentNode.insertBefore(menu, sibling.nextSibling); - } else { - sibling.parentNode.appendChild(menu); - } - } - menu.hidden = !(canPocket && showSaveCurrentPageToPocket); - - menu = document.getElementById("context-savelinktopocket"); - if (!menu) { - menu = createElementWithAttrs(document, "menuitem", { - "id": "context-savelinktopocket", - "label": gPocketBundle.GetStringFromName("saveLinkToPocketCmd.label"), - "accesskey": gPocketBundle.GetStringFromName("saveLinkToPocketCmd.accesskey"), - "oncommand": "Pocket.savePage(gContextMenu.browser, gContextMenu.linkURL);" - }); - let sibling = document.getElementById("context-savelink"); - if (sibling.nextSibling) { - sibling.parentNode.insertBefore(menu, sibling.nextSibling); - } else { - sibling.parentNode.appendChild(menu); - } - } - menu.hidden = !showSaveLinkToPocket; - } -} - -// PocketReader -// Listen for reader mode setup and add our button to the reader toolbar -var PocketReader = { - _hidden: true, - get hidden() { - return this._hidden; - }, - set hidden(hide) { - hide = !!hide; - if (hide === this._hidden) - return; - this._hidden = hide; - this.update(); - }, - startup: function() { - // Setup the listeners, update will be called when the widget is added, - // no need to do that now. - let mm = Services.mm; - mm.addMessageListener("Reader:OnSetup", this); - mm.addMessageListener("Reader:Clicked-pocket-button", this); - }, - shutdown: function() { - let mm = Services.mm; - mm.removeMessageListener("Reader:OnSetup", this); - mm.removeMessageListener("Reader:Clicked-pocket-button", this); - this.hidden = true; - }, - update: function() { - if (this.hidden) { - Services.mm.broadcastAsyncMessage("Reader:RemoveButton", { id: "pocket-button" }); - } else { - Services.mm.broadcastAsyncMessage("Reader:AddButton", - { id: "pocket-button", - title: gPocketBundle.GetStringFromName("pocket-button.tooltiptext"), - image: "chrome://pocket/content/panels/img/pocket.svg#pocket-mark" }); - } - }, - receiveMessage: function(message) { - switch (message.name) { - case "Reader:OnSetup": { - // Tell the reader about our button. - if (this.hidden) - break; - message.target.messageManager. - sendAsyncMessage("Reader:AddButton", { id: "pocket-button", - title: gPocketBundle.GetStringFromName("pocket-button.tooltiptext"), - image: "chrome://pocket/content/panels/img/pocket.svg#pocket-mark"}); - break; - } - case "Reader:Clicked-pocket-button": { - let doc = message.target.ownerDocument; - let pocketWidget = doc.getElementById("pocket-button"); - let placement = CustomizableUI.getPlacementOfWidget("pocket-button"); - if (placement) { - if (placement.area == CustomizableUI.AREA_PANEL) { - doc.defaultView.PanelUI.show().then(function() { - // The DOM node might not exist yet if the panel wasn't opened before. - pocketWidget = doc.getElementById("pocket-button"); - pocketWidget.doCommand(); - }); - } else { - pocketWidget.doCommand(); - } - } - break; - } - } - } -} - - -function pktUIGetter(prop, window) { - return { - get: function() { - // delete any getters for properties loaded from main.js so we only load main.js once - delete window.pktUI; - delete window.pktApi; - delete window.pktUIMessaging; - Services.scriptloader.loadSubScript("chrome://pocket/content/main.js", window); - return window[prop]; - }, - configurable: true, - enumerable: true - }; -} - -var PocketOverlay = { - startup: function(reason) { - let styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"] - .getService(Ci.nsIStyleSheetService); - this._sheetType = styleSheetService.AUTHOR_SHEET; - this._cachedSheet = styleSheetService.preloadSheet(gPocketStyleURI, - this._sheetType); - Services.ppmm.loadProcessScript(PROCESS_SCRIPT, true); - PocketReader.startup(); - CustomizableUI.addListener(this); - CreatePocketWidget(reason); - PocketContextMenu.init(); - - for (let win of CustomizableUI.windows) { - this.onWindowOpened(win); - } - }, - shutdown: function(reason) { - let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"] - .getService(Ci.nsIMessageBroadcaster); - ppmm.broadcastAsyncMessage("PocketShuttingDown"); - // Although the ppmm loads the scripts into the chrome process as well, - // we need to manually unregister here anyway to ensure these aren't part - // of the chrome process and avoid errors. - AboutPocket.aboutSaved.unregister(); - AboutPocket.aboutSignup.unregister(); - - CustomizableUI.removeListener(this); - for (let window of CustomizableUI.windows) { - for (let id of ["panelMenu_pocket", "menu_pocket", "BMB_pocket", - "panelMenu_pocketSeparator", "menu_pocketSeparator", - "BMB_pocketSeparator"]) { - let element = window.document.getElementById(id); - if (element) - element.remove(); - } - this.removeStyles(window); - // remove script getters/objects - delete window.Pocket; - delete window.pktApi; - delete window.pktUI; - delete window.pktUIMessaging; - } - CustomizableUI.destroyWidget("pocket-button"); - PocketContextMenu.shutdown(); - PocketReader.shutdown(); - }, - onWindowOpened: function(window) { - if (window.hasOwnProperty("pktUI")) - return; - this.setWindowScripts(window); - this.addStyles(window); - this.updateWindow(window); - }, - setWindowScripts: function(window) { - XPCOMUtils.defineLazyModuleGetter(window, "Pocket", - "chrome://pocket/content/Pocket.jsm"); - // Can't use XPCOMUtils for these because the scripts try to define the variables - // on window, and so the defineProperty inside defineLazyGetter fails. - Object.defineProperty(window, "pktApi", pktUIGetter("pktApi", window)); - Object.defineProperty(window, "pktUI", pktUIGetter("pktUI", window)); - Object.defineProperty(window, "pktUIMessaging", pktUIGetter("pktUIMessaging", window)); - }, - // called for each window as it is opened - updateWindow: function(window) { - // insert our three menu items - let document = window.document; - let hidden = !CustomizableUI.getPlacementOfWidget("pocket-button"); - - // add to bookmarksMenu - let sib = document.getElementById("menu_bookmarkThisPage"); - if (sib && !document.getElementById("menu_pocket")) { - let menu = createElementWithAttrs(document, "menuitem", { - "id": "menu_pocket", - "label": gPocketBundle.GetStringFromName("pocketMenuitem.label"), - "class": "menuitem-iconic", // OSX only - "oncommand": "openUILink(Pocket.listURL, event);", - "hidden": hidden - }); - let sep = createElementWithAttrs(document, "menuseparator", { - "id": "menu_pocketSeparator", - "hidden": hidden - }); - sib.parentNode.insertBefore(menu, sib); - sib.parentNode.insertBefore(sep, sib); - } - - // add to bookmarks-menu-button - sib = document.getElementById("BMB_bookmarksToolbar"); - if (sib && !document.getElementById("BMB_pocket")) { - let menu = createElementWithAttrs(document, "menuitem", { - "id": "BMB_pocket", - "label": gPocketBundle.GetStringFromName("pocketMenuitem.label"), - "class": "menuitem-iconic bookmark-item subviewbutton", - "oncommand": "openUILink(Pocket.listURL, event);", - "hidden": hidden - }); - let sep = createElementWithAttrs(document, "menuseparator", { - "id": "BMB_pocketSeparator", - "hidden": hidden - }); - sib.parentNode.insertBefore(menu, sib); - sib.parentNode.insertBefore(sep, sib); - } - - // add to PanelUI-bookmarks - sib = document.getElementById("panelMenuBookmarkThisPage"); - if (sib && !document.getElementById("panelMenu_pocket")) { - let menu = createElementWithAttrs(document, "toolbarbutton", { - "id": "panelMenu_pocket", - "label": gPocketBundle.GetStringFromName("pocketMenuitem.label"), - "class": "subviewbutton cui-withicon", - "oncommand": "openUILink(Pocket.listURL, event);", - "hidden": hidden - }); - let sep = createElementWithAttrs(document, "toolbarseparator", { - "id": "panelMenu_pocketSeparator", - "hidden": hidden - }); - // nextSibling is no-id toolbarseparator - // insert separator first then button - sib = sib.nextSibling; - sib.parentNode.insertBefore(sep, sib); - sib.parentNode.insertBefore(menu, sib); - } - }, - onWidgetAfterDOMChange: function(aWidgetNode) { - if (aWidgetNode.id != "pocket-button") { - return; - } - let doc = aWidgetNode.ownerDocument; - let hidden = !CustomizableUI.getPlacementOfWidget("pocket-button"); - for (let prefix of ["panelMenu_", "menu_", "BMB_"]) { - let element = doc.getElementById(prefix + "pocket"); - if (element) { - element.hidden = hidden; - doc.getElementById(prefix + "pocketSeparator").hidden = hidden; - } - } - // enable or disable reader button - PocketReader.hidden = hidden; - }, - - addStyles: function(win) { - let utils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); - utils.addSheet(this._cachedSheet, this._sheetType); - }, - - removeStyles: function(win) { - let utils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); - utils.removeSheet(gPocketStyleURI, this._sheetType); - } - -} - -// use enabled pref as a way for tests (e.g. test_contextmenu.html) to disable -// the addon when running. -function prefObserver(aSubject, aTopic, aData) { - let enabled = Services.prefs.getBoolPref("extensions.pocket.enabled"); - if (enabled) - PocketOverlay.startup(ADDON_ENABLE); - else - PocketOverlay.shutdown(ADDON_DISABLE); -} - -function startup(data, reason) { - AddonManager.getAddonByID("isreaditlater@ideashower.com", addon => { - if (addon && addon.isActive) - return; - setDefaultPrefs(); - // migrate enabled pref - if (Services.prefs.prefHasUserValue("browser.pocket.enabled")) { - Services.prefs.setBoolPref("extensions.pocket.enabled", Services.prefs.getBoolPref("browser.pocket.enabled")); - Services.prefs.clearUserPref("browser.pocket.enabled"); - } - // watch pref change and enable/disable if necessary - Services.prefs.addObserver("extensions.pocket.enabled", prefObserver, false); - if (!Services.prefs.getBoolPref("extensions.pocket.enabled")) - return; - PocketOverlay.startup(reason); - }); -} - -function shutdown(data, reason) { - // For speed sake, we should only do a shutdown if we're being disabled. - // On an app shutdown, just let it fade away... - if (reason != APP_SHUTDOWN) { - Services.prefs.removeObserver("extensions.pocket.enabled", prefObserver); - PocketOverlay.shutdown(reason); - } -} - -function install() { -} - -function uninstall() { -} diff --git a/browser/extensions/pocket/content/AboutPocket.jsm b/browser/extensions/pocket/content/AboutPocket.jsm deleted file mode 100644 index c7f57aa87..000000000 --- a/browser/extensions/pocket/content/AboutPocket.jsm +++ /dev/null @@ -1,93 +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/. */ -"use strict"; - -const { interfaces: Ci, results: Cr, manager: Cm, utils: Cu } = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error". -const PREF_LOG_LEVEL = "loop.debug.loglevel"; - -XPCOMUtils.defineLazyGetter(this, "log", () => { - let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI; - let consoleOptions = { - maxLogLevelPref: PREF_LOG_LEVEL, - prefix: "Loop" - }; - return new ConsoleAPI(consoleOptions); -}); - - -function AboutPage(chromeURL, aboutHost, classID, description, uriFlags) { - this.chromeURL = chromeURL; - this.aboutHost = aboutHost; - this.classID = Components.ID(classID); - this.description = description; - this.uriFlags = uriFlags; -} - -AboutPage.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), - getURIFlags: function(aURI) { // eslint-disable-line no-unused-vars - return this.uriFlags; - }, - - newChannel: function(aURI, aLoadInfo) { - let newURI = Services.io.newURI(this.chromeURL, null, null); - let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, - aLoadInfo); - channel.originalURI = aURI; - - if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { - let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); - channel.owner = principal; - } - return channel; - }, - - createInstance: function(outer, iid) { - if (outer !== null) { - throw Cr.NS_ERROR_NO_AGGREGATION; - } - return this.QueryInterface(iid); - }, - - register: function() { - Cm.QueryInterface(Ci.nsIComponentRegistrar).registerFactory( - this.classID, this.description, - "@mozilla.org/network/protocol/about;1?what=" + this.aboutHost, this); - }, - - unregister: function() { - Cm.QueryInterface(Ci.nsIComponentRegistrar).unregisterFactory( - this.classID, this); - } -}; - -/* exported AboutPocket */ -var AboutPocket = {}; - -XPCOMUtils.defineLazyGetter(AboutPocket, "aboutSaved", () => - new AboutPage("chrome://pocket/content/panels/saved.html", - "pocket-saved", - "{3e759f54-37af-7843-9824-f71b5993ceed}", - "About Pocket Saved", - Ci.nsIAboutModule.ALLOW_SCRIPT | - Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | - Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) -); - -XPCOMUtils.defineLazyGetter(AboutPocket, "aboutSignup", () => - new AboutPage("chrome://pocket/content/panels/signup.html", - "pocket-signup", - "{8548329d-00c4-234e-8f17-75026db3b56e}", - "About Pocket Signup", - Ci.nsIAboutModule.ALLOW_SCRIPT | - Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | - Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) -); - -this.EXPORTED_SYMBOLS = ["AboutPocket"]; diff --git a/browser/extensions/pocket/content/Pocket.jsm b/browser/extensions/pocket/content/Pocket.jsm deleted file mode 100644 index 54f9cdf11..000000000 --- a/browser/extensions/pocket/content/Pocket.jsm +++ /dev/null @@ -1,93 +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/. */ - -"use strict"; -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -this.EXPORTED_SYMBOLS = ["Pocket"]; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", - "resource:///modules/CustomizableUI.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", - "resource://gre/modules/ReaderMode.jsm"); - -var Pocket = { - get site() { return Services.prefs.getCharPref("extensions.pocket.site"); }, - get listURL() { return "https://" + Pocket.site + "/?src=ff_ext"; }, - - /** - * Functions related to the Pocket panel UI. - */ - onPanelViewShowing(event) { - let document = event.target.ownerDocument; - let window = document.defaultView; - let iframe = window.pktUI.getPanelFrame(); - - let urlToSave = Pocket._urlToSave; - let titleToSave = Pocket._titleToSave; - Pocket._urlToSave = null; - Pocket._titleToSave = null; - // ViewShowing fires immediately before it creates the contents, - // in lieu of an AfterViewShowing event, just spin the event loop. - window.setTimeout(function() { - if (urlToSave) { - window.pktUI.tryToSaveUrl(urlToSave, titleToSave); - } else { - window.pktUI.tryToSaveCurrentPage(); - } - - // pocketPanelDidHide in main.js set iframe to about:blank when it was - // hidden, make sure we're loading the save panel. - if (iframe.contentDocument && - iframe.contentDocument.readyState == "complete" && - iframe.contentDocument.documentURI != "about:blank") { - window.pktUI.pocketPanelDidShow(); - } else { - // iframe didn't load yet. This seems to always be the case when in - // the toolbar panel, but never the case for a subview. - // XXX this only being fired when it's a _capturing_ listener! - iframe.addEventListener("load", Pocket.onFrameLoaded, true); - } - }, 0); - }, - - onFrameLoaded(event) { - let document = event.currentTarget.ownerDocument; - let window = document.defaultView; - let iframe = window.pktUI.getPanelFrame(); - - iframe.removeEventListener("load", Pocket.onFrameLoaded, true); - window.pktUI.pocketPanelDidShow(); - }, - - onPanelViewHiding(event) { - let window = event.target.ownerGlobal; - window.pktUI.pocketPanelDidHide(event); - }, - - _urlToSave: null, - _titleToSave: null, - savePage(browser, url, title) { - let document = browser.ownerDocument; - let pocketWidget = document.getElementById("pocket-button"); - let placement = CustomizableUI.getPlacementOfWidget("pocket-button"); - if (!placement) - return; - - this._urlToSave = url; - this._titleToSave = title; - if (placement.area == CustomizableUI.AREA_PANEL) { - let win = document.defaultView; - win.PanelUI.show().then(function() { - pocketWidget = document.getElementById("pocket-button"); - pocketWidget.doCommand(); - }); - } else { - pocketWidget.doCommand(); - } - }, -}; diff --git a/browser/extensions/pocket/content/main.js b/browser/extensions/pocket/content/main.js deleted file mode 100644 index 3c1c5785e..000000000 --- a/browser/extensions/pocket/content/main.js +++ /dev/null @@ -1,737 +0,0 @@ -/* - * LICENSE - * - * POCKET MARKS - * - * Notwithstanding the permitted uses of the Software (as defined below) pursuant to the license set forth below, "Pocket," "Read It Later" and the Pocket icon and logos (collectively, the “Pocket Marks”) are registered and common law trademarks of Read It Later, Inc. This means that, while you have considerable freedom to redistribute and modify the Software, there are tight restrictions on your ability to use the Pocket Marks. This license does not grant you any rights to use the Pocket Marks except as they are embodied in the Software. - * - * --- - * - * SOFTWARE - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Pocket UI module - * - * Handles interactions with Pocket buttons, panels and menus. - * - */ - -// TODO : Get the toolbar icons from Firefox's build (Nikki needs to give us a red saved icon) -// TODO : [needs clarificaiton from Fx] Firefox's plan was to hide Pocket from context menus until the user logs in. Now that it's an extension I'm wondering if we still need to do this. -// TODO : [needs clarificaiton from Fx] Reader mode (might be a something they need to do since it's in html, need to investigate their code) -// TODO : [needs clarificaiton from Fx] Move prefs within pktApi.s to sqlite or a local file so it's not editable (and is safer) -// TODO : [nice to have] - Immediately save, buffer the actions in a local queue and send (so it works offline, works like our native extensions) - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", - "resource://gre/modules/ReaderMode.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "pktApi", - "chrome://pocket/content/pktApi.jsm"); - -var pktUI = (function() { - - // -- Initialization (on startup and new windows) -- // - var _currentPanelDidShow; - var _currentPanelDidHide; - - // Init panel id at 0. The first actual panel id will have the number 1 so - // in case at some point any panel has the id 0 we know there is something - // wrong - var _panelId = 0; - - var overflowMenuWidth = 230; - var overflowMenuHeight = 475; - var savePanelWidth = 350; - var savePanelHeights = {collapsed: 153, expanded: 272}; - - // -- Event Handling -- // - - /** - * Event handler when Pocket toolbar button is pressed - */ - - function pocketPanelDidShow(event) { - if (_currentPanelDidShow) { - _currentPanelDidShow(event); - } - - } - - function pocketPanelDidHide(event) { - if (_currentPanelDidHide) { - _currentPanelDidHide(event); - } - - // clear the panel - getPanelFrame().setAttribute('src', 'about:blank'); - } - - - // -- Communication to API -- // - - /** - * Either save or attempt to log the user in - */ - function tryToSaveCurrentPage() { - tryToSaveUrl(getCurrentUrl(), getCurrentTitle()); - } - - function tryToSaveUrl(url, title) { - - // If the user is logged in, go ahead and save the current page - if (pktApi.isUserLoggedIn()) { - saveAndShowConfirmation(url, title); - return; - } - - // If the user is not logged in, show the logged-out state to prompt them to authenticate - showSignUp(); - } - - - // -- Panel UI -- // - - /** - * Show the sign-up panel - */ - function showSignUp() { - // AB test: Direct logged-out users to tab vs panel - if (pktApi.getSignupPanelTabTestVariant() == 'v2') - { - let site = Services.prefs.getCharPref("extensions.pocket.site"); - openTabWithUrl('https://' + site + '/firefox_learnmore?s=ffi&t=autoredirect&tv=page_learnmore&src=ff_ext', true); - - // force the panel closed before it opens - getPanel().hidePopup(); - - return; - } - - // Control: Show panel as normal - getFirefoxAccountSignedInUser(function(userdata) - { - var fxasignedin = (typeof userdata == 'object' && userdata !== null) ? '1' : '0'; - var startheight = 490; - var inOverflowMenu = isInOverflowMenu(); - var controlvariant = pktApi.getSignupPanelTabTestVariant() == 'control'; - - if (inOverflowMenu) - { - startheight = overflowMenuHeight; - } - else - { - startheight = 460; - if (fxasignedin == '1') - { - startheight = 406; - } - } - if (!controlvariant) { - startheight = 427; - } - var variant; - if (inOverflowMenu) - { - variant = 'overflow'; - } - else - { - variant = 'storyboard_lm'; - } - - showPanel("about:pocket-signup?pockethost=" - + Services.prefs.getCharPref("extensions.pocket.site") - + "&fxasignedin=" - + fxasignedin - + "&variant=" - + variant - + '&controlvariant=' - + controlvariant - + '&inoverflowmenu=' - + inOverflowMenu - + "&locale=" - + getUILocale(), { - onShow: function() { - }, - onHide: panelDidHide, - width: inOverflowMenu ? overflowMenuWidth : 300, - height: startheight - }); - }); - } - - /** - * Show the logged-out state / sign-up panel - */ - function saveAndShowConfirmation(url, title) { - - // Validate input parameter - if (typeof url !== 'undefined' && url.startsWith("about:reader?url=")) { - url = ReaderMode.getOriginalUrl(url); - } - - var isValidURL = (typeof url !== 'undefined' && (url.startsWith("http") || url.startsWith('https'))); - - var inOverflowMenu = isInOverflowMenu(); - var startheight = pktApi.isPremiumUser() && isValidURL ? savePanelHeights.expanded : savePanelHeights.collapsed; - if (inOverflowMenu) { - startheight = overflowMenuHeight; - } - - var panelId = showPanel("about:pocket-saved?pockethost=" + Services.prefs.getCharPref("extensions.pocket.site") + "&premiumStatus=" + (pktApi.isPremiumUser() ? '1' : '0') + '&inoverflowmenu='+inOverflowMenu + "&locale=" + getUILocale(), { - onShow: function() { - var saveLinkMessageId = 'saveLink'; - - // Send error message for invalid url - if (!isValidURL) { - // TODO: Pass key for localized error in error object - let error = { - message: 'Only links can be saved', - localizedKey: "onlylinkssaved" - }; - pktUIMessaging.sendErrorMessageToPanel(panelId, saveLinkMessageId, error); - return; - } - - // Check online state - if (!navigator.onLine) { - // TODO: Pass key for localized error in error object - let error = { - message: 'You must be connected to the Internet in order to save to Pocket. Please connect to the Internet and try again.' - }; - pktUIMessaging.sendErrorMessageToPanel(panelId, saveLinkMessageId, error); - return; - } - - // Add url - var options = { - success: function(data, request) { - var item = data.item; - var successResponse = { - status: "success", - item: item - }; - pktUIMessaging.sendMessageToPanel(panelId, saveLinkMessageId, successResponse); - }, - error: function(error, request) { - // If user is not authorized show singup page - if (request.status === 401) { - showSignUp(); - return; - } - - // If there is no error message in the error use a - // complete catch-all - var errorMessage = error.message || "There was an error when trying to save to Pocket."; - var panelError = { message: errorMessage} - - // Send error message to panel - pktUIMessaging.sendErrorMessageToPanel(panelId, saveLinkMessageId, panelError); - } - } - - // Add title if given - if (typeof title !== "undefined") { - options.title = title; - } - - // Send the link - pktApi.addLink(url, options); - }, - onHide: panelDidHide, - width: inOverflowMenu ? overflowMenuWidth : savePanelWidth, - height: startheight - }); - } - - /** - * Open a generic panel - */ - function showPanel(url, options) { - - // Add new panel id - _panelId += 1; - url += ("&panelId=" + _panelId); - - // We don't have to hide and show the panel again if it's already shown - // as if the user tries to click again on the toolbar button the overlay - // will close instead of the button will be clicked - var iframe = getPanelFrame(); - - // Register event handlers - registerEventMessages(); - - // Load the iframe - iframe.setAttribute('src', url); - - // Uncomment to leave panel open -- for debugging - // panel.setAttribute('noautohide', true); - // panel.setAttribute('consumeoutsideclicks', false); - // - - // For some reason setting onpopupshown and onpopuphidden on the panel directly didn't work, so - // do it this hacky way for now - _currentPanelDidShow = options.onShow; - _currentPanelDidHide = options.onHide; - - resizePanel({ - width: options.width, - height: options.height - }); - return _panelId; - } - - /** - * Resize the panel - * options = { - * width: , - * height: , - * animate [default false] - * } - */ - function resizePanel(options) { - var iframe = getPanelFrame(); - var subview = getSubview(); - - if (subview) { - // Use the subview's size - iframe.style.width = "100%"; - iframe.style.height = subview.parentNode.clientHeight + "px"; - } else { - // Set an explicit size, panel will adapt. - iframe.style.width = options.width + "px"; - iframe.style.height = options.height + "px"; - } - } - - /** - * Called when the signup and saved panel was hidden - */ - function panelDidHide() { - // clear the onShow and onHide values - _currentPanelDidShow = null; - _currentPanelDidHide = null; - } - - /** - * Register all of the messages needed for the panels - */ - function registerEventMessages() { - var iframe = getPanelFrame(); - - // Only register the messages once - var didInitAttributeKey = 'did_init'; - var didInitMessageListener = iframe.getAttribute(didInitAttributeKey); - if (typeof didInitMessageListener !== "undefined" && didInitMessageListener == 1) { - return; - } - iframe.setAttribute(didInitAttributeKey, 1); - - // When the panel is displayed it generated an event called - // "show": we will listen for that event and when it happens, - // send our own "show" event to the panel's script, so the - // script can prepare the panel for display. - var _showMessageId = "show"; - pktUIMessaging.addMessageListener(iframe, _showMessageId, function(panelId, data) { - // Let panel know that it is ready - pktUIMessaging.sendMessageToPanel(panelId, _showMessageId); - }); - - // Open a new tab with a given url and activate if - var _openTabWithUrlMessageId = "openTabWithUrl"; - pktUIMessaging.addMessageListener(iframe, _openTabWithUrlMessageId, function(panelId, data, contentPrincipal) { - try { - urlSecurityCheck(data.url, contentPrincipal, Services.scriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL); - } catch (ex) { - return; - } - - // Check if the tab should become active after opening - var activate = true; - if (typeof data.activate !== "undefined") { - activate = data.activate; - } - - var url = data.url; - openTabWithUrl(url, activate); - pktUIMessaging.sendResponseMessageToPanel(panelId, _openTabWithUrlMessageId, url); - }); - - // Close the panel - var _closeMessageId = "close"; - pktUIMessaging.addMessageListener(iframe, _closeMessageId, function(panelId, data) { - getPanel().hidePopup(); - }); - - // Send the current url to the panel - var _getCurrentURLMessageId = "getCurrentURL"; - pktUIMessaging.addMessageListener(iframe, _getCurrentURLMessageId, function(panelId, data) { - pktUIMessaging.sendResponseMessageToPanel(panelId, _getCurrentURLMessageId, getCurrentUrl()); - }); - - var _resizePanelMessageId = "resizePanel"; - pktUIMessaging.addMessageListener(iframe, _resizePanelMessageId, function(panelId, data) { - resizePanel(data); - }); - - // Callback post initialization to tell background script that panel is "ready" for communication. - pktUIMessaging.addMessageListener(iframe, "listenerReady", function(panelId, data) { - - }); - - pktUIMessaging.addMessageListener(iframe, "collapseSavePanel", function(panelId, data) { - if (!pktApi.isPremiumUser() && !isInOverflowMenu()) - resizePanel({width:savePanelWidth, height:savePanelHeights.collapsed}); - }); - - pktUIMessaging.addMessageListener(iframe, "expandSavePanel", function(panelId, data) { - if (!isInOverflowMenu()) - resizePanel({width:savePanelWidth, height:savePanelHeights.expanded}); - }); - - // Ask for recently accessed/used tags for auto complete - var _getTagsMessageId = "getTags"; - pktUIMessaging.addMessageListener(iframe, _getTagsMessageId, function(panelId, data) { - pktApi.getTags(function(tags, usedTags) { - pktUIMessaging.sendResponseMessageToPanel(panelId, _getTagsMessageId, { - tags: tags, - usedTags: usedTags - }); - }); - }); - - // Ask for suggested tags based on passed url - var _getSuggestedTagsMessageId = "getSuggestedTags"; - pktUIMessaging.addMessageListener(iframe, _getSuggestedTagsMessageId, function(panelId, data) { - pktApi.getSuggestedTagsForURL(data.url, { - success: function(data, response) { - var suggestedTags = data.suggested_tags; - var successResponse = { - status: "success", - value: { - suggestedTags: suggestedTags - } - } - pktUIMessaging.sendResponseMessageToPanel(panelId, _getSuggestedTagsMessageId, successResponse); - }, - error: function(error, response) { - pktUIMessaging.sendErrorResponseMessageToPanel(panelId, _getSuggestedTagsMessageId, error); - } - }) - }); - - // Pass url and array list of tags, add to existing save item accordingly - var _addTagsMessageId = "addTags"; - pktUIMessaging.addMessageListener(iframe, _addTagsMessageId, function(panelId, data) { - pktApi.addTagsToURL(data.url, data.tags, { - success: function(data, response) { - var successResponse = {status: "success"}; - pktUIMessaging.sendResponseMessageToPanel(panelId, _addTagsMessageId, successResponse); - }, - error: function(error, response) { - pktUIMessaging.sendErrorResponseMessageToPanel(panelId, _addTagsMessageId, error); - } - }); - }); - - // Based on clicking "remove page" CTA, and passed unique item id, remove the item - var _deleteItemMessageId = "deleteItem"; - pktUIMessaging.addMessageListener(iframe, _deleteItemMessageId, function(panelId, data) { - pktApi.deleteItem(data.itemId, { - success: function(data, response) { - var successResponse = {status: "success"}; - pktUIMessaging.sendResponseMessageToPanel(panelId, _deleteItemMessageId, successResponse); - }, - error: function(error, response) { - pktUIMessaging.sendErrorResponseMessageToPanel(panelId, _deleteItemMessageId, error); - } - }) - }); - - var _initL10NMessageId = "initL10N"; - pktUIMessaging.addMessageListener(iframe, _initL10NMessageId, function(panelId, data) { - var strings = {}; - var bundle = Services.strings.createBundle("chrome://pocket/locale/pocket.properties"); - var e = bundle.getSimpleEnumeration(); - while (e.hasMoreElements()) { - var str = e.getNext().QueryInterface(Components.interfaces.nsIPropertyElement); - if (str.key in data) { - strings[str.key] = bundle.formatStringFromName(str.key, data[str.key], data[str.key].length); - } else { - strings[str.key] = str.value; - } - } - pktUIMessaging.sendResponseMessageToPanel(panelId, _initL10NMessageId, { strings: strings }); - }); - - } - - // -- Browser Navigation -- // - - /** - * Open a new tab with a given url and notify the iframe panel that it was opened - */ - - function openTabWithUrl(url) { - let recentWindow = Services.wm.getMostRecentWindow("navigator:browser"); - if (!recentWindow) { - Cu.reportError("Pocket: No open browser windows to openTabWithUrl"); - return; - } - - // If the user is in permanent private browsing than this is not an issue, - // since the current window will always share the same cookie jar as the other - // windows. - if (!PrivateBrowsingUtils.isWindowPrivate(recentWindow) || - PrivateBrowsingUtils.permanentPrivateBrowsing) { - recentWindow.openUILinkIn(url, "tab"); - return; - } - - let windows = Services.wm.getEnumerator("navigator:browser"); - while (windows.hasMoreElements()) { - let win = windows.getNext(); - if (!PrivateBrowsingUtils.isWindowPrivate(win)) { - win.openUILinkIn(url, "tab"); - return; - } - } - - // If there were no non-private windows opened already. - recentWindow.openUILinkIn(url, "window"); - } - - - // -- Helper Functions -- // - - function getCurrentUrl() { - return getBrowser().currentURI.spec; - } - - function getCurrentTitle() { - return getBrowser().contentTitle; - } - - function getPanel() { - var frame = getPanelFrame(); - var panel = frame; - while (panel && panel.localName != "panel") { - panel = panel.parentNode; - } - return panel; - } - - function getPanelFrame() { - var frame = document.getElementById('pocket-panel-iframe'); - if (!frame) { - var frameParent = document.getElementById("PanelUI-pocketView").firstChild; - frame = document.createElement("iframe"); - frame.id = 'pocket-panel-iframe'; - frame.setAttribute("type", "content"); - frameParent.appendChild(frame); - } - return frame; - } - - function getSubview() { - var view = document.getElementById("PanelUI-pocketView"); - if (view && view.getAttribute("current") == "true") - return view; - return null; - } - - function isInOverflowMenu() { - var subview = getSubview(); - return !!subview; - } - - function getFirefoxAccountSignedInUser(callback) { - fxAccounts.getSignedInUser().then(userData => { - callback(userData); - }).then(null, error => { - callback(); - }); - } - - function getUILocale() { - var locale = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIXULChromeRegistry). - getSelectedLocale("browser"); - return locale; - } - - /** - * Public functions - */ - return { - getPanelFrame: getPanelFrame, - - openTabWithUrl: openTabWithUrl, - - pocketPanelDidShow: pocketPanelDidShow, - pocketPanelDidHide: pocketPanelDidHide, - - tryToSaveUrl: tryToSaveUrl, - tryToSaveCurrentPage: tryToSaveCurrentPage - }; -}()); - -// -- Communication to Background -- // -// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Interaction_between_privileged_and_non-privileged_pages -var pktUIMessaging = (function() { - - /** - * Prefix message id for message listening - */ - function prefixedMessageId(messageId) { - return 'PKT_' + messageId; - } - - /** - * Register a listener and callback for a specific messageId - */ - function addMessageListener(iframe, messageId, callback) { - iframe.addEventListener(prefixedMessageId(messageId), function(e) { - var nodePrincipal = e.target.nodePrincipal; - // ignore to ensure we do not pick up other events in the browser - if (!nodePrincipal || !nodePrincipal.URI || !nodePrincipal.URI.spec.startsWith("about:pocket")) { - return; - } - - // Pass in information to callback - var payload = JSON.parse(e.target.getAttribute("payload"))[0]; - var panelId = payload.panelId; - var data = payload.data; - callback(panelId, data, nodePrincipal); - - // Cleanup the element - e.target.parentNode.removeChild(e.target); - - }, false, true); - } - - /** - * Send a message to the panel's iframe - */ - function sendMessageToPanel(panelId, messageId, payload) { - - if (!isPanelIdValid(panelId)) { return; } - - var panelFrame = pktUI.getPanelFrame(); - if (!isPocketPanelFrameValid(panelFrame)) { return; } - - var doc = panelFrame.contentWindow.document; - var documentElement = doc.documentElement; - - // Send message to panel - var panelMessageId = prefixedMessageId(panelId + '_' + messageId); - - var AnswerEvt = doc.createElement("PKTMessage"); - AnswerEvt.setAttribute("payload", JSON.stringify([payload])); - documentElement.appendChild(AnswerEvt); - - var event = doc.createEvent("HTMLEvents"); - event.initEvent(panelMessageId, true, false); - AnswerEvt.dispatchEvent(event); - } - - function sendResponseMessageToPanel(panelId, messageId, payload) { - var responseMessageId = messageId + "Response"; - sendMessageToPanel(panelId, responseMessageId, payload); - } - - /** - * Helper function to package an error object and send it to the panel - * iframe as a message response - */ - function sendErrorMessageToPanel(panelId, messageId, error) { - var errorResponse = {status: "error", error: error}; - sendMessageToPanel(panelId, messageId, errorResponse); - } - - function sendErrorResponseMessageToPanel(panelId, messageId, error) { - var errorResponse = {status: "error", error: error}; - sendResponseMessageToPanel(panelId, messageId, errorResponse); - } - - /** - * Validation - */ - - function isPanelIdValid(panelId) { - // First check if panelId has a valid value > 0. We set the panelId to - // 0 to start. But if for some reason the message is attempted to be - // sent before the panel has a panelId, then it's going to send out - // a message with panelId 0, which is never going to be heard. If this - // happens, it means some race condition occurred where the panel was - // trying to communicate before it should. - if (panelId === 0) { - console.warn("Tried to send message to panel with id 0.") - return false; - } - - return true - } - - function isPocketPanelFrameValid(panelFrame) { - // Check if panel is available if not throw a warning and bailout. - // We likely try to send to a panel that is not visible anymore - if (typeof panelFrame === "undefined") { - console.warn("Pocket panel frame is undefined"); - return false; - } - - var contentWindow = panelFrame.contentWindow; - if (typeof contentWindow == "undefined") { - console.warn("Pocket panel frame content window is undefined"); - return false; - } - - var doc = contentWindow.document; - if (typeof doc === "undefined") { - console.warn("Pocket panel frame content window document is undefined"); - return false; - } - - var documentElement = doc.documentElement; - if (typeof documentElement === "undefined") { - console.warn("Pocket panel frame content window document document element is undefined"); - return false; - } - - return true; - } - - /** - * Public - */ - return { - addMessageListener: addMessageListener, - sendMessageToPanel: sendMessageToPanel, - sendResponseMessageToPanel: sendResponseMessageToPanel, - sendErrorMessageToPanel: sendErrorMessageToPanel, - sendErrorResponseMessageToPanel: sendErrorResponseMessageToPanel - } -}()); diff --git a/browser/extensions/pocket/content/panels/css/firasans.css b/browser/extensions/pocket/content/panels/css/firasans.css deleted file mode 100644 index 5915345d6..000000000 --- a/browser/extensions/pocket/content/panels/css/firasans.css +++ /dev/null @@ -1,6 +0,0 @@ -@font-face { - font-family: 'FiraSans'; - src: url('../fonts/FiraSans-Regular.woff') format('woff'); - font-weight: normal; - font-style: normal; -}
\ No newline at end of file diff --git a/browser/extensions/pocket/content/panels/css/normalize.css b/browser/extensions/pocket/content/panels/css/normalize.css deleted file mode 100644 index b7b4b746e..000000000 --- a/browser/extensions/pocket/content/panels/css/normalize.css +++ /dev/null @@ -1,424 +0,0 @@ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover { - outline: 0; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - box-sizing: content-box; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} - -/* Normalization for FF panel defauts - ========================================================================== */ -html { - outline: none; - padding: 0; -} - -a { - color: #0095dd; - margin: 0; - outline: none; - padding: 0; - text-decoration: none; -} - -a:hover, -a:active { - color: #008acb; - text-decoration: underline; -} - -a:active { - color: #006b9d; -} diff --git a/browser/extensions/pocket/content/panels/css/saved.css b/browser/extensions/pocket/content/panels/css/saved.css deleted file mode 100644 index d3f88d04c..000000000 --- a/browser/extensions/pocket/content/panels/css/saved.css +++ /dev/null @@ -1,825 +0,0 @@ -/* saved.css - * - * Description: - * With base elements out of the way, this sets all custom styling for the page saved dialog. - * - * Contents: - * Global - * Loading spinner - * Core detail - * Tag entry - * Recent/suggested tags - * Premium upsell - * Token input/autocomplete - * Overflow mode - * Language overrides - */ - -/*=Global ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersaved { - background-color: #fbfbfb; - border-radius: 4px; - display: block; - font-size: 16px; - font-family: "FiraSans", "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 0; - position: relative; - text-align: center; -} -.pkt_ext_cf:after { - content: " "; - display:table; - clear:both; -} -.pkt_ext_containersaved .pkt_ext_tag_detail, -.pkt_ext_containersaved .pkt_ext_recenttag_detail, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail { - margin: 0 auto; - padding: 0.25em 1em; - position: relative; - width: auto; -} - -/*=Loading spinner ---------------------------------------------------------------------------------------- */ -@keyframes pkt_ext_spin { - to { - transform: rotate(1turn); - } -} -.pkt_ext_containersaved { - font-size: 16px; -} -.pkt_ext_containersaved .pkt_ext_loadingspinner { - position: relative; - display: inline-block; - height: 2.5em; - left: 50%; - margin: 2em 0 0 -1.25em; - font-size: 10px; - text-indent: 999em; - position: absolute; - top: 4em; - overflow: hidden; - width: 2.5em; - animation: pkt_ext_spin 0.7s infinite steps(8); -} -.pkt_ext_containersaved .pkt_ext_loadingspinner:before, -.pkt_ext_containersaved .pkt_ext_loadingspinner:after, -.pkt_ext_containersaved .pkt_ext_loadingspinner > div:before, -.pkt_ext_containersaved .pkt_ext_loadingspinner > div:after { - content: ''; - position: absolute; - top: 0; - left: 1.125em; - width: 0.25em; - height: 0.75em; - border-radius: .2em; - background: #eee; - box-shadow: 0 1.75em #eee; - transform-origin: 50% 1.25em; -} -.pkt_ext_containersaved .pkt_ext_loadingspinner:before { - background: #555; -} -.pkt_ext_containersaved .pkt_ext_loadingspinner:after { - transform: rotate(-45deg); - background: #777; -} -.pkt_ext_containersaved .pkt_ext_loadingspinner > div:before { - transform: rotate(-90deg); - background: #999; -} -.pkt_ext_containersaved .pkt_ext_loadingspinner > div:after { - transform: rotate(-135deg); - background: #bbb; -} - -/*=Core detail ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersaved .pkt_ext_initload { - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.pkt_ext_containersaved .pkt_ext_detail { - max-height: 0; - opacity: 0; - position: relative; - z-index: 10; -} -.pkt_ext_container_detailactive .pkt_ext_initload { - opacity: 0; -} -.pkt_ext_container_detailactive .pkt_ext_initload .pkt_ext_loadingspinner, -.pkt_ext_container_finalstate .pkt_ext_initload .pkt_ext_loadingspinner { - animation: none; -} -.pkt_ext_container_detailactive .pkt_ext_detail { - max-height: 20em; - opacity: 1; -} -.pkt_ext_container_finalstate .pkt_ext_edit_msg, -.pkt_ext_container_finalstate .pkt_ext_tag_detail, -.pkt_ext_container_finalstate .pkt_ext_suggestedtag_detail, -.pkt_ext_container_finalstate .pkt_ext_item_actions { - opacity: 0; - transition: opacity 0.2s ease-out; -} -.pkt_ext_container_finalerrorstate .pkt_ext_edit_msg, -.pkt_ext_container_finalerrorstate .pkt_ext_tag_detail, -.pkt_ext_container_finalerrorstate .pkt_ext_suggestedtag_detail, -.pkt_ext_container_finalerrorstate .pkt_ext_item_actions { - display: none; - transition: none; -} -.pkt_ext_containersaved h2 { - background: transparent; - border: none; - color: #333; - display: block; - float: none; - font-size: 18px; - font-weight: normal; - letter-spacing: normal; - line-height: 1; - margin: 19px 0 4px; - padding: 0; - position: relative; - text-align: left; - text-transform: none; -} -@keyframes fade_in_out { - 0% { - opacity: 1; - } - 50% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -.pkt_ext_container_finalstate h2 { - animation: fade_in_out 0.4s ease-out; -} -.pkt_ext_container_finalerrorstate h2 { - animation: none; - color: #d74345; -} -.pkt_ext_containersaved .pkt_ext_errordetail { - display: none; - font-size: 12px; - font-weight: normal; - left: 6.4em; - max-width: 21em; - opacity: 0; - position: absolute; - top: 2.7em; - text-align: left; - visibility: hidden; -} -.pkt_ext_container_finalerrorstate .pkt_ext_errordetail { - display: block; - opacity: 1; - visibility: visible; -} -.pkt_ext_containersaved .pkt_ext_logo { - background: url(../img/pocketlogosolo@1x.png) center center no-repeat; - display: block; - float: left; - height: 40px; - padding: 1.25em 1em; - position: relative; - width: 44px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersaved .pkt_ext_logo { - background-image: url(../img/pocketlogosolo@2x.png); - background-size: 44px 40px; - } -} -.pkt_ext_container_finalerrorstate .pkt_ext_logo { - background-image: url(../img/pocketerror@1x.png); - height: 44px; - width: 44px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_container_finalerrorstate .pkt_ext_logo { - background-image: url(../img/pocketerror@2x.png); - background-size: 44px 44px; - } -} -.pkt_ext_containersaved .pkt_ext_topdetail { - float: left; -} -.pkt_ext_containersaved .pkt_ext_edit_msg { - box-sizing: border-box; - display: none; - font-size: 0.75em; - left: auto; - padding: 0 1.4em; - position: absolute; - text-align: left; - top: 8.7em; - width: 100%; -} -.pkt_ext_containersaved .pkt_ext_edit_msg_error { - color: #d74345; -} -.pkt_ext_containersaved .pkt_ext_edit_msg_active { - display: block; -} -.pkt_ext_containersaved .pkt_ext_item_actions { - background: transparent; - float: none; - height: auto; - margin-bottom: 1em; - margin-top: 0; - width: auto; -} -.pkt_ext_containersaved .pkt_ext_item_actions_disabled { - opacity: 0.5; -} -.pkt_ext_container_finalstate .pkt_ext_item_actions_disabled { - opacity: 0; -} -.pkt_ext_containersaved .pkt_ext_item_actions ul { - background: none; - display: block; - float: none; - font-size: 16px; - height: auto; - margin: 0; - padding: 0; - width: 100%; -} -.pkt_ext_containersaved .pkt_ext_item_actions li { - box-sizing: border-box; - background: none; - border: 0; - float: left; - list-style: none; - line-height: 0.8; - height: auto; - padding-right: 0.4em; - width: auto; -} -.pkt_ext_containersaved .pkt_ext_item_actions li:before { - content: none; -} -.pkt_ext_containersaved .pkt_ext_item_actions .pkt_ext_actions_separator { - border-left: 2px solid #777; - height: 0.75em; - margin-top: 0.3em; - padding: 0; - width: 10px; -} -.pkt_ext_containersaved .pkt_ext_item_actions a { - background: transparent; - color: #0095dd; - display: block; - font-feature-settings: normal; - font-size: 12px; - font-weight: normal; - letter-spacing: normal; - line-height: inherit; - height: auto; - margin: 0; - padding: 0.5em; - float: left; - text-align: left; - text-decoration: none; - text-transform: none; -} -.pkt_ext_containersaved .pkt_ext_item_actions a:hover { - color: #008acb; - text-decoration: underline; -} -.pkt_ext_containersaved .pkt_ext_item_actions a:before, -.pkt_ext_containersaved .pkt_ext_item_actions a:after { - background: transparent; - display: none; -} -.pkt_ext_containersaved .pkt_ext_item_actions_disabled a { - cursor: default; -} -.pkt_ext_containersaved .pkt_ext_item_actions .pkt_ext_openpocket { - float: right; - padding-right: 0.7em; - text-align: right; -} -.pkt_ext_containersaved .pkt_ext_item_actions .pkt_ext_removeitem { - padding-left: 0; -} -.pkt_ext_containersaved .pkt_ext_close { - background: url(../img/tag_close@1x.png) center center no-repeat; - color: #333; - display: block; - font-size: 0.8em; - height: 10px; - right: 0.5em; - overflow: hidden; - position: absolute; - text-align: center; - text-indent: -9999px; - top: -1em; - width: 10px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersaved .pkt_ext_close { - background-image: url(../img/tag_close@2x.png); - background-size: 8px 8px; - } -} -.pkt_ext_containersaved .pkt_ext_close:hover { - color: #000; - text-decoration: none; -} - -/*=Tag entry ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersaved .pkt_ext_tag_detail { - border: 1px solid #c1c1c1; - border-radius: 2px; - font-size: 16px; - clear: both; - margin: 1.25em 1em; - padding: 0; - display: flex; -} -.pkt_ext_containersaved .pkt_ext_tag_error { - border: none; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper { - box-sizing: border-box; - flex: 1; - background-color: #fff; - border-right: 1px solid #c3c3c3; - color: #333; - display: block; - float: none; - font-size: 0.875em; - list-style: none; - margin: 0; - overflow: hidden; - padding: 0.25em 0.5em; - width: 14em; - padding-left: 0.5em; - padding-right: 0.5em; -} -.pkt_ext_containersaved .pkt_ext_tag_error .pkt_ext_tag_input_wrapper { - border: 1px solid #d74345; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper .token-input-list { - display: block; - left: 0; - height: 1.7em; - overflow: hidden; - position: relative; - width: 60em; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper .token-input-list, -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper li { - font-size: 14px; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper li { - height: auto; - width: auto; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper li:before { - content: none; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper input { - border: 0; - box-shadow: none; - background-color: #fff; - color: #333; - font-size: 14px; - float: left; - line-height: normal; - height: auto; - min-height: 0; - min-width: 5em; - padding: 3px 2px 1px; - text-transform: none; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper input::placeholder { - color: #a9a9a9; - letter-spacing: normal; - text-transform: none; -} -.pkt_ext_containersaved .input_disabled { - cursor: default; - opacity: 0.5; -} -.pkt_ext_containersaved .pkt_ext_btn { - box-sizing: border-box; - color: #333; - float: none; - font-size: 0.875em; - font-size: 14px; - letter-spacing: normal; - height: 2.2em; - min-width: 4em; - padding: 0.5em 0; - text-decoration: none; - text-transform: none; - width: auto; -} -.pkt_ext_containersaved .pkt_ext_btn:hover { - background-color: #ebebeb; -} -.pkt_ext_containersaved .pkt_ext_btn:active { - background-color: #dadada; -} -.pkt_ext_containersaved .pkt_ext_btn_disabled, -.pkt_ext_containersaved .pkt_ext_btn_disabled:hover, -.pkt_ext_containersaved .pkt_ext_btn_disabled:active { - background-color: transparent; - cursor: default; - opacity: 0.4; -} -.pkt_ext_containersaved .pkt_ext_tag_error .pkt_ext_btn { - border: 1px solid #c3c3c3; - border-width: 1px 1px 1px 0; - height: 2.35em; -} -.pkt_ext_containersaved .autocomplete-suggestions { - margin-top: 2.2em; -} - -/*=Recent/suggested tags ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detailshown { - border-top: 1px solid #c1c1c1; - bottom: 0; - box-sizing: border-box; - background: #ebebeb; - clear: both; - left: 0; - opacity: 0; - min-height: 110px; - position: fixed; - visibility: hidden; - width: 100%; -} -.pkt_ext_container_detailactive .pkt_ext_suggestedtag_detail, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detailshown { - opacity: 1; - visibility: visible; -} -.pkt_ext_containersaved .pkt_ext_suggestedtag_detailshown { - padding: 4px 0; -} -.pkt_ext_container_finalstate .pkt_ext_suggestedtag_detail { - opacity: 0; - visibility: hidden; -} -.pkt_ext_containersaved -.pkt_ext_containersaved .pkt_ext_recenttag_detail h4, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail h4 { - color: #333; - font-size: 0.8125em; - font-size: 13px; - font-weight: normal; - font-style: normal; - letter-spacing: normal; - margin: 0.5em 0; - text-align: left; - text-transform: none; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail .pkt_ext_loadingspinner, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail .pkt_ext_loadingspinner { - display: none; - position: absolute; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail_loading .pkt_ext_loadingspinner, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail_loading .pkt_ext_loadingspinner { - display: block; - font-size: 6px; - left: 48%; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail ul, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail ul { - display: block; - margin: 0; - height: 2em; - overflow: hidden; - padding: 2px 0 0 0; -} -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail ul { - height: auto; - margin: 0; - max-height: 4em; - padding-top: 6px; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail li, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail li { - background: none; - float: left; - height: inherit; - line-height: 1.5; - list-style: none; - margin-bottom: 0.5em; - width: inherit; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail li:before, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail li:before { - content: none; -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail .recenttag_msg, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail .suggestedtag_msg { - color: #333; - font-size: 0.8125em; - line-height: 1.2; - left: auto; - position: absolute; - text-align: left; - top: 2em; -} -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail .suggestedtag_msg { - margin-right: 1.3em; -} -.pkt_ext_containersaved .token_tag { - border-radius: 4px; - background: #f7f7f7; - border: 1px solid #c3c3c3; - color: #333; - font-size: 0.875em; - font-size: 14px; - font-weight: normal; - letter-spacing: normal; - margin-right: 0.5em; - padding: 0.125em 0.625em; - text-decoration: none; - text-transform: none; -} -.pkt_ext_containersaved .token_tag:hover { - background-color: #008acb; - border-color: #008acb; - color: #fff; - text-decoration: none; -} -.pkt_ext_containersaved .token_tag:before, -.pkt_ext_containersaved .token_tag:after { - content: none; -} -.pkt_ext_containersaved .token_tag:hover span { - background-image: url(../img/tag_closeactive@1x.png); -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersaved .token_tag:hover span { - background-image: url(../img/tag_closeactive@2x.png); - background-size: 8px 8px; - } -} -.pkt_ext_containersaved .pkt_ext_recenttag_detail_disabled .token_tag, -.pkt_ext_containersaved .pkt_ext_recenttag_detail_disabled .token_tag:hover, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail_disabled .token_tag, -.pkt_ext_containersaved .pkt_ext_suggestedtag_detail_disabled .token_tag:hover { - background-color: #f7f7f7; - cursor: default; - opacity: 0.5; -} -.pkt_ext_containersaved .token_tag_inactive { - display: none; -} - -/*=Premium upsell ---------------------------------------------------------------------------------------- */ -.pkt_ext_detail .pkt_ext_premupsell { - background-color: #50bbb6; - display: block; - padding: 1.5em 0; - text-align: center; -} -.pkt_ext_premupsell h4 { - color: #fff; - font-size: 1em; - margin-bottom: 1em; -} -.pkt_ext_premupsell a { - color: #28605d; - border-bottom: 1px solid #47a7a3; - font-weight: normal; -} -.pkt_ext_premupsell a:hover { - color: #14302f; -} - -/*=Token input/autocomplete ---------------------------------------------------------------------------------------- */ -.token-input-dropdown-tag { - border-radius: 4px; - box-sizing: border-box; - background: #fff; - border: 1px solid #cdcdcd; - margin-top: 0.5em; - left: 0 !important; - overflow-y: auto; - top: 1.9em !important; - z-index: 9000; -} -.token-input-dropdown-tag ul { - height: inherit; - max-height: 115px; - margin: 0; - overflow: auto; - padding: 0.5em 0; -} -.token-input-dropdown-tag ul li { - background: none; - color: #333; - font-weight: normal; - font-size: 1em; - float: none; - height: inherit; - letter-spacing: normal; - list-style: none; - padding: 0.75em; - text-align: left; - text-transform: none; - width: inherit; -} -.token-input-dropdown-tag ul li:before { - content: none; -} -.token-input-dropdown ul li.token-input-selected-dropdown-item { - background-color: #008acb; - color: #fff; -} -.token-input-list { - list-style: none; - margin: 0; - padding: 0; -} -.token-input-list li { - text-align: left; - list-style: none; -} -.token-input-list li input { - border: 0; - background-color: white; -} -.pkt_ext_containersaved .token-input-token { - background: none; - border-radius: 4px; - border: 1px solid #c3c3c3; - overflow: hidden; - margin: 0; - padding: 0 8px; - background-color: #f7f7f7; - color: #000; - font-weight: normal; - cursor: default; - line-height: 1.5; - display: block; - width: auto; - margin: 0 0.2em; - float: left; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled { - position: relative; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled input { - opacity: 0.5; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled .token-input-list { - opacity: 0.5; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled .pkt_ext_tag_input_blocker { - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - z-index: 5; -} -.pkt_ext_containersaved .token-input-token p { - display: inline-block; - font-size: 14px; - font-weight: normal; - line-height: inherit; - letter-spacing: normal; - padding: 0; - margin: 0; - text-transform: none; - vertical-align: top; - width: auto; -} -.pkt_ext_containersaved .token-input-token p:before { - content: none; - width: 0; -} -.pkt_ext_containersaved .token-input-token span { - background: url(../img/tag_close@1x.png) center center no-repeat; - cursor: pointer; - display: inline-block; - height: 8px; - margin: 0 0 0 8px; - overflow: hidden; - width: 8px; - text-indent: -99px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersaved .token-input-token span { - background-image: url(../img/tag_close@2x.png); - background-size: 8px 8px; - } -} -.pkt_ext_containersaved .token-input-selected-token { - background-color: #008acb; - border-color: #008acb; - color: #fff; -} -.pkt_ext_containersaved .token-input-selected-token span { - background-image: url(../img/tag_closeactive@1x.png); -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersaved .token-input-selected-token span { - background-image: url(../img/tag_closeactive@2x.png); - background-size: 8px 8px; - } -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled .token-input-selected-token { - background-color: #f7f7f7; -} -.pkt_ext_containersaved .pkt_ext_tag_input_wrapper_disabled .token-input-selected-token span { - color: #bbb; -} - -/*=Overflow mode ---------------------------------------------------------------------------------------- */ -.pkt_ext_saved_overflow .pkt_ext_logo { - float: none; - margin: 0.5em auto 0; -} -.pkt_ext_saved_overflow .pkt_ext_initload { - top: -8px; -} -.pkt_ext_saved_overflow .pkt_ext_loadingspinner { - top: 10em; -} -.pkt_ext_saved_overflow .pkt_ext_topdetail { - float: none; - margin: 0 auto; - padding: 0 1em; -} -.pkt_ext_saved_overflow h2 { - margin-bottom: 0.5em; - margin-top: 0; - text-align: center; -} -.pkt_ext_saved_overflow .pkt_ext_item_actions ul { - display: inline-block; - width: auto; -} -.pkt_ext_saved_overflow .pkt_ext_item_actions li { - float: none; - padding-left: 1em; - padding-right: 1em; - text-align: center; -} -.pkt_ext_saved_overflow .pkt_ext_item_actions .pkt_ext_removeitem, -.pkt_ext_saved_overflow .pkt_ext_item_actions .pkt_ext_openpocket { - float: none; - text-align: center; - padding-left: 0; - padding-right: 0; -} -.pkt_ext_saved_overflow .pkt_ext_item_actions .pkt_ext_actions_separator { - display: none; -} -.pkt_ext_saved_overflow .pkt_ext_tag_detail { - margin-top: 0; -} -.pkt_ext_saved_overflow .pkt_ext_suggestedtag_detail, -.pkt_ext_saved_overflow .pkt_ext_suggestedtag_detailshown { - top: 14.75em; -} -.pkt_ext_saved_overflow .pkt_ext_edit_msg { - top: 16em; -} -.pkt_ext_container_finalerrorstate.pkt_ext_saved_overflow .pkt_ext_errordetail { - box-sizing: border-box; - left: 0; - padding-left: 1em; - padding-right: 1em; - text-align: center; - top: 8.3em; - width: 100%; -} - -/*=Language overrides ---------------------------------------------------------------------------------------- */ -.pkt_ext_saved_es .pkt_ext_btn { - min-width: 5em; -} -.pkt_ext_saved_de .pkt_ext_btn, -.pkt_ext_saved_ru .pkt_ext_btn { - min-width: 6em; -} diff --git a/browser/extensions/pocket/content/panels/css/signup.css b/browser/extensions/pocket/content/panels/css/signup.css deleted file mode 100644 index 5c428a29b..000000000 --- a/browser/extensions/pocket/content/panels/css/signup.css +++ /dev/null @@ -1,424 +0,0 @@ -/* signup.css - * - * Description: - * With base elements out of the way, this sets all custom styling for the extension. - * - * Contents: - * Global - * Core detail - * Core detail - storyboard - * Buttons - * Overflow mode - * Language overrides - */ - -/*=Global ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersignup { - background-color: #ebebeb; - color: #333; - display: block; - font-size: 16px; - font-family: "FiraSans", "Helvetica Neue", Helvetica, Arial, sans-serif; - margin: 0; - padding: 0; - position: relative; - text-align: center; -} -.pkt_ext_containersignup_inactive { - animation: pkt_ext_hide 0.3s ease-out; - opacity: 0; - visibility: hidden; -} -.pkt_ext_cf:after { - content: " "; - display: table; - clear: both; -} -@keyframes pkt_ext_hide { - 0% { - opacity: 1; - visibility: visible; - } - 99% { - opacity: 0; - visibility: visible; - } - 100% { - opacity: 0; - visibility: hidden; - } -} - -/*=Core detail ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersignup p { - font-size: 14px; - color: #333; - font-family: "FiraSans", "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 1.3; - margin: 0 auto 1.5em; - max-width: 260px; -} -.pkt_ext_containersignup a { - color: #4c8fd0; -} -.pkt_ext_containersignup a:hover { - color: #3076b9; -} -.pkt_ext_containersignup .pkt_ext_introdetail { - background-color: #fbfbfb; - border: 1px solid #c1c1c1; - border-width: 0 0 1px; -} -.pkt_ext_containersignup .pkt_ext_logo { - background: url(../img/pocketlogo@1x.png) center bottom no-repeat; - display: block; - height: 32px; - margin: 0 auto 15px; - padding-top: 25px; - position: relative; - text-indent: -9999px; - width: 123px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersignup .pkt_ext_logo { - background-image: url(../img/pocketlogo@2x.png); - background-size: 123px 32px; - } -} -.pkt_ext_containersignup .pkt_ext_introimg { - background: url(../img/pocketsignup_hero@1x.png) center center no-repeat; - display: block; - height: 125px; - margin: 0 auto; - position: relative; - text-indent: -9999px; - width: 255px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersignup .pkt_ext_introimg { - background-image: url(../img/pocketsignup_hero@2x.png); - background-size: 255px 125px; - } -} -.pkt_ext_containersignup .pkt_ext_tagline { - margin-bottom: 0.5em; -} -.pkt_ext_containersignup .pkt_ext_learnmore { - font-size: 12px; -} -.pkt_ext_containersignup .pkt_ext_learnmoreinactive { - visibility: hidden; -} -.pkt_ext_signupdetail h4 { - font-size: 12px; - font-weight: normal; -} -.pkt_ext_signupdetail .btn-container { - position: relative; - margin-bottom: 0.8em; -} -.pkt_ext_containersignup .ff_signuphelp { - background: url(../img/signup_help@1x.png) center center no-repeat; - display: block; - height: 18px; - margin-top: -9px; - right: -15px; - position: absolute; - text-indent: -9999px; - width: 18px; - top: 50%; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersignup .ff_signuphelp { - background-image: url(../img/signup_help@2x.png); - background-size: 18px 18px; - } -} -.pkt_ext_containersignup .alreadyhave { - font-size: 12px; - max-width: 320px; - margin-top: 15px; -} -.pkt_ext_containersignup .tryitnowspace { - margin-top: 22px; -} -.pkt_ext_signupdetail p.pkt_ext_tos { - color: #777; - font-size: 10px; - line-height: 1.5; - margin-top: 17px; - padding-top: 0; - max-width: 190px; -} - -/*=Core detail - storyboard ---------------------------------------------------------------------------------------- */ -.pkt_ext_introstory { - align-items: center; - display: flex; - padding: 20px; -} -.pkt_ext_introstory:after { - clear: both; - content: ""; - display: table; -} -.pkt_ext_introstory p { - margin-bottom: 0; - text-align: left; -} -.pkt_ext_introstoryone { - padding: 20px 18px 15px 20px; -} -.pkt_ext_introstorytwo { - padding: 3px 0 0 20px; -} -.pkt_ext_introstorytwo .pkt_ext_tagline { - margin-bottom: 1.5em; -} -.pkt_ext_introstory_text { - flex: 1; -} -.pkt_ext_introstoryone_img, -.pkt_ext_introstorytwo_img { - display: block; - overflow: hidden; - position: relative; - text-indent: -999px; -} -.pkt_ext_introstoryone_img { - background: url(../img/pocketsignup_button@1x.png) center right no-repeat; - height: 82px; - padding: 0 0 0 0.7em; - width: 82px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_introstoryone_img { - background-image: url(../img/pocketsignup_button@2x.png); - background-size: 82px 82px; - } -} -.pkt_ext_introstorytwo_img { - background: url(../img/pocketsignup_devices@1x.png) bottom right no-repeat; - height: 110px; - padding: 1em 0 0 0.7em; - width: 124px; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_introstorytwo_img { - background-image: url(../img/pocketsignup_devices@2x.png); - background-size: 124px 110px; - } -} -.pkt_ext_introstorydivider { - border-top: 1px solid #c1c1c1; - height: 1px; - margin: 0 auto; - width: 125px; -} - -/*=Buttons ---------------------------------------------------------------------------------------- */ -.pkt_ext_containersignup .btn { - background-color: #0096dd; - border: 1px solid #0095dd; - border-radius: 2px; - color: #fff; - display: inline-block; - font-family: "FiraSans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 16px; - font-weight: normal; - line-height: 1; - margin: 0; - padding: 11px 45px; - text-align: center; - text-decoration: none; - text-shadow: 0 -1px 0 rgba(142,4,17,0.5); - transition: background-color 0.1s linear; - width: auto; -} -.pkt_ext_containersignup .btn-secondary { - background-color: #fbfbfb; - border-color: #c1c1c1; - color: #444; - text-shadow: 0 1px 0 rgba(255,255,255,0.5); -} -.pkt_ext_containersignup .btn-small { - padding: 6px 20px; -} -.pkt_ext_containersignup .btn-mini { - font-size: 14px; - padding: 5px 15px 4px; -} -.pkt_ext_containersignup .btn:hover { - background-color: #008acb; - color: #fff; - text-decoration: none; -} -.pkt_ext_containersignup .btn-secondary:hover, -.pkt_ext_containersignup .btn-important:hover { - background-color: #f6f6f6; - color: #222; -} -.pkt_ext_containersignup .btn-disabled { - background-image: none; - color: #ccc; - color: rgba(255,255,255,0.6); - cursor: default; - opacity: 0.9; -} -.pkt_ext_containersignup .signup-btn-firefox, -.pkt_ext_containersignup .signup-btn-tryitnow, -.pkt_ext_containersignup .signup-btn-email, -.pkt_ext_containersignup .signupinterim-btn-login, -.pkt_ext_containersignup .signupinterim-btn-signup, -.pkt_ext_containersignup .forgot-btn-submit, -.pkt_ext_containersignup .forgotreset-btn-change { - min-width: 12.125em; - padding: 0.8em 1.1875em; - box-sizing: content-box; -} -.pkt_ext_containersignup .signup-btn-email { - position: relative; - z-index: 10; -} -.pkt_ext_containersignup .signup-btn-tryitnow, -.pkt_ext_containersignup .signup-btn-firefox { - min-width: 14.5em; - position: relative; - padding: 0; -} -.pkt_ext_containersignup .signup-btn-tryitnow{ - margin-top: 25px; -} -.pkt_ext_containersignup .signup-btn-firefox .logo { - background: url(../img/signup_firefoxlogo@1x.png) center center no-repeat; - height: 2.6em; - left: 10px; - margin: 0; - padding: 0; - width: 22px; - position: absolute; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_containersignup .signup-btn-firefox .logo { - background-image: url(../img/signup_firefoxlogo@2x.png); - background-size: 22px 22px; - } -} -.pkt_ext_containersignup .forgotreset-btn-change { - margin-bottom: 2em; -} -.pkt_ext_containersignup .signup-btn-tryitnow .text, -.pkt_ext_containersignup .signup-btn-firefox .text { - display: inline-block; - padding: 0.8em 1.625em; - position: relative; - text-shadow: none; - white-space: nowrap; -} -.pkt_ext_containersignup .signup-btn-tryitnow .text, -.pkt_ext_containersignup .signup-btn-firefox .text { - color: #fff; -} -.pkt_ext_containersignup .btn-disabled .text { - color: #ccc; - color: rgba(255,255,255,0.6); -} - -/*=Overflow mode ---------------------------------------------------------------------------------------- */ -.pkt_ext_signup_overflow .pkt_ext_tagline { - margin-bottom: 1em; - padding: 0 1em; -} -.pkt_ext_signup_overflow .pkt_ext_introimg { - background-size: 200px 98px; - height: 98px; - width: 200px; -} -.pkt_ext_signup_overflow .signup-btn-firefox, -.pkt_ext_containersignup .signup-btn-tryitnow, -.pkt_ext_signup_overflow .signup-btn-email { - font-size: 14px; - min-width: 12.6em; - padding-left: 0.75em; - padding-right: 0.75em; -} -.pkt_ext_signup_overflow .signup-btn-tryitnow .text, -.pkt_ext_signup_overflow .signup-btn-firefox .text { - padding-left: 0; - padding-right: 0; -} - -/*=Language overrides ---------------------------------------------------------------------------------------- */ -.pkt_ext_signup_de .pkt_ext_introstoryone_img { - margin-right: -5px; - padding-left: 0; -} -.pkt_ext_signup_de .pkt_ext_introstorytwo .pkt_ext_tagline, -.pkt_ext_signup_es .pkt_ext_introstorytwo .pkt_ext_tagline, -.pkt_ext_signup_ja .pkt_ext_introstorytwo .pkt_ext_tagline, -.pkt_ext_signup_ru .pkt_ext_introstorytwo .pkt_ext_tagline { - margin-bottom: 0.5em; -} -.pkt_ext_signup_de .signup-btn-firefox .text, -.pkt_ext_signup_de .signup-btn-tryitnow .text, -.pkt_ext_signup_de .signup-btn-email, -.pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-firefox .text, -.pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-email, -.pkt_ext_signup_ja .signup-btn-firefox .text, -.pkt_ext_signup_ja .signup-btn-tryitnow .text, -.pkt_ext_signup_ja .signup-btn-email, -.pkt_ext_signup_ru .signup-btn-firefox .text, -.pkt_ext_signup_ru .signup-btn-tryitnow .text, -.pkt_ext_signup_ru .signup-btn-email { - font-size: 15px; -} -.pkt_ext_signup_ja .signup-btn-firefox .text, -.pkt_ext_signup_ja .signup-btn-tryitnow .text, -.pkt_ext_signup_ru .signup-btn-firefox .text, -.pkt_ext_signup_ru .signup-btn-tryitnow .text { - left: 15px; -} -.pkt_ext_signup_de .signup-btn-firefox .logo, -.pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-firefox .logo, -.pkt_ext_signup_ja .signup-btn-firefox .logo, -.pkt_ext_signup_ru .signup-btn-firefox .logo { - height: 2.4em; -} -@media (min-resolution: 1.1dppx) { - .pkt_ext_signup_de .signup-btn-firefox .logo, - .pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-firefox .logo, - .pkt_ext_signup_ja .signup-btn-firefox .logo, - .pkt_ext_signup_ru .signup-btn-firefox .logo { - height: 2.5em; - } -} -.pkt_ext_signup_de .signup-btn-email, -.pkt_ext_signup_es .pkt_ext_signupdetail_hero .signup-btn-email, -.pkt_ext_signup_ja .signup-btn-email, -.pkt_ext_signup_ru .signup-btn-email { - min-width: 13em; - padding: 0.8533em 1.2667em; -} -.pkt_ext_signup_de .pkt_ext_logo, -.pkt_ext_signup_es .pkt_ext_logo, -.pkt_ext_signup_ru .pkt_ext_logo { - padding-top: 15px; -} -.pkt_ext_signup_de .pkt_ext_introdetailhero .pkt_ext_tagline, -.pkt_ext_signup_es .pkt_ext_introdetailhero .pkt_ext_tagline, -.pkt_ext_signup_ja .pkt_ext_introdetailhero .pkt_ext_tagline, -.pkt_ext_signup_ru .pkt_ext_introdetailhero .pkt_ext_tagline { - font-size: 13px; -} -.pkt_ext_signup_overflow.pkt_ext_signup_de .signup-btn-firefox .logo, -.pkt_ext_signup_overflow.pkt_ext_signup_es .signup-btn-firefox .logo, -.pkt_ext_signup_overflow.pkt_ext_signup_ja .signup-btn-firefox .logo, -.pkt_ext_signup_overflow.pkt_ext_signup_ru .signup-btn-firefox .logo { - display: none; -} diff --git a/browser/extensions/pocket/content/panels/fonts/FiraSans-Regular.woff b/browser/extensions/pocket/content/panels/fonts/FiraSans-Regular.woff Binary files differdeleted file mode 100644 index f466cdda9..000000000 --- a/browser/extensions/pocket/content/panels/fonts/FiraSans-Regular.woff +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocket.svg b/browser/extensions/pocket/content/panels/img/pocket.svg deleted file mode 100644 index d93fd6a15..000000000 --- a/browser/extensions/pocket/content/panels/img/pocket.svg +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
- <style>
- use:not(:target) {
- display: none;
- }
- use {
- fill: #808080;
- }
- use[id$="-added"] {
- fill: #ee4056;
- }
- </style>
- <defs>
- <path id="pocket-mark-shape" d="M21.901,4.204C21.642,3.484,20.956,3,20.196,3h-0.01h-1.721H3.814C3.067,3,2.385,3.474,2.119,4.179 C2.04,4.388,2,4.606,2,4.828v6.082l0.069,1.21c0.29,2.751,1.707,5.155,3.899,6.832c0.039,0.03,0.079,0.06,0.119,0.089l0.025,0.018 c1.175,0.866,2.491,1.452,3.91,1.741C10.677,20.932,11.347,21,12.013,21c0.615,0,1.232-0.057,1.839-0.171 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.299,2.621-0.87,3.753-1.704l0.025-0.018 c0.04-0.029,0.08-0.059,0.119-0.089c2.192-1.677,3.609-4.08,3.898-6.832L22,10.91V4.828C22,4.618,21.975,4.409,21.901,4.204z M17.667,10.539l-4.704,4.547c-0.266,0.256-0.608,0.385-0.949,0.385c-0.342,0-0.684-0.129-0.949-0.385l-4.705-4.547 c-0.547-0.528-0.565-1.403-0.04-1.954c0.524-0.551,1.392-0.569,1.939-0.041l3.756,3.63l3.755-3.63 c0.547-0.528,1.415-0.51,1.939,0.04C18.231,9.136,18.213,10.011,17.667,10.539z"/>
- </defs>
- <use id="pocket-mark" xlink:href="#pocket-mark-shape"/>
- <use id="pocket-mark-added" xlink:href="#pocket-mark-shape"/>
-</svg>
diff --git a/browser/extensions/pocket/content/panels/img/pocketerror@1x.png b/browser/extensions/pocket/content/panels/img/pocketerror@1x.png Binary files differdeleted file mode 100644 index e2b4d04de..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketerror@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketerror@2x.png b/browser/extensions/pocket/content/panels/img/pocketerror@2x.png Binary files differdeleted file mode 100644 index d501503b0..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketerror@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketlogo@1x.png b/browser/extensions/pocket/content/panels/img/pocketlogo@1x.png Binary files differdeleted file mode 100644 index 62b3db310..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketlogo@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketlogo@2x.png b/browser/extensions/pocket/content/panels/img/pocketlogo@2x.png Binary files differdeleted file mode 100644 index b0e80bff3..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketlogo@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketlogosolo@1x.png b/browser/extensions/pocket/content/panels/img/pocketlogosolo@1x.png Binary files differdeleted file mode 100644 index 77dc16f8c..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketlogosolo@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketlogosolo@2x.png b/browser/extensions/pocket/content/panels/img/pocketlogosolo@2x.png Binary files differdeleted file mode 100644 index c467c5a29..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketlogosolo@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketmenuitem16.png b/browser/extensions/pocket/content/panels/img/pocketmenuitem16.png Binary files differdeleted file mode 100644 index b52db6abf..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketmenuitem16.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketmenuitem16@2x.png b/browser/extensions/pocket/content/panels/img/pocketmenuitem16@2x.png Binary files differdeleted file mode 100644 index 69aa55b03..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketmenuitem16@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_button@1x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_button@1x.png Binary files differdeleted file mode 100644 index 12326fae3..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_button@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_button@2x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_button@2x.png Binary files differdeleted file mode 100644 index 5bdebc5e9..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_button@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_devices@1x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_devices@1x.png Binary files differdeleted file mode 100644 index c4a7ad677..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_devices@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_devices@2x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_devices@2x.png Binary files differdeleted file mode 100644 index 157304c3e..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_devices@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_hero@1x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_hero@1x.png Binary files differdeleted file mode 100644 index 80c5bd486..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_hero@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/pocketsignup_hero@2x.png b/browser/extensions/pocket/content/panels/img/pocketsignup_hero@2x.png Binary files differdeleted file mode 100644 index 36d0add61..000000000 --- a/browser/extensions/pocket/content/panels/img/pocketsignup_hero@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@1x.png b/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@1x.png Binary files differdeleted file mode 100644 index 52cbe052c..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@2x.png b/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@2x.png Binary files differdeleted file mode 100644 index cd218805e..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_firefoxlogo@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_help@1x.png b/browser/extensions/pocket/content/panels/img/signup_help@1x.png Binary files differdeleted file mode 100644 index 5019025c0..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_help@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_help@2x.png b/browser/extensions/pocket/content/panels/img/signup_help@2x.png Binary files differdeleted file mode 100644 index 6714bb3bc..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_help@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_or@1x.png b/browser/extensions/pocket/content/panels/img/signup_or@1x.png Binary files differdeleted file mode 100644 index 318cea0f6..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_or@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/signup_or@2x.png b/browser/extensions/pocket/content/panels/img/signup_or@2x.png Binary files differdeleted file mode 100644 index 837f1814a..000000000 --- a/browser/extensions/pocket/content/panels/img/signup_or@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/tag_close@1x.png b/browser/extensions/pocket/content/panels/img/tag_close@1x.png Binary files differdeleted file mode 100644 index 2dd02ba02..000000000 --- a/browser/extensions/pocket/content/panels/img/tag_close@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/tag_close@2x.png b/browser/extensions/pocket/content/panels/img/tag_close@2x.png Binary files differdeleted file mode 100644 index 8bd0eec57..000000000 --- a/browser/extensions/pocket/content/panels/img/tag_close@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/tag_closeactive@1x.png b/browser/extensions/pocket/content/panels/img/tag_closeactive@1x.png Binary files differdeleted file mode 100644 index ad4239232..000000000 --- a/browser/extensions/pocket/content/panels/img/tag_closeactive@1x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/img/tag_closeactive@2x.png b/browser/extensions/pocket/content/panels/img/tag_closeactive@2x.png Binary files differdeleted file mode 100644 index 80c35e3aa..000000000 --- a/browser/extensions/pocket/content/panels/img/tag_closeactive@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/content/panels/js/messages.js b/browser/extensions/pocket/content/panels/js/messages.js deleted file mode 100644 index ae08c3e73..000000000 --- a/browser/extensions/pocket/content/panels/js/messages.js +++ /dev/null @@ -1,78 +0,0 @@ -// Documentation of methods used here are at: -// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Interaction_between_privileged_and_non-privileged_pages - -var pktPanelMessaging = (function() { - - function panelIdFromURL(url) { - var panelId = url.match(/panelId=([\w|\d|\.]*)&?/); - if (panelId && panelId.length > 1) { - return panelId[1]; - } - - return 0; - } - - function prefixedMessageId(messageId) { - return 'PKT_' + messageId; - } - - function panelPrefixedMessageId(panelId, messageId) { - return prefixedMessageId(panelId + '_' + messageId); - } - - function addMessageListener(panelId, messageId, callback) { - document.addEventListener(panelPrefixedMessageId(panelId, messageId), function(e) { - - callback(JSON.parse(e.target.getAttribute("payload"))[0]); - - // TODO: Figure out why e.target.parentNode is null - // e.target.parentNode.removeChild(e.target); - - }, false); - - } - - function removeMessageListener(panelId, messageId, callback) { - document.removeEventListener(panelPrefixedMessageId(panelId, messageId), callback); - } - - function sendMessage(panelId, messageId, payload, callback) { - // Payload needs to be an object in format: - // { panelId: panelId, data: {} } - var messagePayload = { - panelId: panelId, - data: (payload || {}) - }; - - // Create a callback to listen for a response - if (callback) { - var messageResponseId = messageId + "Response"; - var responseListener = function(responsePayload) { - callback(responsePayload); - removeMessageListener(panelId, messageResponseId, responseListener); - } - - addMessageListener(panelId, messageResponseId, responseListener); - } - - // Send message - var element = document.createElement("PKTMessageFromPanelElement"); - element.setAttribute("payload", JSON.stringify([messagePayload])); - document.documentElement.appendChild(element); - - var evt = document.createEvent("Events"); - evt.initEvent(prefixedMessageId(messageId), true, false); - element.dispatchEvent(evt); - } - - - /** - * Public functions - */ - return { - panelIdFromURL: panelIdFromURL, - addMessageListener : addMessageListener, - removeMessageListener : removeMessageListener, - sendMessage: sendMessage - }; -}()); diff --git a/browser/extensions/pocket/content/panels/js/saved.js b/browser/extensions/pocket/content/panels/js/saved.js deleted file mode 100644 index 3abc8889a..000000000 --- a/browser/extensions/pocket/content/panels/js/saved.js +++ /dev/null @@ -1,608 +0,0 @@ -/* -PKT_SAVED_OVERLAY is the view itself and contains all of the methods to manipute the overlay and messaging. -It does not contain any logic for saving or communication with the extension or server. -*/ -var PKT_SAVED_OVERLAY = function (options) -{ - var myself = this; - this.inited = false; - this.active = false; - this.wrapper = null; - this.pockethost = "getpocket.com"; - this.savedItemId = 0; - this.savedUrl = ''; - this.premiumStatus = false; - this.preventCloseTimerCancel = false; - this.closeValid = true; - this.mouseInside = false; - this.autocloseTimer = null; - this.inoverflowmenu = false; - this.dictJSON = {}; - this.autocloseTiming = 3500; - this.autocloseTimingFinalState = 2000; - this.mouseInside = false; - this.userTags = []; - this.cxt_suggested_available = 0; - this.cxt_entered = 0; - this.cxt_suggested = 0; - this.cxt_removed = 0; - this.justaddedsuggested = false; - this.fillTagContainer = function(tags, container, tagclass) { - container.children().remove(); - for (var i = 0; i < tags.length; i++) { - var newtag = $('<li><a href="#" class="token_tag"></a></li>'); - newtag.find('a').text(tags[i]); - newtag.addClass(tagclass); - container.append(newtag); - this.cxt_suggested_available++; - } - }; - this.fillUserTags = function() { - thePKT_SAVED.sendMessage("getTags", {}, function(resp) - { - if (typeof resp == 'object' && typeof resp.tags == 'object') - { - myself.userTags = resp.tags; - } - }); - }; - this.fillSuggestedTags = function() - { - if (!$('.pkt_ext_suggestedtag_detail').length) - { - myself.suggestedTagsLoaded = true; - myself.startCloseTimer(); - return; - } - - thePKT_SAVED.sendMessage("getSuggestedTags", - { - url: myself.savedUrl - }, function(resp) - { - $('.pkt_ext_suggestedtag_detail').removeClass('pkt_ext_suggestedtag_detail_loading'); - if (resp.status == 'success') - { - var newtags = []; - for (var i = 0; i < resp.value.suggestedTags.length; i++) - { - newtags.push(resp.value.suggestedTags[i].tag); - } - myself.suggestedTagsLoaded = true; - if (!myself.mouseInside) { - myself.startCloseTimer(); - } - myself.fillTagContainer(newtags, $('.pkt_ext_suggestedtag_detail ul'), 'token_suggestedtag'); - } - else if (resp.status == 'error') { - var msg = $('<p class="suggestedtag_msg">'); - msg.text(resp.error.message); - $('.pkt_ext_suggestedtag_detail').append(msg); - this.suggestedTagsLoaded = true; - if (!myself.mouseInside) { - myself.startCloseTimer(); - } - } - }); - } - this.initAutoCloseEvents = function() { - this.wrapper.on('mouseenter', function() { - myself.mouseInside = true; - myself.stopCloseTimer(); - }); - this.wrapper.on('mouseleave', function() { - myself.mouseInside = false; - myself.startCloseTimer(); - }); - this.wrapper.on('click', function(e) { - myself.closeValid = false; - }); - }; - this.startCloseTimer = function(manualtime) - { - var settime = manualtime ? manualtime : myself.autocloseTiming; - if (typeof myself.autocloseTimer == 'number') - { - clearTimeout(myself.autocloseTimer); - } - myself.autocloseTimer = setTimeout(function() - { - if (myself.closeValid || myself.preventCloseTimerCancel) - { - myself.preventCloseTimerCancel = false; - myself.closePopup(); - } - }, settime); - }; - this.stopCloseTimer = function() - { - if (myself.preventCloseTimerCancel) - { - return; - } - clearTimeout(myself.autocloseTimer); - }; - this.closePopup = function() { - myself.stopCloseTimer(); - thePKT_SAVED.sendMessage("close"); - }; - this.checkValidTagSubmit = function() { - var inputlength = $.trim($('.pkt_ext_tag_input_wrapper').find('.token-input-input-token').children('input').val()).length; - if ($('.pkt_ext_containersaved').find('.token-input-token').length || (inputlength > 0 && inputlength < 26)) - { - $('.pkt_ext_containersaved').find('.pkt_ext_btn').removeClass('pkt_ext_btn_disabled'); - } - else - { - $('.pkt_ext_containersaved').find('.pkt_ext_btn').addClass('pkt_ext_btn_disabled'); - } - myself.updateSlidingTagList(); - }; - this.updateSlidingTagList = function() { - var inputleft = $('.token-input-input-token input').position().left; - var listleft = $('.token-input-list').position().left; - var listleftmanual = parseInt($('.token-input-list').css('left')); - var listleftnatural = listleft - listleftmanual; - var leftwidth = $('.pkt_ext_tag_input_wrapper').outerWidth(); - - if ((inputleft + listleft + 20) > leftwidth) - { - $('.token-input-list').css('left', Math.min(((inputleft + listleftnatural - leftwidth + 20)*-1), 0) + 'px'); - } - else - { - $('.token-input-list').css('left', '0'); - } - }; - this.checkPlaceholderStatus = function() { - if (this.wrapper.find('.pkt_ext_tag_input_wrapper').find('.token-input-token').length) - { - this.wrapper.find('.token-input-input-token input').attr('placeholder', ''); - } - else - { - this.wrapper.find('.token-input-input-token input').attr('placeholder', $('.pkt_ext_tag_input').attr('placeholder')).css('width', '200px'); - } - }; - this.initTagInput = function() { - var inputwrapper = $('.pkt_ext_tag_input_wrapper'); - inputwrapper.find('.pkt_ext_tag_input').tokenInput([], { - searchDelay: 200, - minChars: 1, - animateDropdown: false, - noResultsHideDropdown: true, - scrollKeyboard: true, - emptyInputLength: 200, - search_function: function(term, cb) { - var returnlist = []; - if (term.length) { - var limit = 15; - var r = new RegExp('^' + term); - for (var i = 0; i < myself.userTags.length; i++) { - if (r.test(myself.userTags[i]) && limit > 0) { - returnlist.push({name:myself.userTags[i]}); - limit--; - } - } - } - if (!$('.token-input-dropdown-tag').data('init')) { - $('.token-input-dropdown-tag').css('width', inputwrapper.outerWidth()).data('init'); - inputwrapper.append($('.token-input-dropdown-tag')); - } - cb(returnlist); - }, - textToData: function(text) { - if ($.trim(text).length > 25 || !$.trim(text).length) { - if (text.length > 25) { - myself.showTagsError(myself.dictJSON.maxtaglength); - changestamp = Date.now(); - setTimeout(function() { - $('.token-input-input-token input').val(text).focus(); - }, 10); - } - return null; - } - myself.hideTagsError(); - return {name:myself.sanitizeText(text.toLowerCase())}; - }, - onReady: function() { - $('.token-input-dropdown').addClass('token-input-dropdown-tag'); - inputwrapper.find('.token-input-input-token input').attr('placeholder', $('.tag-input').attr('placeholder')).css('width', '200px'); - if ($('.pkt_ext_suggestedtag_detail').length) { - myself.wrapper.find('.pkt_ext_suggestedtag_detail').on('click', '.token_tag', function(e) { - e.preventDefault(); - var tag = $(e.target); - if ($(this).parents('.pkt_ext_suggestedtag_detail_disabled').length) { - return; - } - myself.justaddedsuggested = true; - inputwrapper.find('.pkt_ext_tag_input').tokenInput('add', {id:inputwrapper.find('.token-input-token').length, name:tag.text()}); - tag.addClass('token-suggestedtag-inactive'); - $('.token-input-input-token input').focus(); - }); - } - $('.token-input-list').on('keydown', 'input', function(e) { - if (e.which == 37) { - myself.updateSlidingTagList(); - } - }).on('keypress', 'input', function(e) { - if (e.which == 13) { - if (typeof changestamp == 'undefined' || (Date.now() - changestamp > 250)) { - e.preventDefault(); - myself.wrapper.find('.pkt_ext_btn').trigger('click'); - } - } - }).on('keyup', 'input', function(e) { - myself.checkValidTagSubmit(); - }); - myself.checkPlaceholderStatus(); - }, - onAdd: function() { - myself.checkValidTagSubmit(); - changestamp = Date.now(); - myself.hideInactiveTags(); - myself.checkPlaceholderStatus(); - }, - onDelete: function() { - myself.checkValidTagSubmit(); - changestamp = Date.now(); - myself.showActiveTags(); - myself.checkPlaceholderStatus(); - }, - onShowDropdown: function() { - thePKT_SAVED.sendMessage("expandSavePanel"); - }, - onHideDropdown: function() { - thePKT_SAVED.sendMessage("collapseSavePanel"); - } - }); - $('body').on('keydown', function(e) { - var key = e.keyCode || e.which; - if (key == 8) { - var selected = $('.token-input-selected-token'); - if (selected.length) { - e.preventDefault(); - e.stopImmediatePropagation(); - inputwrapper.find('.pkt_ext_tag_input').tokenInput('remove', {name:selected.find('p').text()}); - } - } - else if ($(e.target).parent().hasClass('token-input-input-token')) { - e.stopImmediatePropagation(); - } - }); - }; - this.disableInput = function() { - this.wrapper.find('.pkt_ext_item_actions').addClass('pkt_ext_item_actions_disabled'); - this.wrapper.find('.pkt_ext_btn').addClass('pkt_ext_btn_disabled'); - this.wrapper.find('.pkt_ext_tag_input_wrapper').addClass('pkt_ext_tag_input_wrapper_disabled'); - if (this.wrapper.find('.pkt_ext_suggestedtag_detail').length) { - this.wrapper.find('.pkt_ext_suggestedtag_detail').addClass('pkt_ext_suggestedtag_detail_disabled'); - } - }; - this.enableInput = function() { - this.wrapper.find('.pkt_ext_item_actions').removeClass('pkt_ext_item_actions_disabled'); - this.checkValidTagSubmit(); - this.wrapper.find('.pkt_ext_tag_input_wrapper').removeClass('pkt_ext_tag_input_wrapper_disabled'); - if (this.wrapper.find('.pkt_ext_suggestedtag_detail').length) { - this.wrapper.find('.pkt_ext_suggestedtag_detail').removeClass('pkt_ext_suggestedtag_detail_disabled'); - } - }; - this.initAddTagInput = function() { - $('.pkt_ext_btn').click(function(e) { - e.preventDefault(); - if ($(this).hasClass('pkt_ext_btn_disabled') || $('.pkt_ext_edit_msg_active').filter('.pkt_ext_edit_msg_error').length) - { - return; - } - myself.disableInput(); - $('.pkt_ext_containersaved').find('.pkt_ext_detail h2').text(myself.dictJSON.processingtags); - var originaltags = []; - $('.token-input-token').each(function() - { - var text = $.trim($(this).find('p').text()); - if (text.length) - { - originaltags.push(text); - } - }); - - thePKT_SAVED.sendMessage("addTags", - { - url: myself.savedUrl, - tags: originaltags - }, function(resp) - { - if (resp.status == 'success') - { - myself.showStateFinalMsg(myself.dictJSON.tagssaved); - } - else if (resp.status == 'error') - { - $('.pkt_ext_edit_msg').addClass('pkt_ext_edit_msg_error pkt_ext_edit_msg_active').text(resp.error.message); - } - }); - }); - }; - this.initRemovePageInput = function() { - $('.pkt_ext_removeitem').click(function(e) { - if ($(this).parents('.pkt_ext_item_actions_disabled').length) { - e.preventDefault(); - return; - } - if ($(this).hasClass('pkt_ext_removeitem')) { - e.preventDefault(); - myself.disableInput(); - $('.pkt_ext_containersaved').find('.pkt_ext_detail h2').text(myself.dictJSON.processingremove); - - thePKT_SAVED.sendMessage("deleteItem", - { - itemId: myself.savedItemId - }, function(resp) { - if (resp.status == 'success') { - myself.showStateFinalMsg(myself.dictJSON.pageremoved); - } - else if (resp.status == 'error') { - $('.pkt_ext_edit_msg').addClass('pkt_ext_edit_msg_error pkt_ext_edit_msg_active').text(resp.error.message); - } - }); - } - }); - }; - this.initOpenListInput = function() { - $('.pkt_ext_openpocket').click(function(e) - { - e.preventDefault(); - thePKT_SAVED.sendMessage("openTabWithUrl", - { - url: $(this).attr('href'), - activate: true - }); - myself.closePopup(); - }); - }; - this.showTagsError = function(msg) { - $('.pkt_ext_edit_msg').addClass('pkt_ext_edit_msg_error pkt_ext_edit_msg_active').text(msg); - $('.pkt_ext_tag_detail').addClass('pkt_ext_tag_error'); - }; - this.hideTagsError = function(msg) { - $('.pkt_ext_edit_msg').removeClass('pkt_ext_edit_msg_error pkt_ext_edit_msg_active').text(''); - $('.pkt_ext_tag_detail').removeClass('pkt_ext_tag_error'); - }; - this.showActiveTags = function() { - if (!$('.pkt_ext_suggestedtag_detail').length) { - return; - } - var activetokenstext = '|'; - $('.token-input-token').each(function(index, element) { - activetokenstext += $(element).find('p').text() + '|'; - }); - - var inactivetags = $('.pkt_ext_suggestedtag_detail').find('.token_tag_inactive'); - inactivetags.each(function(index, element) { - if (activetokenstext.indexOf('|' + $(element).text() + '|') == -1) { - $(element).removeClass('token_tag_inactive'); - } - }); - }; - this.hideInactiveTags = function() { - if (!$('.pkt_ext_suggestedtag_detail').length) { - return; - } - var activetokenstext = '|'; - $('.token-input-token').each(function(index, element) { - activetokenstext += $(element).find('p').text() + '|'; - }); - var activesuggestedtags = $('.token_tag').not('.token_tag_inactive'); - activesuggestedtags.each(function(index, element) { - if (activetokenstext.indexOf('|' + $(element).text() + '|') > -1) { - $(element).addClass('token_tag_inactive'); - } - }); - }; - this.showStateSaved = function(initobj) { - this.wrapper.find('.pkt_ext_detail h2').text(this.dictJSON.pagesaved); - this.wrapper.find('.pkt_ext_btn').addClass('pkt_ext_btn_disabled'); - if (typeof initobj.item == 'object') - { - this.savedItemId = initobj.item.item_id; - this.savedUrl = initobj.item.given_url; - } - $('.pkt_ext_containersaved').addClass('pkt_ext_container_detailactive').removeClass('pkt_ext_container_finalstate'); - - myself.fillUserTags(); - if (myself.suggestedTagsLoaded) { - myself.startCloseTimer(); - } - else { - myself.fillSuggestedTags(); - } - }; - this.sanitizeText = function(s) { - var sanitizeMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''' - }; - if (typeof s !== 'string') - { - return ''; - } - return String(s).replace(/[&<>"']/g, function (str) { - return sanitizeMap[str]; - }); - }; - this.showStateFinalMsg = function(msg) { - this.wrapper.find('.pkt_ext_tag_detail').one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function(e) - { - $(this).off('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd'); - myself.preventCloseTimerCancel = true; - myself.startCloseTimer(myself.autocloseTimingFinalState); - myself.wrapper.find('.pkt_ext_detail h2').text(msg); - }); - this.wrapper.addClass('pkt_ext_container_finalstate'); - }; - this.showStateError = function(headline, detail) { - this.wrapper.find('.pkt_ext_detail h2').text(headline); - this.wrapper.find('.pkt_ext_detail h3').text(detail); - this.wrapper.addClass('pkt_ext_container_detailactive pkt_ext_container_finalstate pkt_ext_container_finalerrorstate'); - this.preventCloseTimerCancel = true; - this.startCloseTimer(myself.autocloseTimingFinalState); - } - this.getTranslations = function() - { - this.dictJSON = window.pocketStrings; - }; -}; - -PKT_SAVED_OVERLAY.prototype = { - create : function() - { - if (this.active) - { - return; - } - this.active = true; - - // set translations - this.getTranslations(); - - // set host - this.dictJSON.pockethost = this.pockethost; - - // extra modifier class for collapsed state - if (this.inoverflowmenu) - { - $('body').addClass('pkt_ext_saved_overflow'); - } - - // extra modifier class for language - if (this.locale) - { - $('body').addClass('pkt_ext_saved_' + this.locale); - } - - // Create actual content - $('body').append(Handlebars.templates.saved_shell(this.dictJSON)); - - // Add in premium content (if applicable based on premium status) - this.createPremiumFunctionality(); - - // Initialize functionality for overlay - this.wrapper = $('.pkt_ext_containersaved'); - this.initTagInput(); - this.initAddTagInput(); - this.initRemovePageInput(); - this.initOpenListInput(); - this.initAutoCloseEvents(); - }, - createPremiumFunctionality: function() - { - if (this.premiumStatus && !$('.pkt_ext_suggestedtag_detail').length) - { - $('body').append(Handlebars.templates.saved_premiumshell(this.dictJSON)); - $('.pkt_ext_initload').append(Handlebars.templates.saved_premiumextras(this.dictJSON)); - } - } -}; - - -// Layer between Bookmarklet and Extensions -var PKT_SAVED = function () {}; - -PKT_SAVED.prototype = { - init: function () { - if (this.inited) { - return; - } - this.panelId = pktPanelMessaging.panelIdFromURL(window.location.href); - this.overlay = new PKT_SAVED_OVERLAY(); - - this.inited = true; - }, - - addMessageListener: function(messageId, callback) { - pktPanelMessaging.addMessageListener(this.panelId, messageId, callback); - }, - - sendMessage: function(messageId, payload, callback) { - pktPanelMessaging.sendMessage(this.panelId, messageId, payload, callback); - }, - - create: function() { - var myself = this; - var url = window.location.href.match(/premiumStatus=([\w|\d|\.]*)&?/); - if (url && url.length > 1) - { - myself.overlay.premiumStatus = (url[1] == '1'); - } - var host = window.location.href.match(/pockethost=([\w|\.]*)&?/); - if (host && host.length > 1) - { - myself.overlay.pockethost = host[1]; - } - var inoverflowmenu = window.location.href.match(/inoverflowmenu=([\w|\.]*)&?/); - if (inoverflowmenu && inoverflowmenu.length > 1) - { - myself.overlay.inoverflowmenu = (inoverflowmenu[1] == 'true'); - } - var locale = window.location.href.match(/locale=([\w|\.]*)&?/); - if (locale && locale.length > 1) - { - myself.overlay.locale = locale[1].toLowerCase(); - } - - myself.overlay.create(); - - // tell back end we're ready - thePKT_SAVED.sendMessage("show"); - - // wait confirmation of save before flipping to final saved state - thePKT_SAVED.addMessageListener("saveLink", function(resp) - { - if (resp.status == 'error') { - if (typeof resp.error == 'object') - { - if (resp.error.localizedKey) - { - myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, myself.overlay.dictJSON[resp.error.localizedKey]); - } - else - { - myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, resp.error.message); - } - } - else - { - myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, myself.overlay.dictJSON.errorgeneric); - } - return; - } - - myself.overlay.showStateSaved(resp); - }); - - } -} - -$(function() -{ - if (!window.thePKT_SAVED) { - var thePKT_SAVED = new PKT_SAVED(); - window.thePKT_SAVED = thePKT_SAVED; - thePKT_SAVED.init(); - } - - var pocketHost = thePKT_SAVED.overlay.pockethost; - // send an async message to get string data - thePKT_SAVED.sendMessage("initL10N", { - tos: [ - 'https://'+ pocketHost +'/tos?s=ffi&t=tos&tv=panel_tryit', - 'https://'+ pocketHost +'/privacy?s=ffi&t=privacypolicy&tv=panel_tryit' - ] - }, function(resp) { - window.pocketStrings = resp.strings; - window.thePKT_SAVED.create(); - }); -}); diff --git a/browser/extensions/pocket/content/panels/js/signup.js b/browser/extensions/pocket/content/panels/js/signup.js deleted file mode 100644 index af55cc2a7..000000000 --- a/browser/extensions/pocket/content/panels/js/signup.js +++ /dev/null @@ -1,193 +0,0 @@ -/* -PKT_SIGNUP_OVERLAY is the view itself and contains all of the methods to manipute the overlay and messaging. -It does not contain any logic for saving or communication with the extension or server. -*/ -var PKT_SIGNUP_OVERLAY = function (options) -{ - var myself = this; - this.inited = false; - this.active = false; - this.delayedStateSaved = false; - this.wrapper = null; - this.variant = window.___PKT__SIGNUP_VARIANT; - this.tagline = window.___PKT__SIGNUP_TAGLINE || ''; - this.preventCloseTimerCancel = false; - this.translations = {}; - this.closeValid = true; - this.mouseInside = false; - this.autocloseTimer = null; - this.variant = ""; - this.inoverflowmenu = false; - this.controlvariant; - this.pockethost = "getpocket.com"; - this.fxasignedin = false; - this.dictJSON = {}; - this.initCloseTabEvents = function() { - $('.btn,.pkt_ext_learnmore,.alreadyhave > a').click(function(e) - { - e.preventDefault(); - thePKT_SIGNUP.sendMessage("openTabWithUrl", - { - url: $(this).attr('href'), - activate: true - }); - myself.closePopup(); - }); - }; - this.closePopup = function() { - thePKT_SIGNUP.sendMessage("close"); - }; - this.sanitizeText = function(s) { - var sanitizeMap = { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''' - }; - if (typeof s !== 'string') - { - return ''; - } - return String(s).replace(/[&<>"']/g, function (str) { - return sanitizeMap[str]; - }); - }; - this.getTranslations = function() - { - this.dictJSON = window.pocketStrings; - }; - -}; - -PKT_SIGNUP_OVERLAY.prototype = { - create : function() - { - var controlvariant = window.location.href.match(/controlvariant=([\w|\.]*)&?/); - if (controlvariant && controlvariant.length > 1) - { - this.controlvariant = controlvariant[1]; - } - var variant = window.location.href.match(/variant=([\w|\.]*)&?/); - if (variant && variant.length > 1) - { - this.variant = variant[1]; - } - var fxasignedin = window.location.href.match(/fxasignedin=([\w|\d|\.]*)&?/); - if (fxasignedin && fxasignedin.length > 1) - { - this.fxasignedin = (fxasignedin[1] == '1'); - } - var host = window.location.href.match(/pockethost=([\w|\.]*)&?/); - if (host && host.length > 1) - { - this.pockethost = host[1]; - } - var inoverflowmenu = window.location.href.match(/inoverflowmenu=([\w|\.]*)&?/); - if (inoverflowmenu && inoverflowmenu.length > 1) - { - this.inoverflowmenu = (inoverflowmenu[1] == 'true'); - } - var locale = window.location.href.match(/locale=([\w|\.]*)&?/); - if (locale && locale.length > 1) - { - this.locale = locale[1].toLowerCase(); - } - - if (this.active) - { - return; - } - this.active = true; - - // set translations - this.getTranslations(); - this.dictJSON.fxasignedin = this.fxasignedin ? 1 : 0; - this.dictJSON.controlvariant = this.controlvariant == 'true' ? 1 : 0; - this.dictJSON.variant = (this.variant ? this.variant : 'undefined'); - this.dictJSON.variant += this.fxasignedin ? '_fxa' : '_nonfxa'; - this.dictJSON.pockethost = this.pockethost; - this.dictJSON.showlearnmore = true; - - // extra modifier class for collapsed state - if (this.inoverflowmenu) - { - $('body').addClass('pkt_ext_signup_overflow'); - } - - // extra modifier class for language - if (this.locale) - { - $('body').addClass('pkt_ext_signup_' + this.locale); - } - - // Create actual content - if (this.variant == 'overflow') - { - $('body').append(Handlebars.templates.signup_shell(this.dictJSON)); - } - else - { - $('body').append(Handlebars.templates.signupstoryboard_shell(this.dictJSON)); - } - - - // tell background we're ready - thePKT_SIGNUP.sendMessage("show"); - - // close events - this.initCloseTabEvents(); - } -}; - - -// Layer between Bookmarklet and Extensions -var PKT_SIGNUP = function () {}; - -PKT_SIGNUP.prototype = { - init: function () { - if (this.inited) { - return; - } - this.panelId = pktPanelMessaging.panelIdFromURL(window.location.href); - this.overlay = new PKT_SIGNUP_OVERLAY(); - - this.inited = true; - }, - - addMessageListener: function(messageId, callback) { - pktPanelMessaging.addMessageListener(this.panelId, messageId, callback); - }, - - sendMessage: function(messageId, payload, callback) { - pktPanelMessaging.sendMessage(this.panelId, messageId, payload, callback); - }, - - create: function() { - this.overlay.create(); - - // tell back end we're ready - thePKT_SIGNUP.sendMessage("show"); - } -} - -$(function() -{ - if (!window.thePKT_SIGNUP) { - var thePKT_SIGNUP = new PKT_SIGNUP(); - window.thePKT_SIGNUP = thePKT_SIGNUP; - thePKT_SIGNUP.init(); - } - - var pocketHost = thePKT_SIGNUP.overlay.pockethost; - // send an async message to get string data - thePKT_SIGNUP.sendMessage("initL10N", { - tos: [ - 'https://'+ pocketHost +'/tos?s=ffi&t=tos&tv=panel_tryit', - 'https://'+ pocketHost +'/privacy?s=ffi&t=privacypolicy&tv=panel_tryit' - ] - }, function(resp) { - window.pocketStrings = resp.strings; - window.thePKT_SIGNUP.create(); - }); -}); diff --git a/browser/extensions/pocket/content/panels/js/tmpl.js b/browser/extensions/pocket/content/panels/js/tmpl.js deleted file mode 100644 index a03ffda70..000000000 --- a/browser/extensions/pocket/content/panels/js/tmpl.js +++ /dev/null @@ -1,242 +0,0 @@ -(function() { - var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['saved_premiumextras'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - return "<div class=\"pkt_ext_suggestedtag_detailshown\">\r\n</div> "; - },"useData":true}); -templates['saved_premiumshell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "<div class=\"pkt_ext_suggestedtag_detail pkt_ext_suggestedtag_detail_loading\">\n <h4>" - + escapeExpression(((helper = (helper = helpers.suggestedtags || (depth0 != null ? depth0.suggestedtags : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"suggestedtags","hash":{},"data":data}) : helper))) - + "</h4>\n <div class=\"pkt_ext_loadingspinner\"><div></div></div>\n <ul class=\"pkt_ext_cf\">\n </ul>\n</div>"; -},"useData":true}); -templates['saved_shell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return "<div class=\"pkt_ext_initload\">\n <div class=\"pkt_ext_logo\"></div> \n <div class=\"pkt_ext_topdetail\">\n <h2>" - + escapeExpression(((helper = (helper = helpers.saving || (depth0 != null ? depth0.saving : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"saving","hash":{},"data":data}) : helper))) - + "</h2>\n </div> \n <div class=\"pkt_ext_loadingspinner\"><div></div></div>\n</div> \n<div class=\"pkt_ext_detail\"> \n <div class=\"pkt_ext_logo\"></div>\n <div class=\"pkt_ext_topdetail\">\n <h2>" - + escapeExpression(((helper = (helper = helpers.pagesaved || (depth0 != null ? depth0.pagesaved : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pagesaved","hash":{},"data":data}) : helper))) - + "</h2>\n <h3 class=\"pkt_ext_errordetail\"></h3>\n <nav class=\"pkt_ext_item_actions pkt_ext_cf\">\n <ul>\n <li><a class=\"pkt_ext_removeitem\" href=\"#\">" - + escapeExpression(((helper = (helper = helpers.removepage || (depth0 != null ? depth0.removepage : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"removepage","hash":{},"data":data}) : helper))) - + "</a></li>\n <li class=\"pkt_ext_actions_separator\"></li> \n <li><a class=\"pkt_ext_openpocket\" href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/a?src=ff_ext_saved\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.viewlist || (depth0 != null ? depth0.viewlist : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"viewlist","hash":{},"data":data}) : helper))) - + "</a></li>\n </ul>\n </nav> \n </div>\n <div class=\"pkt_ext_tag_detail pkt_ext_cf\">\n <div class=\"pkt_ext_tag_input_wrapper\">\n <div class=\"pkt_ext_tag_input_blocker\"></div>\n <input class=\"pkt_ext_tag_input\" type=\"text\" placeholder=\"" - + escapeExpression(((helper = (helper = helpers.addtags || (depth0 != null ? depth0.addtags : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"addtags","hash":{},"data":data}) : helper))) - + "\">\n </div>\n <a href=\"#\" class=\"pkt_ext_btn pkt_ext_btn_disabled\">" - + escapeExpression(((helper = (helper = helpers.save || (depth0 != null ? depth0.save : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"save","hash":{},"data":data}) : helper))) - + "</a>\n </div>\n <p class=\"pkt_ext_edit_msg\"></p>\n</div>"; -},"useData":true}); -templates['signup_shell'] = template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p class=\"pkt_ext_learnmorecontainer\"><a class=\"pkt_ext_learnmore\" href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_learnmore?s=ffi&t=learnmore&tv=panel_control&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"4":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p class=\"pkt_ext_learnmorecontainer\"><a class=\"pkt_ext_learnmore\" href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_learnmore?s=ffi&t=learnmore&tv=panel_tryit&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"6":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p class=\"pkt_ext_learnmorecontainer\"><a class=\"pkt_ext_learnmore pkt_ext_learnmoreinactive\" href=\"#\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"8":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <h4>" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) - + "</h4>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/ff_signup?s=ffi&t=signupff&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"alreadyhave\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&src=extension&s=ffi&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n"; -},"10":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"11":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <h4>" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) - + "</h4>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/ff_signup?s=ffi&tv=panel_control&t=signupff&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/signup?force=email&tv=panel_control&src=extension&s=ffi&t=signupemail&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn btn-secondary signup-btn-email signup-btn-initstate\">" - + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper))) - + "</a></p>\n <p class=\"alreadyhave\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&tv=panel_control&src=extension&s=ffi&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n"; -},"13":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_tryitnow?s=ffi&tv=panel_tryit&t=tryitnow\" target=\"_blank\" class=\"btn signup-btn-tryitnow\"><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.tryitnow || (depth0 != null ? depth0.tryitnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tryitnow","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"alreadyhave tryitnowspace\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&s=ffi&tv=panel_tryit&src=extension&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n <p class=\"pkt_ext_tos\">"; - stack1 = ((helper = (helper = helpers.tos || (depth0 != null ? depth0.tos : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tos","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</p>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"pkt_ext_introdetail pkt_ext_introdetailhero\">\n <h2 class=\"pkt_ext_logo\">Pocket</h2>\n <p class=\"pkt_ext_tagline\">" - + escapeExpression(((helper = (helper = helpers.tagline || (depth0 != null ? depth0.tagline : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tagline","hash":{},"data":data}) : helper))) - + "</p>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(6, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += " <div class=\"pkt_ext_introimg\"></div>\n</div>\n<div class=\"pkt_ext_signupdetail pkt_ext_signupdetail_hero\">\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.program(10, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "</div>\n"; -},"useData":true}); -templates['signupstoryboard_shell'] = template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"2":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p><a class=\"pkt_ext_learnmore\" href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_learnmore?s=ffi&t=learnmore&tv=panel_control&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"4":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p><a class=\"pkt_ext_learnmore\" href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_learnmore?s=ffi&t=learnmore&tv=panel_tryit&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"6":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <p><a class=\"pkt_ext_learnmore pkt_ext_learnmoreinactive\" href=\"#\">" - + escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper))) - + "</a></p>\n"; -},"8":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <h4>" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) - + "</h4>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/ff_signup?s=ffi&t=signupff&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"alreadyhave\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&src=extension&s=ffi&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n"; -},"10":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.controlvariant : depth0), {"name":"if","hash":{},"fn":this.program(11, data),"inverse":this.program(13, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"11":function(depth0,helpers,partials,data) { - var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; - return " <h4>" - + escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper))) - + "</h4>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/ff_signup?s=ffi&tv=panel_control&t=signupff&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/signup?force=email&tv=panel_control&src=extension&s=ffi&t=signupemail&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\" class=\"btn btn-secondary signup-btn-email signup-btn-initstate\">" - + escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper))) - + "</a></p>\n <p class=\"alreadyhave\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&tv=panel_control&src=extension&s=ffi&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n"; -},"13":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = " <p class=\"btn-container\"><a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/firefox_tryitnow?s=ffi&tv=panel_tryit&t=tryitnow\" target=\"_blank\" class=\"btn signup-btn-tryitnow\"><span class=\"text\">" - + escapeExpression(((helper = (helper = helpers.tryitnow || (depth0 != null ? depth0.tryitnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tryitnow","hash":{},"data":data}) : helper))) - + "</span></a></p>\n <p class=\"alreadyhave tryitnowspace\">" - + escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper))) - + " <a href=\"https://" - + escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper))) - + "/login?ep=3&s=ffi&tv=panel_tryit&src=extension&t=login&v=" - + escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper))) - + "\" target=\"_blank\">" - + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) - + "</a>.</p>\n <p class=\"pkt_ext_tos\">"; - stack1 = ((helper = (helper = helpers.tos || (depth0 != null ? depth0.tos : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tos","hash":{},"data":data}) : helper)); - if (stack1 != null) { buffer += stack1; } - return buffer + "</p>\n"; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"pkt_ext_introdetail pkt_ext_introdetailstoryboard\">\n <div class=\"pkt_ext_introstory pkt_ext_introstoryone\">\n <div class=\"pkt_ext_introstory_text\">\n <p class=\"pkt_ext_tagline\">" - + escapeExpression(((helper = (helper = helpers.taglinestory_one || (depth0 != null ? depth0.taglinestory_one : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_one","hash":{},"data":data}) : helper))) - + "</p>\n </div>\n <div class=\"pkt_ext_introstoryone_img\"></div>\n </div>\n <div class=\"pkt_ext_introstorydivider\"></div>\n <div class=\"pkt_ext_introstory pkt_ext_introstorytwo\">\n <div class=\"pkt_ext_introstory_text\">\n <p class=\"pkt_ext_tagline\">" - + escapeExpression(((helper = (helper = helpers.taglinestory_two || (depth0 != null ? depth0.taglinestory_two : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_two","hash":{},"data":data}) : helper))) - + "</p>\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(6, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - buffer += " </div>\n <div class=\"pkt_ext_introstorytwo_img\"></div>\n </div>\n</div>\n<div class=\"pkt_ext_signupdetail\">\n"; - stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(8, data),"inverse":this.program(10, data),"data":data}); - if (stack1 != null) { buffer += stack1; } - return buffer + "\n</div>\n"; -},"useData":true}); -})(); diff --git a/browser/extensions/pocket/content/panels/js/vendor/handlebars.runtime.js b/browser/extensions/pocket/content/panels/js/vendor/handlebars.runtime.js deleted file mode 100644 index c8bb1c452..000000000 --- a/browser/extensions/pocket/content/panels/js/vendor/handlebars.runtime.js +++ /dev/null @@ -1,660 +0,0 @@ -/* - - handlebars v2.0.0 - -Copyright (C) 2011-2014 by Yehuda Katz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -@license -*/ -/* exported Handlebars */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof exports === 'object') { - module.exports = factory(); - } else { - root.Handlebars = root.Handlebars || factory(); - } -}(this, function () { -// handlebars/safe-string.js -var __module3__ = (function() { - "use strict"; - var __exports__; - // Build out our basic SafeString type - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = function() { - return "" + this.string; - }; - - __exports__ = SafeString; - return __exports__; -})(); - -// handlebars/utils.js -var __module2__ = (function(__dependency1__) { - "use strict"; - var __exports__ = {}; - /*jshint -W004 */ - var SafeString = __dependency1__; - - var escape = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "`": "`" - }; - - var badChars = /[&<>"'`]/g; - var possible = /[&<>"'`]/; - - function escapeChar(chr) { - return escape[chr]; - } - - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; - } - } - } - - return obj; - } - - __exports__.extend = extend;var toString = Object.prototype.toString; - __exports__.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - var isFunction = function(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - isFunction = function(value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; - }; - } - var isFunction; - __exports__.isFunction = isFunction; - /* istanbul ignore next */ - var isArray = Array.isArray || function(value) { - return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; - }; - __exports__.isArray = isArray; - - function escapeExpression(string) { - // don't escape SafeStrings, since they're already safe - if (string instanceof SafeString) { - return string.toString(); - } else if (string == null) { - return ""; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = "" + string; - - if(!possible.test(string)) { return string; } - return string.replace(badChars, escapeChar); - } - - __exports__.escapeExpression = escapeExpression;function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } - - __exports__.appendContextPath = appendContextPath; - return __exports__; -})(__module3__); - -// handlebars/exception.js -var __module4__ = (function() { - "use strict"; - var __exports__; - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var line; - if (node && node.firstLine) { - line = node.firstLine; - - message += ' - ' + line + ':' + node.firstColumn; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (line) { - this.lineNumber = line; - this.column = node.firstColumn; - } - } - - Exception.prototype = new Error(); - - __exports__ = Exception; - return __exports__; -})(); - -// handlebars/base.js -var __module1__ = (function(__dependency1__, __dependency2__) { - "use strict"; - var __exports__ = {}; - var Utils = __dependency1__; - var Exception = __dependency2__; - - var VERSION = "2.0.0"; - __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; - __exports__.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - __exports__.REVISION_CHANGES = REVISION_CHANGES; - var isArray = Utils.isArray, - isFunction = Utils.isFunction, - toString = Utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { throw new Exception('Arg not supported with multiple helpers'); } - Utils.extend(this.helpers, name); - } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function(name) { - delete this.helpers[name]; - }, - - registerPartial: function(name, partial) { - if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); - } else { - this.partials[name] = partial; - } - }, - unregisterPartial: function(name) { - delete this.partials[name]; - } - }; - - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function(/* [args, ]options */) { - if(arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); - } - }); - - instance.registerHelper('blockHelperMissing', function(context, options) { - var inverse = options.inverse, - fn = options.fn; - - if(context === true) { - return fn(this); - } else if(context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if(context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); - options = {data: data}; - } - - return fn(context, options); - } - }); - - instance.registerHelper('each', function(context, options) { - if (!options) { - throw new Exception('Must pass iterator to #each'); - } - - var fn = options.fn, inverse = options.inverse; - var i = 0, ret = "", data; - - var contextPath; - if (options.data && options.ids) { - contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { context = context.call(this); } - - if (options.data) { - data = createFrame(options.data); - } - - if(context && typeof context === 'object') { - if (isArray(context)) { - for(var j = context.length; i<j; i++) { - if (data) { - data.index = i; - data.first = (i === 0); - data.last = (i === (context.length-1)); - - if (contextPath) { - data.contextPath = contextPath + i; - } - } - ret = ret + fn(context[i], { data: data }); - } - } else { - for(var key in context) { - if(context.hasOwnProperty(key)) { - if(data) { - data.key = key; - data.index = i; - data.first = (i === 0); - - if (contextPath) { - data.contextPath = contextPath + key; - } - } - ret = ret + fn(context[key], {data: data}); - i++; - } - } - } - } - - if(i === 0){ - ret = inverse(this); - } - - return ret; - }); - - instance.registerHelper('if', function(conditional, options) { - if (isFunction(conditional)) { conditional = conditional.call(this); } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function(conditional, options) { - return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash}); - }); - - instance.registerHelper('with', function(context, options) { - if (isFunction(context)) { context = context.call(this); } - - var fn = options.fn; - - if (!Utils.isEmpty(context)) { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]); - options = {data:data}; - } - - return fn(context, options); - } else { - return options.inverse(this); - } - }); - - instance.registerHelper('log', function(message, options) { - var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; - instance.log(level, message); - }); - - instance.registerHelper('lookup', function(obj, field) { - return obj && obj[field]; - }); - } - - var logger = { - methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' }, - - // State enum - DEBUG: 0, - INFO: 1, - WARN: 2, - ERROR: 3, - level: 3, - - // can be overridden in the host environment - log: function(level, message) { - if (logger.level <= level) { - var method = logger.methodMap[level]; - if (typeof console !== 'undefined' && console[method]) { - console[method].call(console, message); - } - } - } - }; - __exports__.logger = logger; - var log = logger.log; - __exports__.log = log; - var createFrame = function(object) { - var frame = Utils.extend({}, object); - frame._parent = object; - return frame; - }; - __exports__.createFrame = createFrame; - return __exports__; -})(__module2__, __module4__); - -// handlebars/runtime.js -var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) { - "use strict"; - var __exports__ = {}; - var Utils = __dependency1__; - var Exception = __dependency2__; - var COMPILER_REVISION = __dependency3__.COMPILER_REVISION; - var REVISION_CHANGES = __dependency3__.REVISION_CHANGES; - var createFrame = __dependency3__.createFrame; - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = REVISION_CHANGES[currentRevision], - compilerVersions = REVISION_CHANGES[compilerRevision]; - throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+ - "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+")."); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+ - "Please update your runtime to a newer version ("+compilerInfo[1]+")."); - } - } - } - - __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial - - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new Exception("No environment passed to template"); - } - if (!templateSpec || !templateSpec.main) { - throw new Exception('Unknown template object: ' + typeof templateSpec); - } - - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) { - if (hash) { - context = Utils.extend({}, context, hash); - } - - var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths); - - if (result == null && env.compile) { - var options = { helpers: helpers, partials: partials, data: data, depths: depths }; - partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env); - result = partials[name](context, options); - } - if (result != null) { - if (indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; - } - - lines[i] = indent + lines[i]; - } - result = lines.join('\n'); - } - return result; - } else { - throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); - } - }; - - // Just add water - var container = { - lookup: function(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; - } - } - }, - lambda: function(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: Utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function(i) { - return templateSpec[i]; - }, - - programs: [], - program: function(i, data, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths) { - programWrapper = program(this, i, fn, data, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = program(this, i, fn); - } - return programWrapper; - }, - - data: function(data, depth) { - while (data && depth--) { - data = data._parent; - } - return data; - }, - merge: function(param, common) { - var ret = param || common; - - if (param && common && (param !== common)) { - ret = Utils.extend({}, common, param); - } - - return ret; - }, - - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; - - var ret = function(context, options) { - options = options || {}; - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths; - if (templateSpec.useDepths) { - depths = options.depths ? [context].concat(options.depths) : [context]; - } - - return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths); - }; - ret.isTop = true; - - ret._setup = function(options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); - } - } else { - container.helpers = options.helpers; - container.partials = options.partials; - } - }; - - ret._child = function(i, data, depths) { - if (templateSpec.useDepths && !depths) { - throw new Exception('must pass parent depths'); - } - - return program(container, i, templateSpec[i], data, depths); - }; - return ret; - } - - __exports__.template = template;function program(container, i, fn, data, depths) { - var prog = function(context, options) { - options = options || {}; - - return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths)); - }; - prog.program = i; - prog.depth = depths ? depths.length : 0; - return prog; - } - - __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) { - var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths }; - - if(partial === undefined) { - throw new Exception("The partial " + name + " could not be found"); - } else if(partial instanceof Function) { - return partial(context, options); - } - } - - __exports__.invokePartial = invokePartial;function noop() { return ""; } - - __exports__.noop = noop;function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? createFrame(data) : {}; - data.root = context; - } - return data; - } - return __exports__; -})(__module2__, __module4__, __module1__); - -// handlebars.runtime.js -var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) { - "use strict"; - var __exports__; - /*globals Handlebars: true */ - var base = __dependency1__; - - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) - var SafeString = __dependency2__; - var Exception = __dependency3__; - var Utils = __dependency4__; - var runtime = __dependency5__; - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - var create = function() { - var hb = new base.HandlebarsEnvironment(); - - Utils.extend(hb, base); - hb.SafeString = SafeString; - hb.Exception = Exception; - hb.Utils = Utils; - hb.escapeExpression = Utils.escapeExpression; - - hb.VM = runtime; - hb.template = function(spec) { - return runtime.template(spec, hb); - }; - - return hb; - }; - - var Handlebars = create(); - Handlebars.create = create; - - Handlebars['default'] = Handlebars; - - __exports__ = Handlebars; - return __exports__; -})(__module1__, __module3__, __module4__, __module2__, __module5__); - - return __module0__; -})); diff --git a/browser/extensions/pocket/content/panels/js/vendor/jquery-2.1.1.min.js b/browser/extensions/pocket/content/panels/js/vendor/jquery-2.1.1.min.js deleted file mode 100644 index 9ed2acc66..000000000 --- a/browser/extensions/pocket/content/panels/js/vendor/jquery-2.1.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) -},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b)) -},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
\ No newline at end of file diff --git a/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js b/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js deleted file mode 100644 index 40d323df0..000000000 --- a/browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js +++ /dev/null @@ -1,954 +0,0 @@ -/*
- * jQuery Plugin: Tokenizing Autocomplete Text Entry
- * Version 1.6.0
- *
- * Copyright (c) 2009 James Smith (http://loopj.com)
- * Licensed jointly under the GPL and MIT licenses,
- * choose which one suits your project best!
- *
- * Licensed under MIT
- * With modifications
- *
- */
-
-(function ($) {
-// Default settings
-var DEFAULT_SETTINGS = {
- // Search settings
- method: "GET",
- contentType: "json",
- queryParam: "q",
- searchDelay: 300,
- minChars: 1,
- propertyToSearch: "name",
- jsonContainer: null,
- scrollKeyboard: false,
-
- // Display settings
- hintText: null,
- noResultsText: null,
- noResultsHideDropdown: false,
- searchingText: null,
- deleteText: "×",
- animateDropdown: true,
- emptyInputLength: null,
-
- // Tokenization settings
- tokenLimit: null,
- tokenDelimiter: ",",
- preventDuplicates: false,
-
- // Output settings
- tokenValue: "id",
-
- // Prepopulation settings
- prePopulate: null,
- processPrePopulate: false,
-
- // Manipulation settings
- idPrefix: "token-input-",
-
- // Formatters
- resultsFormatter: function(item) {
- let listItem = document.createElement("li");
- listItem.textContent = item[this.propertyToSearch];
- return listItem.outerHTML;
- },
- tokenFormatter: function(item) {
- let listItem = document.createElement("li");
- let p = document.createElement("p");
- p.textContent = item[this.propertyToSearch];
- listItem.appendChild(p);
- return listItem.outerHTML;
- },
-
- // Validations
- validateItem: null,
-
- // Force selections only on mouse click
- noHoverSelect: false,
-
- // Callbacks
- onResult: null,
- onAdd: null,
- onDelete: null,
- onReady: null
-};
-
-// Default classes to use when theming
-var DEFAULT_CLASSES = {
- tokenList: "token-input-list",
- token: "token-input-token",
- tokenDelete: "token-input-delete-token",
- selectedToken: "token-input-selected-token",
- highlightedToken: "token-input-highlighted-token",
- dropdown: "token-input-dropdown",
- dropdownItem: "token-input-dropdown-item",
- dropdownItem2: "token-input-dropdown-item2",
- selectedDropdownItem: "token-input-selected-dropdown-item",
- inputToken: "token-input-input-token"
-};
-
-// Input box position "enum"
-var POSITION = {
- BEFORE: 0,
- AFTER: 1,
- END: 2
-};
-
-// Keys "enum"
-var KEY = {
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- ESCAPE: 27,
- SPACE: 32,
- PAGE_UP: 33,
- PAGE_DOWN: 34,
- END: 35,
- HOME: 36,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- NUMPAD_ENTER: 108,
- COMMA: 188
-};
-
-// Additional public (exposed) methods
-var methods = {
- init: function(url_or_data_or_function, options) {
- var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
-
- return this.each(function () {
- $(this).data("tokenInputObject", new $.TokenList(this, url_or_data_or_function, settings));
- });
- },
- clear: function() {
- this.data("tokenInputObject").clear();
- return this;
- },
- add: function(item) {
- this.data("tokenInputObject").add(item);
- return this;
- },
- remove: function(item) {
- this.data("tokenInputObject").remove(item);
- return this;
- },
- get: function() {
- return this.data("tokenInputObject").getTokens();
- }
-}
-
-// Expose the .tokenInput function to jQuery as a plugin
-$.fn.tokenInput = function (method) {
- // Method calling and initialization logic
- if(methods[method]) {
- return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
- } else {
- return methods.init.apply(this, arguments);
- }
-};
-
-// TokenList class for each input
-$.TokenList = function (input, url_or_data, settings) {
- //
- // Initialization
- //
-
- // Configure the data source
- if($.type(url_or_data) === "string" || $.type(url_or_data) === "function") {
- // Set the url to query against
- settings.url = url_or_data;
-
- // If the URL is a function, evaluate it here to do our initalization work
- var url = computeURL();
-
- // Make a smart guess about cross-domain if it wasn't explicitly specified
- if(settings.crossDomain === undefined) {
- if(url.indexOf("://") === -1) {
- settings.crossDomain = false;
- } else {
- settings.crossDomain = (location.href.split(/\/+/g)[1] !== url.split(/\/+/g)[1]);
- }
- }
- } else if(typeof(url_or_data) === "object") {
- // Set the local data to search through
- settings.local_data = url_or_data;
- }
-
- // Build class names
- if(settings.classes) {
- // Use custom class names
- settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
- } else if(settings.theme) {
- // Use theme-suffixed default class names
- settings.classes = {};
- $.each(DEFAULT_CLASSES, function(key, value) {
- settings.classes[key] = value + "-" + settings.theme;
- });
- } else {
- settings.classes = DEFAULT_CLASSES;
- }
-
-
- // Save the tokens
- var saved_tokens = [];
-
- // Keep track of the number of tokens in the list
- var token_count = 0;
-
- // Basic cache to save on db hits
- var cache = new $.TokenList.Cache();
-
- // Keep track of the timeout, old vals
- var timeout;
- var input_val;
-
- function tokenize(){
- var item = $(selected_dropdown_item).data("tokeninput");
- if(!item && settings.textToData){
- item = settings.textToData(input_box.val());
- }
-
- if(item) {
- add_token(item);
- hidden_input.change();
- return false;
- }
- }
-
- // Create a new text input an attach keyup events
- var input_box = $("<input type=\"text\" autocomplete=\"off\">")
- .css({
- outline: "none"
- })
- .attr("id", settings.idPrefix + input.id)
- .focus(function () {
- if (settings.minChars == 0) {
- setTimeout(function(){do_search();}, 5);
- }
- if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
- show_dropdown_hint();
- }
- })
- .blur(function () {
- tokenize();
- hide_dropdown();
- $(this).val("");
- })
- .bind("keyup keydown blur update", resize_input)
- .keydown(function (event) {
- var previous_token;
- var next_token;
-
- switch(event.keyCode) {
- case KEY.LEFT:
- case KEY.RIGHT:
- case KEY.UP:
- case KEY.DOWN:
- if(!$(this).val()) {
- previous_token = input_token.prev();
- next_token = input_token.next();
-
- if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
- // Check if there is a previous/next token and it is selected
- if(event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
- deselect_token($(selected_token), POSITION.BEFORE);
- } else {
- deselect_token($(selected_token), POSITION.AFTER);
- }
- } else if((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
- // We are moving left, select the previous token if it exists
- select_token($(previous_token.get(0)));
- } else if((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
- // We are moving right, select the next token if it exists
- select_token($(next_token.get(0)));
- }
- } else {
- if (event.keyCode === KEY.UP || event.keyCode === KEY.DOWN) {
- var dropdown_item = null;
- if(!selected_dropdown_item && (event.keyCode === KEY.DOWN)) {
- dropdown_item = $('.token-input-dropdown li').first();
- }
- else if(event.keyCode === KEY.DOWN) {
- dropdown_item = $(selected_dropdown_item).next();
- } else {
- dropdown_item = $(selected_dropdown_item).prev();
- }
-
- if(dropdown_item.length) {
- select_dropdown_item(dropdown_item,true);
- }
- else if (!(event.keyCode === KEY.DOWN) && $(selected_dropdown_item).length) {
- deselect_dropdown_item($(selected_dropdown_item));
- }
- return false;
- }
- }
- break;
-
- case KEY.BACKSPACE:
- previous_token = input_token.prev();
-
- if(!$(this).val().length) {
- if(selected_token) {
- delete_token($(selected_token));
- hidden_input.change();
- } else if(previous_token.length) {
- select_token($(previous_token.get(0)));
- }
-
- return false;
- } else if($(this).val().length === 1) {
- hide_dropdown();
- } else {
- // set a timeout just long enough to let this function finish.
- setTimeout(function(){do_search();}, 5);
- }
- break;
-
- case KEY.TAB:
- case KEY.ENTER:
- case KEY.NUMPAD_ENTER:
- case KEY.COMMA:
- if (event.keyCode != KEY.ENTER && event.keyCode != KEY.NUMPAD_ENTER)
- {
- event.preventDefault();
- }
- tokenize();
- break;
-
- case KEY.ESCAPE:
- hide_dropdown();
- return true;
-
- default:
- if(String.fromCharCode(event.which)) {
- // set a timeout just long enough to let this function finish.
- setTimeout(function(){do_search();}, 5);
- }
- break;
- }
- });
-
- // Keep a reference to the original input box
- var hidden_input = $(input)
- .hide()
- .val("")
- .focus(function () {
- input_box.focus();
- })
- .blur(function () {
- input_box.blur();
- });
-
- // Keep a reference to the selected token and dropdown item
- var selected_token = null;
- var selected_token_index = 0;
- var selected_dropdown_item = null;
-
- // The list to store the token items in
- var token_list = $("<ul />")
- .addClass(settings.classes.tokenList)
- .click(function (event) {
- var li = $(event.target).closest("li");
- if(li && li.get(0) && $.data(li.get(0), "tokeninput")) {
- toggle_select_token(li);
- } else {
- // Deselect selected token
- if(selected_token) {
- deselect_token($(selected_token), POSITION.END);
- }
-
- // Focus input box
- input_box.focus();
- }
- })
- .mouseover(function (event) {
- var li = $(event.target).closest("li");
- if(li && selected_token !== this) {
- li.addClass(settings.classes.highlightedToken);
- }
- })
- .mouseout(function (event) {
- var li = $(event.target).closest("li");
- if(li && selected_token !== this) {
- li.removeClass(settings.classes.highlightedToken);
- }
- })
- .insertBefore(hidden_input);
-
- // The token holding the input box
- var input_token = $("<li />")
- .addClass(settings.classes.inputToken)
- .appendTo(token_list)
- .append(input_box);
-
- // The list to store the dropdown items in
- var dropdown = $("<div>")
- .addClass(settings.classes.dropdown)
- .appendTo("body")
- .hide();
-
- // Magic element to help us resize the text input
- var input_resizer = $("<tester/>")
- .insertAfter(input_box)
- .css({
- position: "absolute",
- top: -9999,
- left: -9999,
- width: "auto",
- fontSize: input_box.css("fontSize"),
- fontFamily: input_box.css("fontFamily"),
- fontWeight: input_box.css("fontWeight"),
- letterSpacing: input_box.css("letterSpacing"),
- whiteSpace: "nowrap"
- });
-
- // Pre-populate list if items exist
- hidden_input.val("");
- var li_data = settings.prePopulate || hidden_input.data("pre");
- if(settings.processPrePopulate && $.isFunction(settings.onResult)) {
- li_data = settings.onResult.call(hidden_input, li_data);
- }
- if(li_data && li_data.length) {
- $.each(li_data, function (index, value) {
- insert_token(value);
- checkTokenLimit();
- });
- }
-
- // Initialization is done
- if($.isFunction(settings.onReady)) {
- settings.onReady.call();
- if (settings.minChars == 0)
- {
- setTimeout(function(){do_search();}, 5);
- }
- }
-
- //
- // Public functions
- //
-
- this.clear = function() {
- token_list.children("li").each(function() {
- if ($(this).children("input").length === 0) {
- delete_token($(this));
- }
- });
- }
-
- this.add = function(item) {
- add_token(item);
- }
-
- this.remove = function(item) {
- token_list.children("li").each(function() {
- if ($(this).children("input").length === 0) {
- var currToken = $(this).data("tokeninput");
- var match = true;
- for (var prop in item) {
- if (item[prop] !== currToken[prop]) {
- match = false;
- break;
- }
- }
- if (match) {
- delete_token($(this));
- }
- }
- });
- }
-
- this.getTokens = function() {
- return saved_tokens;
- }
-
- //
- // Private functions
- //
-
- function checkTokenLimit() {
- if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
- input_box.hide();
- hide_dropdown();
- return;
- }
- }
-
- function resize_input() {
- if(input_val === (input_val = input_box.val())) {return;}
-
- // Enter new content into resizer and resize input accordingly
- var escaped = input_val.replace(/&/g, '&').replace(/\s/g,' ').replace(/</g, '<').replace(/>/g, '>');
- input_resizer.html(escaped);
- var minwidth = 30;
- if (settings.emptyInputLength && token_list.children().length < 2) {
- minwidth = settings.emptyInputLength;
- }
- input_box.width(input_resizer.width() + minwidth);
- }
-
- function is_printable_character(keycode) {
- return ((keycode >= 48 && keycode <= 90) || // 0-1a-z
- (keycode >= 96 && keycode <= 111) || // numpad 0-9 + - / * .
- (keycode >= 186 && keycode <= 192) || // ; = , - . / ^
- (keycode >= 219 && keycode <= 222)); // ( \ ) '
- }
-
- // Inner function to a token to the list
- function insert_token(item) {
- var this_token = settings.tokenFormatter(item);
- this_token = $(this_token)
- .addClass(settings.classes.token)
- .insertBefore(input_token);
-
- // The 'delete token' button
- $("<span>" + settings.deleteText + "</span>")
- .addClass(settings.classes.tokenDelete)
- .appendTo(this_token)
- .click(function () {
- delete_token($(this).parent());
- hidden_input.change();
- return false;
- });
-
- // Store data on the token
- var token_data = {"id": item.id};
- token_data[settings.propertyToSearch] = item[settings.propertyToSearch];
- token_data.item = item;
- $.data(this_token.get(0), "tokeninput", item);
-
- // Save this token for duplicate checking
- saved_tokens = saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
- selected_token_index++;
-
- // Update the hidden input
- update_hidden_input(saved_tokens, hidden_input);
-
- token_count += 1;
-
- // Check the token limit
- if(settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
- input_box.hide();
- hide_dropdown();
- }
-
- return this_token;
- }
-
- // Add a token to the token list based on user input
- function add_token (item) {
- if(!item) return;
-
- // Check for item validation
- if ($.isFunction(settings.validateItem) && !settings.validateItem(item)) {
- return false;
- }
-
- var callback = settings.onAdd;
-
- // See if the token already exists and select it if we don't want duplicates
- if(token_count > 0 && settings.preventDuplicates) {
- var found_existing_token = null;
- token_list.children().each(function () {
- var existing_token = $(this);
- var existing_data = $.data(existing_token.get(0), "tokeninput");
- if(existing_data && existing_data.id === item.id) {
- found_existing_token = existing_token;
- return false;
- }
- });
-
- if(found_existing_token) {
- select_token(found_existing_token);
- input_token.insertAfter(found_existing_token);
- input_box.focus();
- return;
- }
- }
-
- // Insert the new tokens
- if(settings.tokenLimit == null || token_count < settings.tokenLimit) {
- insert_token(item);
- checkTokenLimit();
- }
-
- // Clear input box
- input_box.val("");
-
- // Don't show the help dropdown, they've got the idea
- hide_dropdown();
-
- // Execute the onAdd callback if defined
- if($.isFunction(callback)) {
- callback.call(hidden_input,item);
- }
- }
-
- // Select a token in the token list
- function select_token (token) {
- token.addClass(settings.classes.selectedToken);
- selected_token = token.get(0);
-
- // Hide input box
- input_box.val("");
-
- // Hide dropdown if it is visible (eg if we clicked to select token)
- hide_dropdown();
- }
-
- // Deselect a token in the token list
- function deselect_token (token, position) {
- token.removeClass(settings.classes.selectedToken);
- selected_token = null;
-
- if(position === POSITION.BEFORE) {
- input_token.insertBefore(token);
- selected_token_index--;
- } else if(position === POSITION.AFTER) {
- input_token.insertAfter(token);
- selected_token_index++;
- } else {
- input_token.appendTo(token_list);
- selected_token_index = token_count;
- }
-
- // Show the input box and give it focus again
- input_box.focus();
- }
-
- // Toggle selection of a token in the token list
- function toggle_select_token(token) {
- var previous_selected_token = selected_token;
-
- if(selected_token) {
- deselect_token($(selected_token), POSITION.END);
- }
-
- if(previous_selected_token === token.get(0)) {
- deselect_token(token, POSITION.END);
- } else {
- select_token(token);
- }
- }
-
- // Delete a token from the token list
- function delete_token (token) {
- // Remove the id from the saved list
- var token_data = $.data(token.get(0), "tokeninput");
- var callback = settings.onDelete;
-
- var index = token.prevAll().length;
- if(index > selected_token_index) index--;
-
- // Delete the token
- token.remove();
- selected_token = null;
-
- // Show the input box and give it focus again
- input_box.focus();
-
- // Remove this token from the saved list
- saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
- if(index < selected_token_index) selected_token_index--;
-
- // Update the hidden input
- update_hidden_input(saved_tokens, hidden_input);
-
- token_count -= 1;
-
- if(settings.tokenLimit !== null) {
- input_box
- .show()
- .val("")
- .focus();
- }
-
- // Execute the onDelete callback if defined
- if($.isFunction(callback)) {
- callback.call(hidden_input,token_data);
- }
- }
-
- // Update the hidden input box value
- function update_hidden_input(saved_tokens, hidden_input) {
- var token_values = $.map(saved_tokens, function (el) {
- return el[settings.tokenValue];
- });
- hidden_input.val(token_values.join(settings.tokenDelimiter));
-
- }
-
- // Hide and clear the results dropdown
- function hide_dropdown () {
- dropdown.hide().empty();
- selected_dropdown_item = null;
- if (settings.onHideDropdown)
- settings.onHideDropdown();
- }
-
- function show_dropdown() {
- dropdown
- .css({
- position: "absolute",
- top: $(token_list).offset().top + $(token_list).outerHeight(),
- left: $(token_list).offset().left,
- zindex: 999
- })
- .show();
- if (settings.onShowDropdown)
- settings.onShowDropdown();
- }
-
- function show_dropdown_searching () {
- if(settings.searchingText) {
- dropdown.html("<p>"+settings.searchingText+"</p>");
- show_dropdown();
- }
- }
-
- function show_dropdown_hint () {
- if(settings.hintText) {
- dropdown.html("<p>"+settings.hintText+"</p>");
- show_dropdown();
- }
- }
-
- // Highlight the query part of the search term
- function highlight_term(value, term) {
- return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
- }
-
- function find_value_and_highlight_term(template, value, term) {
- return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + value + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term));
- }
-
- // Populate the results dropdown with some results
- function populate_dropdown (query, results) {
- if(results && results.length) {
- dropdown.empty();
- var dropdown_ul = $("<ul>")
- .appendTo(dropdown)
- .mouseover(function (event) {
- select_dropdown_item($(event.target).closest("li"));
- })
- .mousedown(function (event) {
- add_token($(event.target).closest("li").data("tokeninput"));
- hidden_input.change();
- return false;
- })
- .hide();
- if (settings.noHoverSelect) {
- dropdown_ul.off('mouseover');
- dropdown_ul.on('mouseover',function (event) {
- $(this).find("li").removeClass(settings.classes.selectedDropdownItem);
- $(event.target).closest("li").addClass(settings.classes.selectedDropdownItem);
- });
- }
-
- $.each(results, function(index, value) {
- var this_li = settings.resultsFormatter(value);
-
- // this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);
-
- this_li = $(this_li).appendTo(dropdown_ul);
-
- if(index % 2) {
- this_li.addClass(settings.classes.dropdownItem);
- } else {
- this_li.addClass(settings.classes.dropdownItem2);
- }
-
- // if(index === 0) {
- // select_dropdown_item(this_li);
- // }
-
- $.data(this_li.get(0), "tokeninput", value);
- });
-
- show_dropdown();
-
- if(settings.animateDropdown) {
- dropdown_ul.slideDown("fast");
- } else {
- dropdown_ul.show();
- }
- } else {
- if(settings.noResultsText) {
- dropdown.html("<p>"+settings.noResultsText+"</p>");
- show_dropdown();
- }
- if (settings.noResultsHideDropdown) {
- hide_dropdown();
- }
- }
- }
-
- // Highlight an item in the results dropdown
- function select_dropdown_item (item,withkeyboard) {
- if(item) {
- if(selected_dropdown_item) {
- deselect_dropdown_item($(selected_dropdown_item));
- }
- if (settings.scrollKeyboard && withkeyboard) {
- var list = $('.token-input-dropdown-tag ul');
- var listheight = list.height();
- var itemheight = item.outerHeight();
- var itemtop = item.position().top;
- if (itemtop > listheight) {
- var listscroll = list.scrollTop();
- list.scrollTop(listscroll + itemheight);
- }
- else if (itemtop < 0) {
- var listscroll = list.scrollTop();
- list.scrollTop(listscroll - itemheight);
- }
-
- }
- item.addClass(settings.classes.selectedDropdownItem);
- selected_dropdown_item = item.get(0);
- }
- }
-
- // Remove highlighting from an item in the results dropdown
- function deselect_dropdown_item (item) {
- item.removeClass(settings.classes.selectedDropdownItem);
- selected_dropdown_item = null;
- }
-
- // Do a search and show the "searching" dropdown if the input is longer
- // than settings.minChars
- function do_search() {
- var query = input_box.val().toLowerCase();
- if(query && query.length || settings.minChars == 0) {
- if(selected_token) {
- deselect_token($(selected_token), POSITION.AFTER);
- }
-
- if(query.length >= settings.minChars) {
- show_dropdown_searching();
- clearTimeout(timeout);
-
- timeout = setTimeout(function(){
- run_search(query);
- }, settings.searchDelay);
- } else {
- hide_dropdown();
- }
- }
- }
-
- // Do the actual search
- function run_search(query) {
- var cache_key = query + computeURL();
- var cached_results = cache.get(cache_key);
- if(cached_results) {
- populate_dropdown(query, cached_results);
- } else {
- // Are we doing an ajax search or local data search?
- if(settings.url) {
- var url = computeURL();
- // Extract exisiting get params
- var ajax_params = {};
- ajax_params.data = {};
- if(url.indexOf("?") > -1) {
- var parts = url.split("?");
- ajax_params.url = parts[0];
-
- var param_array = parts[1].split("&");
- $.each(param_array, function (index, value) {
- var kv = value.split("=");
- ajax_params.data[kv[0]] = kv[1];
- });
- } else {
- ajax_params.url = url;
- }
-
- // Prepare the request
- ajax_params.data[settings.queryParam] = query;
- ajax_params.type = settings.method;
- ajax_params.dataType = settings.contentType;
- if(settings.crossDomain) {
- ajax_params.dataType = "jsonp";
- }
-
- // Attach the success callback
- ajax_params.success = function(results) {
- if($.isFunction(settings.onResult)) {
- results = settings.onResult.call(hidden_input, results);
- }
- cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);
-
- // only populate the dropdown if the results are associated with the active search query
- if(input_box.val().toLowerCase() === query) {
- populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
- }
- };
-
- // Make the request
- $.ajax(ajax_params);
- } else if(settings.search_function){
- settings.search_function(query, function(results){
- cache.add(cache_key, results);
- populate_dropdown(query, results);
- });
- } else if(settings.local_data) {
- // Do the search through local data
- var results = $.grep(settings.local_data, function (row) {
- return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
- });
-
- if($.isFunction(settings.onResult)) {
- results = settings.onResult.call(hidden_input, results);
- }
- cache.add(cache_key, results);
- populate_dropdown(query, results);
- }
- }
- }
-
- // compute the dynamic URL
- function computeURL() {
- var url = settings.url;
- if(typeof settings.url == 'function') {
- url = settings.url.call();
- }
- return url;
- }
-};
-
-// Really basic cache for the results
-$.TokenList.Cache = function (options) {
- var settings = $.extend({
- max_size: 500
- }, options);
-
- var data = {};
- var size = 0;
-
- var flush = function () {
- data = {};
- size = 0;
- };
-
- this.add = function (query, results) {
- if(size > settings.max_size) {
- flush();
- }
-
- if(!data[query]) {
- size += 1;
- }
-
- data[query] = results;
- };
-
- this.get = function (query) {
- return data[query];
- };
-};
-}(jQuery));
diff --git a/browser/extensions/pocket/content/panels/license.txt b/browser/extensions/pocket/content/panels/license.txt deleted file mode 100644 index 7f3f806ba..000000000 --- a/browser/extensions/pocket/content/panels/license.txt +++ /dev/null @@ -1,35 +0,0 @@ -
-Unless where otherwise noted, the following license applies to the files
-within this directory and descendents of this directory.
-
-POCKET MARKS
-
-Notwithstanding the permitted uses of the Software (as defined below) pursuant
-to the license set forth below, "Pocket," "Read It Later" and the Pocket icon
-and logos (collectively, the “Pocket Marks”) are registered and common law
-trademarks of Read It Later, Inc. This means that, while you have considerable
-freedom to redistribute and modify the Software, there are tight restrictions
-on your ability to use the Pocket Marks. This license does not grant you any
-rights to use the Pocket Marks except as they are embodied in the Software.
-
----
-
-SOFTWARE
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/browser/extensions/pocket/content/panels/saved.html b/browser/extensions/pocket/content/panels/saved.html deleted file mode 100644 index 93477d8ee..000000000 --- a/browser/extensions/pocket/content/panels/saved.html +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <base href="chrome://pocket/content/panels/"> - <title>Pocket: Page Saved</title> - <link rel="stylesheet" href="css/normalize.css"> - <link rel="stylesheet" href="css/firasans.css"> - <link rel="stylesheet" href="css/saved.css"> - </head> - <body class="pkt_ext_containersaved" aria-live="polite"> - <script type="text/javascript" src="js/vendor/jquery-2.1.1.min.js"></script> - <script type="text/javascript" src="js/vendor/handlebars.runtime.js"></script> - <script type="text/javascript" src="js/vendor/jquery.tokeninput.min.js"></script> - <script type="text/javascript" src="js/tmpl.js"></script> - <script type="text/javascript" src="js/messages.js"></script> - <script type="text/javascript" src="js/saved.js"></script> - </body> -</html> diff --git a/browser/extensions/pocket/content/panels/signup.html b/browser/extensions/pocket/content/panels/signup.html deleted file mode 100644 index bcdf66ed4..000000000 --- a/browser/extensions/pocket/content/panels/signup.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <base href="chrome://pocket/content/panels/"> - <title>Pocket: Sign Up</title> - <link rel="stylesheet" href="css/normalize.css"> - <link rel="stylesheet" href="css/firasans.css"> - <link rel="stylesheet" href="css/signup.css"> - </head> - <body class="pkt_ext_containersignup" aria-live="polite"> - <script type="text/javascript" src="js/vendor/jquery-2.1.1.min.js"></script> - <script type="text/javascript" src="js/vendor/handlebars.runtime.js"></script> - <script type="text/javascript" src="js/tmpl.js"></script> - <script type="text/javascript" src="js/messages.js"></script> - <script type="text/javascript" src="js/signup.js"></script> - </body> -</html> diff --git a/browser/extensions/pocket/content/panels/tmpl/saved_premiumextras.handlebars b/browser/extensions/pocket/content/panels/tmpl/saved_premiumextras.handlebars deleted file mode 100644 index b224450ec..000000000 --- a/browser/extensions/pocket/content/panels/tmpl/saved_premiumextras.handlebars +++ /dev/null @@ -1,2 +0,0 @@ -<div class="pkt_ext_suggestedtag_detailshown">
-</div>
\ No newline at end of file diff --git a/browser/extensions/pocket/content/panels/tmpl/saved_premiumshell.handlebars b/browser/extensions/pocket/content/panels/tmpl/saved_premiumshell.handlebars deleted file mode 100644 index 5ef042636..000000000 --- a/browser/extensions/pocket/content/panels/tmpl/saved_premiumshell.handlebars +++ /dev/null @@ -1,6 +0,0 @@ -<div class="pkt_ext_suggestedtag_detail pkt_ext_suggestedtag_detail_loading"> - <h4>{{suggestedtags}}</h4> - <div class="pkt_ext_loadingspinner"><div></div></div> - <ul class="pkt_ext_cf"> - </ul> -</div>
\ No newline at end of file diff --git a/browser/extensions/pocket/content/panels/tmpl/saved_shell.handlebars b/browser/extensions/pocket/content/panels/tmpl/saved_shell.handlebars deleted file mode 100644 index 89b7500cd..000000000 --- a/browser/extensions/pocket/content/panels/tmpl/saved_shell.handlebars +++ /dev/null @@ -1,29 +0,0 @@ -<div class="pkt_ext_initload"> - <div class="pkt_ext_logo"></div> - <div class="pkt_ext_topdetail"> - <h2>{{saving}}</h2> - </div> - <div class="pkt_ext_loadingspinner"><div></div></div> -</div> -<div class="pkt_ext_detail"> - <div class="pkt_ext_logo"></div> - <div class="pkt_ext_topdetail"> - <h2>{{pagesaved}}</h2> - <h3 class="pkt_ext_errordetail"></h3> - <nav class="pkt_ext_item_actions pkt_ext_cf"> - <ul> - <li><a class="pkt_ext_removeitem" href="#">{{removepage}}</a></li> - <li class="pkt_ext_actions_separator"></li> - <li><a class="pkt_ext_openpocket" href="https://{{pockethost}}/a?src=ff_ext_saved" target="_blank">{{viewlist}}</a></li> - </ul> - </nav> - </div> - <div class="pkt_ext_tag_detail pkt_ext_cf"> - <div class="pkt_ext_tag_input_wrapper"> - <div class="pkt_ext_tag_input_blocker"></div> - <input class="pkt_ext_tag_input" type="text" placeholder="{{addtags}}"> - </div> - <a href="#" class="pkt_ext_btn pkt_ext_btn_disabled">{{save}}</a> - </div> - <p class="pkt_ext_edit_msg"></p> -</div>
\ No newline at end of file diff --git a/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars b/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars deleted file mode 100644 index 8dddaef60..000000000 --- a/browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars +++ /dev/null @@ -1,32 +0,0 @@ -<div class="pkt_ext_introdetail pkt_ext_introdetailhero"> - <h2 class="pkt_ext_logo">Pocket</h2> - <p class="pkt_ext_tagline">{{tagline}}</p> - {{#if showlearnmore}} - {{#if controlvariant}} - <p class="pkt_ext_learnmorecontainer"><a class="pkt_ext_learnmore" href="https://{{pockethost}}/firefox_learnmore?s=ffi&t=learnmore&tv=panel_control&v={{variant}}" target="_blank">{{learnmore}}</a></p> - {{else}} - <p class="pkt_ext_learnmorecontainer"><a class="pkt_ext_learnmore" href="https://{{pockethost}}/firefox_learnmore?s=ffi&t=learnmore&tv=panel_tryit&v={{variant}}" target="_blank">{{learnmore}}</a></p> - {{/if}} - {{else}} - <p class="pkt_ext_learnmorecontainer"><a class="pkt_ext_learnmore pkt_ext_learnmoreinactive" href="#">{{learnmore}}</a></p> - {{/if}} - <div class="pkt_ext_introimg"></div> -</div> -<div class="pkt_ext_signupdetail pkt_ext_signupdetail_hero"> - {{#if fxasignedin}} - <h4>{{signuptosave}}</h4> - <p class="btn-container"><a href="https://{{pockethost}}/ff_signup?s=ffi&t=signupff&v={{variant}}" target="_blank" class="btn signup-btn-firefox"><span class="logo"></span><span class="text">{{signinfirefox}}</span></a></p> - <p class="alreadyhave">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&src=extension&s=ffi&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - {{else}} - {{#if controlvariant}} - <h4>{{signuptosave}}</h4> - <p class="btn-container"><a href="https://{{pockethost}}/ff_signup?s=ffi&tv=panel_control&t=signupff&v={{variant}}" target="_blank" class="btn signup-btn-firefox"><span class="logo"></span><span class="text">{{signupfirefox}}</span></a></p> - <p class="btn-container"><a href="https://{{pockethost}}/signup?force=email&tv=panel_control&src=extension&s=ffi&t=signupemail&v={{variant}}" target="_blank" class="btn btn-secondary signup-btn-email signup-btn-initstate">{{signupemail}}</a></p> - <p class="alreadyhave">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&tv=panel_control&src=extension&s=ffi&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - {{else}} - <p class="btn-container"><a href="https://{{pockethost}}/firefox_tryitnow?s=ffi&tv=panel_tryit&t=tryitnow" target="_blank" class="btn signup-btn-tryitnow"><span class="text">{{tryitnow}}</span></a></p> - <p class="alreadyhave tryitnowspace">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&s=ffi&tv=panel_tryit&src=extension&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - <p class="pkt_ext_tos">{{{tos}}}</p> - {{/if}} - {{/if}} -</div> diff --git a/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars b/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars deleted file mode 100644 index 8a181e23d..000000000 --- a/browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars +++ /dev/null @@ -1,43 +0,0 @@ -<div class="pkt_ext_introdetail pkt_ext_introdetailstoryboard"> - <div class="pkt_ext_introstory pkt_ext_introstoryone"> - <div class="pkt_ext_introstory_text"> - <p class="pkt_ext_tagline">{{taglinestory_one}}</p> - </div> - <div class="pkt_ext_introstoryone_img"></div> - </div> - <div class="pkt_ext_introstorydivider"></div> - <div class="pkt_ext_introstory pkt_ext_introstorytwo"> - <div class="pkt_ext_introstory_text"> - <p class="pkt_ext_tagline">{{taglinestory_two}}</p> - {{#if showlearnmore}} - {{#if controlvariant}} - <p><a class="pkt_ext_learnmore" href="https://{{pockethost}}/firefox_learnmore?s=ffi&t=learnmore&tv=panel_control&v={{variant}}" target="_blank">{{learnmore}}</a></p> - {{else}} - <p><a class="pkt_ext_learnmore" href="https://{{pockethost}}/firefox_learnmore?s=ffi&t=learnmore&tv=panel_tryit&v={{variant}}" target="_blank">{{learnmore}}</a></p> - {{/if}} - {{else}} - <p><a class="pkt_ext_learnmore pkt_ext_learnmoreinactive" href="#">{{learnmore}}</a></p> - {{/if}} - </div> - <div class="pkt_ext_introstorytwo_img"></div> - </div> -</div> -<div class="pkt_ext_signupdetail"> - {{#if fxasignedin}} - <h4>{{signuptosave}}</h4> - <p class="btn-container"><a href="https://{{pockethost}}/ff_signup?s=ffi&t=signupff&v={{variant}}" target="_blank" class="btn signup-btn-firefox"><span class="logo"></span><span class="text">{{signinfirefox}}</span></a></p> - <p class="alreadyhave">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&src=extension&s=ffi&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - {{else}} - {{#if controlvariant}} - <h4>{{signuptosave}}</h4> - <p class="btn-container"><a href="https://{{pockethost}}/ff_signup?s=ffi&tv=panel_control&t=signupff&v={{variant}}" target="_blank" class="btn signup-btn-firefox"><span class="logo"></span><span class="text">{{signupfirefox}}</span></a></p> - <p class="btn-container"><a href="https://{{pockethost}}/signup?force=email&tv=panel_control&src=extension&s=ffi&t=signupemail&v={{variant}}" target="_blank" class="btn btn-secondary signup-btn-email signup-btn-initstate">{{signupemail}}</a></p> - <p class="alreadyhave">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&tv=panel_control&src=extension&s=ffi&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - {{else}} - <p class="btn-container"><a href="https://{{pockethost}}/firefox_tryitnow?s=ffi&tv=panel_tryit&t=tryitnow" target="_blank" class="btn signup-btn-tryitnow"><span class="text">{{tryitnow}}</span></a></p> - <p class="alreadyhave tryitnowspace">{{alreadyhaveacct}} <a href="https://{{pockethost}}/login?ep=3&s=ffi&tv=panel_tryit&src=extension&t=login&v={{variant}}" target="_blank">{{loginnow}}</a>.</p> - <p class="pkt_ext_tos">{{{tos}}}</p> - {{/if}} - {{/if}} - -</div> diff --git a/browser/extensions/pocket/content/pktApi.jsm b/browser/extensions/pocket/content/pktApi.jsm deleted file mode 100644 index 63b6d415c..000000000 --- a/browser/extensions/pocket/content/pktApi.jsm +++ /dev/null @@ -1,657 +0,0 @@ -/* - * LICENSE - * - * POCKET MARKS - * - * Notwithstanding the permitted uses of the Software (as defined below) pursuant to the license set forth below, "Pocket," "Read It Later" and the Pocket icon and logos (collectively, the “Pocket Marks”) are registered and common law trademarks of Read It Later, Inc. This means that, while you have considerable freedom to redistribute and modify the Software, there are tight restrictions on your ability to use the Pocket Marks. This license does not grant you any rights to use the Pocket Marks except as they are embodied in the Software. - * - * --- - * - * SOFTWARE - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Pocket API module - * - * Public API Documentation: http://getpocket.com/developer/ - * - * - * Definition of keys stored in preferences to preserve user state: - * premium_status: Current premium status for logged in user if available - * Can be 0 for no premium and 1 for premium - * latestSince: Last timestamp a save happened - * tags: All tags for logged in user - * usedTags: All used tags from within the extension sorted by recency - */ - -const {classes: Cc, interfaces: Ci, utils: Cu, manager: Cm} = Components; -this.EXPORTED_SYMBOLS = ["pktApi"]; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); - - -var pktApi = (function() { - - /** - * Configuration - */ - - // Base url for all api calls - var pocketAPIhost = Services.prefs.getCharPref("extensions.pocket.api"); // api.getpocket.com - var pocketSiteHost = Services.prefs.getCharPref("extensions.pocket.site"); // getpocket.com - var baseAPIUrl = "https://" + pocketAPIhost + "/v3"; - - - /** - * Auth keys for the API requests - */ - var oAuthConsumerKey = Services.prefs.getCharPref("extensions.pocket.oAuthConsumerKey"); - - /** - * - */ - var prefBranch = Services.prefs.getBranch("extensions.pocket.settings."); - - /** - * Helper - */ - - var extend = function(out) { - out = out || {}; - - for (var i = 1; i < arguments.length; i++) { - if (!arguments[i]) - continue; - - for (var key in arguments[i]) { - if (arguments[i].hasOwnProperty(key)) - out[key] = arguments[i][key]; - } - } - return out; - } - - var parseJSON = function(jsonString) { - try { - var o = JSON.parse(jsonString); - - // Handle non-exception-throwing cases: - // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking, - // but... JSON.parse(null) returns 'null', and typeof null === "object", - // so we must check for that, too. - if (o && typeof o === "object" && o !== null) { - return o; - } - } - catch (e) { } - - return undefined; - }; - - /** - * Settings - */ - - /** - * Wrapper for different plattforms to get settings for a given key - * @param {string} key A string containing the name of the key you want to - * retrieve the value of - * @return {string} String containing the value of the key. If the key - * does not exist, null is returned - */ - function getSetting(key) { - // TODO : Move this to sqlite or a local file so it's not editable (and is safer) - // https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Local_Storage - - if (!prefBranch.prefHasUserValue(key)) - return undefined; - - return prefBranch.getComplexValue(key, Components.interfaces.nsISupportsString).data; - } - - /** - * Wrapper for different plattforms to set a value for a given key in settings - * @param {string} key A string containing the name of the key you want - * to create/update. - * @param {string} value String containing the value you want to give - * the key you are creating/updating. - */ - function setSetting(key, value) { - // TODO : Move this to sqlite or a local file so it's not editable (and is safer) - // https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Local_Storage - - if (!value) - prefBranch.clearUserPref(key); - else - { - // We use complexValue as tags can have utf-8 characters in them - var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); - str.data = value; - prefBranch.setComplexValue(key, Components.interfaces.nsISupportsString, str); - } - } - - /** - * Auth - */ - - /* - * All cookies from the Pocket domain - * The return format: { cookieName:cookieValue, cookieName:cookieValue, ... } - */ - function getCookiesFromPocket() { - - var cookieManager = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2); - var pocketCookies = cookieManager.getCookiesFromHost(pocketSiteHost, {}); - var cookies = {}; - while (pocketCookies.hasMoreElements()) { - var cookie = pocketCookies.getNext().QueryInterface(Ci.nsICookie2); - cookies[cookie.name] = cookie.value; - } - return cookies; - } - - /** - * Returns access token or undefined if no logged in user was found - * @return {string | undefined} Access token for logged in user user - */ - function getAccessToken() { - var pocketCookies = getCookiesFromPocket(); - - // If no cookie was found just return undefined - if (typeof pocketCookies['ftv1'] === "undefined") { - return undefined; - } - - // Check if a new user logged in in the meantime and clearUserData if so - var sessionId = pocketCookies['fsv1']; - var lastSessionId = getSetting('fsv1'); - if (sessionId !== lastSessionId) { - clearUserData(); - setSetting("fsv1", sessionId); - } - - // Return access token - return pocketCookies['ftv1']; - } - - /** - * Get the current premium status of the user - * @return {number | undefined} Premium status of user - */ - function getPremiumStatus() { - var premiumStatus = getSetting("premium_status"); - if (typeof premiumStatus === "undefined") { - // Premium status is not in settings try get it from cookie - var pocketCookies = getCookiesFromPocket(); - premiumStatus = pocketCookies['ps']; - } - return premiumStatus; - } - - /** - * Helper method to check if a user is premium or not - * @return {Boolean} Boolean if user is premium or not - */ - function isPremiumUser() { - return getPremiumStatus() == 1; - } - - - /** - * Returns users logged in status - * @return {Boolean} Users logged in status - */ - function isUserLoggedIn() { - return (typeof getAccessToken() !== "undefined"); - } - - /** - * API - */ - - /** - * Helper function for executing api requests. It mainly configures the - * ajax call with default values like type, headers or dataType for an api call. - * This function is for internal usage only. - * @param {Object} options - * Possible keys: - * - {string} path: This should be the Pocket API - * endpoint to call. For example providing the path - * "/get" would result in a call to getpocket.com/v3/get - * - {Object|undefined} data: Gets passed on to the jQuery ajax - * call as data parameter - * - {function(Object data, XMLHttpRequest xhr) | undefined} success: - * A function to be called if the request succeeds. - * - {function(Error errorThrown, XMLHttpRequest xhr) | undefined} error: - * A function to be called if the request fails. - * @return {Boolean} Returns Boolean whether the api call started sucessfully - * - */ - function apiRequest(options) { - if ((typeof options === "undefined") || (typeof options.path === "undefined")) { - return false; - } - - var url = baseAPIUrl + options.path; - var data = options.data || {}; - data.locale_lang = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIXULChromeRegistry). - getSelectedLocale("browser"); - data.consumer_key = oAuthConsumerKey; - - var request = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest); - request.open("POST", url, true); - request.onreadystatechange = function(e) { - if (request.readyState == 4) { - if (request.status === 200) { - // There could still be an error if the response is no valid json - // or does not have status = 1 - var response = parseJSON(request.response); - if (options.success && response && response.status == 1) { - options.success(response, request); - return; - } - } - - // Handle error case - if (options.error) { - // In case the user did revoke the access token or it's not - // valid anymore clear the user data - if (request.status === 401) { - clearUserData(); - } - - // Handle error message - var errorMessage; - if (request.status !== 200) { - errorMessage = request.getResponseHeader("X-Error") || request.statusText; - errorMessage = JSON.parse('"' + errorMessage + '"'); - } - var error = {message: errorMessage}; - options.error(error, request); - } - } - }; - - // Set headers - request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); - request.setRequestHeader('X-Accept', ' application/json'); - - // Serialize and Fire off the request - var str = []; - for (var p in data) { - if (data.hasOwnProperty(p)) { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(data[p])); - } - } - - request.send(str.join("&")); - - return true; - } - - /** - * Cleans all settings for the previously logged in user - */ - function clearUserData() { - // Clear stored information - setSetting("premium_status", undefined); - setSetting("latestSince", undefined); - setSetting("tags", undefined); - setSetting("usedTags", undefined); - - setSetting("fsv1", undefined); - } - - /** - * Add a new link to Pocket - * @param {string} url URL of the link - * @param {Object | undefined} options Can provide a string-based title, a - * `success` callback and an `error` callback. - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function addLink(url, options) { - - var since = getSetting('latestSince'); - var accessToken = getAccessToken(); - - var sendData = { - access_token: accessToken, - url: url, - since: since ? since : 0 - }; - - if (options.title) { - sendData.title = options.title; - } - - return apiRequest({ - path: "/firefox/save", - data: sendData, - success: function(data) { - - // Update premium status, tags and since - var tags = data.tags; - if ((typeof tags !== "undefined") && Array.isArray(tags)) { - // If a tagslist is in the response replace the tags - setSetting('tags', JSON.stringify(data.tags)); - } - - // Update premium status - var premiumStatus = data.premium_status; - if (typeof premiumStatus !== "undefined") { - // If a premium_status is in the response replace the premium_status - setSetting("premium_status", premiumStatus); - } - - // Save since value for further requests - setSetting('latestSince', data.since); - - if (options.success) { - options.success.apply(options, Array.apply(null, arguments)); - } - }, - error: options.error - }); - } - - /** - * Delete an item identified by item id from the users list - * @param {string} itemId The id from the item we want to remove - * @param {Object | undefined} options Can provide an actionInfo object with - * further data to send to the API. Can - * have success and error callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function deleteItem(itemId, options) { - var action = { - action: "delete", - item_id: itemId - }; - return sendAction(action, options); - } - - /** - * General function to send all kinds of actions like adding of links or - * removing of items via the API - * @param {Object} action Action object - * @param {Object | undefined} options Can provide an actionInfo object - * with further data to send to the - * API. Can have success and error - * callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function sendAction(action, options) { - // Options can have an 'actionInfo' object. This actionInfo object gets - // passed through to the action object that will be send to the API endpoint - if (typeof options.actionInfo !== 'undefined') { - action = extend(action, options.actionInfo); - } - return sendActions([action], options); - } - - /** - * General function to send all kinds of actions like adding of links or - * removing of items via the API - * @param {Array} actions Array of action objects - * @param {Object | undefined} options Can have success and error callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function sendActions(actions, options) { - return apiRequest({ - path: "/send", - data: { - access_token: getAccessToken(), - actions: JSON.stringify(actions) - }, - success: options.success, - error: options.error - }); - } - - /** - * Handling Tags - */ - - /** - * Add tags to the item identified by the url. Also updates the used tags - * list - * @param {string} itemId The item identifier by item id - * @param {Array} tags Tags adding to the item - * @param {Object | undefined} options Can provide an actionInfo object with - * further data to send to the API. Can - * have success and error callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function addTagsToItem(itemId, tags, options) { - return addTags({item_id: itemId}, tags, options); - } - - /** - * Add tags to the item identified by the url. Also updates the used tags - * list - * @param {string} url The item identifier by url - * @param {Array} tags Tags adding to the item - * @param {Object} options Can provide an actionInfo object with further - * data to send to the API. Can have success and error - * callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function addTagsToURL(url, tags, options) { - return addTags({url: url}, tags, options); - } - - /** - * Helper function to execute the add tags api call. Will be used from addTagsToURL - * and addTagsToItem but not exposed outside - * @param {string} actionPart Specific action part to add to action - * @param {Array} tags Tags adding to the item - * @param {Object | undefined} options Can provide an actionInfo object with - * further data to send to the API. Can - * have success and error callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function addTags(actionPart, tags, options) { - // Tags add action - var action = { - action: "tags_add", - tags: tags - }; - action = extend(action, actionPart); - - // Backup the success callback as we need it later - var finalSuccessCallback = options.success; - - // Switch the success callback - options.success = function(data) { - - // Update used tags - var usedTagsJSON = getSetting("usedTags"); - var usedTags = usedTagsJSON ? JSON.parse(usedTagsJSON) : {}; - - // Check for each tag if it's already in the used tags - for (var i = 0; i < tags.length; i++) { - var tagToSave = tags[i].trim(); - var newUsedTagObject = { - "tag": tagToSave, - "timestamp": new Date().getTime() - }; - usedTags[tagToSave] = newUsedTagObject; - } - setSetting("usedTags", JSON.stringify(usedTags)); - - // Let the callback know that we are finished - if (finalSuccessCallback) { - finalSuccessCallback(data); - } - }; - - // Execute the action - return sendAction(action, options); - } - - /** - * Get all cached tags and used tags within the callback - * @param {function(Array, Array, Boolean)} callback - * Function with tags and used tags as parameter. - */ - function getTags(callback) { - - var tagsFromSettings = function() { - var tagsJSON = getSetting("tags"); - if (typeof tagsJSON !== "undefined") { - return JSON.parse(tagsJSON) - } - return []; - } - - var sortedUsedTagsFromSettings = function() { - // Get and Sort used tags - var usedTags = []; - - var usedTagsJSON = getSetting("usedTags"); - if (typeof usedTagsJSON !== "undefined") { - var usedTagsObject = JSON.parse(usedTagsJSON); - var usedTagsObjectArray = []; - for (var tagKey in usedTagsObject) { - usedTagsObjectArray.push(usedTagsObject[tagKey]); - } - - // Sort usedTagsObjectArray based on timestamp - usedTagsObjectArray.sort(function(usedTagA, usedTagB) { - var a = usedTagA.timestamp; - var b = usedTagB.timestamp; - return a - b; - }); - - // Get all keys tags - for (var j = 0; j < usedTagsObjectArray.length; j++) { - usedTags.push(usedTagsObjectArray[j].tag); - } - - // Reverse to set the last recent used tags to the front - usedTags.reverse(); - } - - return usedTags; - } - - if (callback) { - var tags = tagsFromSettings(); - var usedTags = sortedUsedTagsFromSettings(); - callback(tags, usedTags); - } - } - - /** - * Fetch suggested tags for a given item id - * @param {string} itemId Item id of - * @param {Object | undefined} options Can provide an actionInfo object - * with further data to send to the API. - * Can have success and error callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function getSuggestedTagsForItem(itemId, options) { - return getSuggestedTags({item_id: itemId}, options); - } - - /** - * Fetch suggested tags for a given URL - * @param {string} url (required) The item identifier by url - * @param {Object} options Can provide an actionInfo object with further - * data to send to the API. Can have success and error - * callbacks - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function getSuggestedTagsForURL(url, options) { - return getSuggestedTags({url: url}, options); - } - - /** - * Helper function to get suggested tags - * @return {Boolean} Returns Boolean whether the api call started sucessfully - */ - function getSuggestedTags(data, options) { - - data = data || {}; - options = options || {}; - - data.access_token = getAccessToken(); - - return apiRequest({ - path: "/getSuggestedTags", - data: data, - success: options.success, - error: options.error - }); - } - - /** - * Helper function to get current signup AB group the user is in - */ - function getSignupPanelTabTestVariant() { - return getMultipleTestOption('panelSignUp', {control: 1, v1: 8, v2: 1 }) - } - - function getMultipleTestOption(testName, testOptions) { - // Get the test from preferences if we've already assigned the user to a test - var settingName = 'test.' + testName; - var assignedValue = getSetting(settingName); - var valArray = []; - - // If not assigned yet, pick and store a value - if (!assignedValue) - { - // Get a weighted array of test variants from the testOptions object - Object.keys(testOptions).forEach(function(key) { - for (var i = 0; i < testOptions[key]; i++) { - valArray.push(key); - } - }); - - // Get a random test variant and set the user to it - assignedValue = valArray[Math.floor(Math.random() * valArray.length)]; - setSetting(settingName, assignedValue); - } - - return assignedValue; - - } - - /** - * Public functions - */ - return { - isUserLoggedIn : isUserLoggedIn, - clearUserData: clearUserData, - addLink: addLink, - deleteItem: deleteItem, - addTagsToItem: addTagsToItem, - addTagsToURL: addTagsToURL, - getTags: getTags, - isPremiumUser: isPremiumUser, - getSuggestedTagsForItem: getSuggestedTagsForItem, - getSuggestedTagsForURL: getSuggestedTagsForURL, - getSignupPanelTabTestVariant: getSignupPanelTabTestVariant, - }; -}()); diff --git a/browser/extensions/pocket/content/pocket-content-process.js b/browser/extensions/pocket/content/pocket-content-process.js deleted file mode 100644 index 9b158a0ed..000000000 --- a/browser/extensions/pocket/content/pocket-content-process.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/. */ -"use strict"; - -// This file is loaded as a process script, it will be loaded in the parent -// process as well as all content processes. - -const { utils: Cu } = Components; -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("chrome://pocket/content/AboutPocket.jsm"); - -function AboutPocketChildListener() { -} -AboutPocketChildListener.prototype = { - onStartup: function onStartup() { - - // Only do this in content processes since, as the broadcaster of this - // message, the parent process doesn't also receive it. We handlers - // the shutting down separately. - if (Services.appinfo.processType == - Services.appinfo.PROCESS_TYPE_CONTENT) { - - Services.cpmm.addMessageListener("PocketShuttingDown", this, true); - } - - AboutPocket.aboutSaved.register(); - AboutPocket.aboutSignup.register(); - }, - - onShutdown: function onShutdown() { - AboutPocket.aboutSignup.unregister(); - AboutPocket.aboutSaved.unregister(); - - Services.cpmm.removeMessageListener("PocketShuttingDown", this); - Cu.unload("chrome://pocket/content/AboutPocket.jsm"); - }, - - receiveMessage: function receiveMessage(message) { - switch (message.name) { - case "PocketShuttingDown": - this.onShutdown(); - break; - default: - break; - } - - return; - } -}; - -const listener = new AboutPocketChildListener(); -listener.onStartup(); diff --git a/browser/extensions/pocket/install.rdf.in b/browser/extensions/pocket/install.rdf.in deleted file mode 100644 index babccfa5a..000000000 --- a/browser/extensions/pocket/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>firefox@getpocket.com</em:id> - <em:version>1.0.5</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this theme can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>Pocket</em:name> - <em:description>When you find something you want to view later, put it in Pocket.</em:description> - </Description> -</RDF> diff --git a/browser/extensions/pocket/jar.mn b/browser/extensions/pocket/jar.mn deleted file mode 100644 index 5fab627fe..000000000 --- a/browser/extensions/pocket/jar.mn +++ /dev/null @@ -1,32 +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/. - -[features/firefox@getpocket.com] chrome.jar: -% content pocket %content/ contentaccessible=yes -% skin pocket classic/1.0 %skin/linux/ -% skin pocket classic/1.0 %skin/osx/ os=Darwin -% skin pocket classic/1.0 %skin/windows/ os=WINNT -% skin pocket-shared classic/1.0 %skin/shared/ - content/ (content/*) - skin/ (skin/*) -# windows overrides -% override chrome://pocket/skin/menuPanel.png chrome://pocket/skin/menuPanel-aero.png os=WINNT osversion=6 -% override chrome://pocket/skin/menuPanel.png chrome://pocket/skin/menuPanel-aero.png os=WINNT osversion=6.1 -% override chrome://pocket/skin/menuPanel@2x.png chrome://pocket/skin/menuPanel-aero@2x.png os=WINNT osversion=6 -% override chrome://pocket/skin/menuPanel@2x.png chrome://pocket/skin/menuPanel-aero@2x.png os=WINNT osversion=6.1 -% override chrome://pocket/skin/Toolbar@2x.png chrome://pocket/skin/Toolbar-aero@2x.png os=WINNT osversion=6 -% override chrome://pocket/skin/Toolbar@2x.png chrome://pocket/skin/Toolbar-aero@2x.png os=WINNT osversion=6.1 -% override chrome://pocket/skin/Toolbar@2x.png chrome://pocket/skin/Toolbar-win8@2x.png os=WINNT osversion=6.2 -% override chrome://pocket/skin/Toolbar@2x.png chrome://pocket/skin/Toolbar-win8@2x.png os=WINNT osversion=6.3 -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-XP.png os=WINNT osversion<6 -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-aero.png os=WINNT osversion=6 -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-aero.png os=WINNT osversion=6.1 -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-win8.png os=WINNT osversion=6.2 -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-win8.png os=WINNT osversion=6.3 -# osx overrides -% override chrome://pocket/skin/Toolbar.png chrome://pocket/skin/Toolbar-yosemite.png os=Darwin osversion>=10.10 -% override chrome://pocket/skin/Toolbar@2x.png chrome://pocket/skin/Toolbar-yosemite@2x.png os=Darwin osversion>=10.10 -% override chrome://pocket/skin/menuPanel.png chrome://pocket/skin/menuPanel-yosemite.png os=Darwin osversion>=10.10 -% override chrome://pocket/skin/menuPanel@2x.png chrome://pocket/skin/menuPanel-yosemite@2x.png os=Darwin osversion>=10.10 - diff --git a/browser/extensions/pocket/locale/ast/pocket.properties b/browser/extensions/pocket/locale/ast/pocket.properties deleted file mode 100644 index c32e53b54..000000000 --- a/browser/extensions/pocket/locale/ast/pocket.properties +++ /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/. - -addtags = Amestar etiquetes -alreadyhaveacct = ¿Yá yes un usuariu de Pocket? -continueff = Siguir con Firefox -errorgeneric = Hebo un fallu tentando de guardar en Pocket. -learnmore = Depriendi más -loginnow = Aniciar sesión -maxtaglength = Les etiquetes lléndense a 25 caráuteres -mustbeconnected = Has tar coneutáu a internet pa guardar en Pocket. Comprueba la to conexón y volvi tentalo, por favor. -onlylinkssaved = Namái puen guardase enllaces -pagenotsaved = Páxina non guardada -pageremoved = Páxina desaniciada -pagesaved = Guardóse en Pocket -processingremove = Desaniciando páxina… -processingtags = Amestando etiquetes… -removepage = Desanicia páxina -save = Guardar -saving = Guardando… -signupemail = Rexistrase con corréu -signuptosave = Rexístrate en Pocket. Ye de baldre. -suggestedtags = Etiquetes suxeríes -tagline = Guardar artículos y vídeos dende Firefox pa ver en Pocket o en cualquier preséu, en cualquier momentu. -taglinestory_one = Fai clic nel botón de Pocket pa guardar cualquier artículu, videu o páxina dende Firefox. -taglinestory_two = Ver en Pocker o en cualquier preséu, en cualquier momentu. -tagssaved = Etiquetes amestaes -tos = Sigiuiendo, tas acordies colos <a href="%1$S" target="_blank">Términos de Serviciu</a> y la <a href="%2$S" target="_blank">Política de privacidá</a> de Pocket -tryitnow = Pruébalu agora -signinfirefox = Anicia sesión con Firefox -signupfirefox = Rexístrate con Firefox -viewlist = Ver llista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar páxina en Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Guardar enllaz en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver la llista de Pocket diff --git a/browser/extensions/pocket/locale/az/pocket.properties b/browser/extensions/pocket/locale/az/pocket.properties deleted file mode 100644 index a228ca026..000000000 --- a/browser/extensions/pocket/locale/az/pocket.properties +++ /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/. - -addtags = Etiket əlavə et -alreadyhaveacct = Artıq Pocket istifadəçisisiniz? -continueff = Firefox ilə davam et -errorgeneric = Pocket-ə saxlarkən xəta baş verdi. -learnmore = Ətraflı Öyrən -loginnow = Daxil ol -maxtaglength = Etiketlər 25 simvol ilə limitlidir -mustbeconnected = Pocket-ə saxlamaq üçün internetə qoşulu olmalısınız. Lütfən internetə qoşulu olduğunuza əmin olub təkrar yoxlayın. -onlylinkssaved = Ancaq keçidlər saxlana bilər -pagenotsaved = Səhifə saxlanmadı -pageremoved = Səhifə silindi -pagesaved = Pocket-ə saxlandı -processingremove = Səhifə silinir… -processingtags = Etiketlər əlavə edilir… -removepage = Səhifəni sil -save = Saxla -saving = Saxlanır… -signupemail = E-poçt ilə qeyd ol -signuptosave = Pocket üçün qeyd ol. Bu pulsuzdur. -suggestedtags = Məsləhərli etiketlər -tagline = Firefoxdan məqalə və videoları Pocket-ə saxlayın, istədiyiniz vaxt, istədiyiniz yerdə baxın. -taglinestory_one = Firefoxda hər hansı bir məqalə, video və ya səhifəni saxlamaq üçün Pocket Düyməsinə klikləyin. -taglinestory_two = İstənilən cihazda, istənilən vaxt Pocket-də görün. -tagssaved = Etiketlər əlavə edildi -tos = Davam etməklə, Pocket-in <a href="%1$S" target="_blank">İstifadə Şərtləri</a> və <a href="%2$S" target="_blank">Məxfilik Siyasəti</a> ilə razılaşmış olursunuz -tryitnow = İndi Yoxlayın -signinfirefox = Firefox ilə daxil ol -signupfirefox = Firefox ilə qeyd ol -viewlist = Siyahını gör - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket-ə Saxla -saveToPocketCmd.label = Səhifəni Pocket-ə Saxla -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Keçidi Pocket-ə Saxla -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket Siyahısını Gör diff --git a/browser/extensions/pocket/locale/bg/pocket.properties b/browser/extensions/pocket/locale/bg/pocket.properties deleted file mode 100644 index ba86dd7f6..000000000 --- a/browser/extensions/pocket/locale/bg/pocket.properties +++ /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/. - -addtags = Добавяне на етикети -alreadyhaveacct = Вече сте потребител на Pocket? -continueff = Продължаване с Firefox -errorgeneric = Получи се грешка при опит за запис в Pocket. -learnmore = Научете повече -loginnow = Вписване -maxtaglength = Етикетите могат да са до 25 знака -mustbeconnected = Трябва да сте свързан към Интернет, за да запазвате в Pocket. Моля, проверете свързаността си с Интернет и пробвайте отново. -onlylinkssaved = Могат да бъдат запазвани само връзки -pagenotsaved = Страницата не е запазена -pageremoved = Страницата е премахната -pagesaved = Запазена в Pocket -processingremove = Премахване на страница… -processingtags = Добавяне на етикети… -removepage = Премахване на страница -save = Запазване -saving = Запазване… -signupemail = Регистриране с мейл -signuptosave = Регистрирайте се в Pocket. Безплатно е. -suggestedtags = Предложени етикети -tagline = Запазвайте статии и видеота от Firefox и можете да ги преглеждате в Pocket на всяко устройство по всяко време. -taglinestory_one = Щракнете на бутона на Pocket за запазване на статия, видео или страница от Firefox. -taglinestory_two = Преглеждайте в Pocket на всяко устройство и по всяко време. -tagssaved = Етикетите са добавени -tos = Продължавайки, вие се съгласявате с <a href="%1$S" target="_blank">Условията за ползване</a> и <a href="%2$S" target="_blank">Политиката за поверителност</a> на Pocket -tryitnow = Опитайте сега -signinfirefox = Вписване с Firefox -signupfirefox = Регистриране с Firefox -viewlist = Преглед на списъка - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Запазване в Pocket -saveToPocketCmd.label = Запазване на страницата в Pocket -saveToPocketCmd.accesskey = с -saveLinkToPocketCmd.label = Запазване на връзката в Pocket -saveLinkToPocketCmd.accesskey = в -pocketMenuitem.label = Преглед списъка на Pocket diff --git a/browser/extensions/pocket/locale/bn-BD/pocket.properties b/browser/extensions/pocket/locale/bn-BD/pocket.properties deleted file mode 100644 index 7a43edad1..000000000 --- a/browser/extensions/pocket/locale/bn-BD/pocket.properties +++ /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/. - -addtags = ট্যাগ যোগ করুন -alreadyhaveacct = আপনি Pocket ব্যবহার করছেন? -continueff = Firefox ব্যবহার চালিয়ে যান -errorgeneric = Pocket এ সংরক্ষণ করতে ত্রুটি ঘটেছে। -learnmore = আরও জানুন -loginnow = লগ ইন -maxtaglength = ট্যাগ ২৫ অক্ষরের মধ্যে সীমাবদ্ধ -mustbeconnected = Pocket এ কোন কিছু সংরক্ষণ করে রাখতে চাইলে, ইন্টারনেটে সংযুক্ত থাকতে হবে। ইন্টারনেট সংযোগ পরীক্ষা করুন এবং আবার চেষ্টা করুন। -onlylinkssaved = শুধু লিঙ্ক সংরক্ষণ করা যাবে -pagenotsaved = পাতা সংরক্ষণ করা হয়নি -pageremoved = পাতা অপসারণ করা হয়েছে -pagesaved = Pocket এ সংরক্ষিত হয়েছে -processingremove = পাতা অপসারিত হচ্ছে… -processingtags = ট্যাগ যুক্ত করা হচ্ছে… -removepage = পেজ মুছে ফেলুন -save = সংরক্ষণ -saving = সংরক্ষণ করা হচ্ছে... -signupemail = ইমেইল দিয়ে সাইন আপ করুন -signuptosave = Pocket সাইন আপ করুন। এটি মুফত। -suggestedtags = প্রস্তাবিত ট্যাগ -tagline = Pocket এর মাধ্যমে যেকোন সময়, যেকোন ডিভাইসে নিবন্ধ এবং ভিডিও দেখতে Firefox থেকে সেগুলো সংরক্ষণ করুন। -taglinestory_one = Firefox থেকে আর্টিকেল, ভিডিও বা পৃষ্ঠা সংরক্ষণ করার জন্য Pocket বাটন ক্লিক করুন। -taglinestory_two = যেকোন সময়ে, যেকোন স্থানে Pocket এ দেখুন। -tagssaved = ট্যাগ যোগ করা হয়েছে -tos = এটি অব্যহত রেখে, আপনি Pocket এর <a href="%1$S" target="_blank">সেবার শর্তাবলী</a> এবং <a href="%2$S" target="_blank">গোপনীয়তা নীতিমালায়</a> সম্মত হবেন। -tryitnow = এখনই ব্যবহার করুন -signinfirefox = ফায়ারফক্স দিয়ে সাইন ইন করুন -signupfirefox = ফায়ারফক্স দিয়ে সাইন আপ করুন -viewlist = তালিকা দেখুন - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket এ সংরক্ষণ করুন -saveToPocketCmd.label = Pocket এ পাতাটি সংরক্ষণ করুন k -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Pocket এ লিঙ্কটি সংরক্ষণ করুন o -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket তালিকা দেখুন diff --git a/browser/extensions/pocket/locale/cs/pocket.properties b/browser/extensions/pocket/locale/cs/pocket.properties deleted file mode 100644 index 619b0a01a..000000000 --- a/browser/extensions/pocket/locale/cs/pocket.properties +++ /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/. - -addtags = Přidat štítky -alreadyhaveacct = Jste již uživatel služby Pocket? -continueff = Pokračovat pomocí Firefoxu -errorgeneric = Při pokusu o uložení do služby Pocket došlo k chybě. -learnmore = Zjistit více -loginnow = Přihlásit se -maxtaglength = Štítky jsou omezeny na 25 znaků -mustbeconnected = Abyste mohli ukládat do služby Pocket, musíte být připojeni k internetu. Zkontrolujte prosím své připojení a zkuste to znovu. -onlylinkssaved = Pouze odkazy mohou být uloženy -pagenotsaved = Stránka nebyla uložena -pageremoved = Stránka byla odstraněna -pagesaved = Uloženo do služby Pocket -processingremove = Odstraňování stránky… -processingtags = Přidávání štítků… -removepage = Odstranit stránku -save = Uložit -saving = Ukládání… -signupemail = Registrace e-mailem -signuptosave = Registrujte se do služby Pocket. Je to zdarma. -suggestedtags = Doporučené štítky -tagline = Ukládejte si články a videa z Firefoxu pro zobrazení ve službě Pocket kdykoliv a na jakémkoli zařízení. -taglinestory_one = Klepněte na tlačítko služby Pocket pro uložení jakéhokoliv článku, videa nebo stránky přímo z Firefoxu. -taglinestory_two = Zobrazení ve službě Pocket kdykoliv a na jakémkoliv zařízení. -tagssaved = Štítky přidány -tos = Pokračování souhlasíte s <a href="%1$S" target="_blank">Podmínkami služby</a> Pocket a <a href="%2$S" target="_blank">Zásadami ochrany osobních údajů</a> -tryitnow = Vyzkoušejte nyní -signinfirefox = Přihlášení ve Firefoxu -signupfirefox = Registrace ve Firefoxu -viewlist = Zobrazit seznam - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Uloží do služby Pocket -saveToPocketCmd.label = Uložit stránku do služby Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Uložit odkaz do služby Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Zobrazit seznam služby Pocket diff --git a/browser/extensions/pocket/locale/da/pocket.properties b/browser/extensions/pocket/locale/da/pocket.properties deleted file mode 100644 index 5e5438359..000000000 --- a/browser/extensions/pocket/locale/da/pocket.properties +++ /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/. - -addtags = Tilføj tags -alreadyhaveacct = Er du allerede Pocket-bruger? -continueff = Fortsæt med Firefox -errorgeneric = Der opstod en fejl ved forsøg på at gemme til Pocket. -learnmore = Læs mere -loginnow = Log ind -maxtaglength = Tags er begrænset til 25 tegn -mustbeconnected = Du skal have forbindelse til internettet for at kunne gemme til Pocket. Kontroller din internetforbindelse og prøv igen. -onlylinkssaved = Kun links kan gemmes -pagenotsaved = Siden blev ikke gemt -pageremoved = Siden er fjernet -pagesaved = Gemt til Pocket -processingremove = Fjerner side… -processingtags = Tilføjer tags… -removepage = Fjern side -save = Gem -saving = Gemmer… -signupemail = Log ind med mailadresse -signuptosave = Meld dig til Pocket. Det er gratis. -suggestedtags = Foreslåede tags -tagline = Gemmer artikler og videoer fra Firefox i Pocket, så du senere kan se dem hvor og hvornår, du har lyst. -taglinestory_one = Klik på knappen Pocket for at gemme en artikel, video eller webside fra Firefox. -taglinestory_two = Se i Pocket hvor og hvornår, du har lyst. -tagssaved = Tags tilføjet -tos = Fortsætter du, accepterer du Pockets <a href="%1$S" target="_blank">tjenestevilkår</a> og <a href="%2$S" target="_blank">privatlivspolitik</a> -tryitnow = Prøv det nu -signinfirefox = Log ind med Firefox -signupfirefox = Meld dig til med Firefox -viewlist = Vis liste - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Gem til Pocket -saveToPocketCmd.label = Gem siden til Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Gem link til Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Vis Pocket-liste diff --git a/browser/extensions/pocket/locale/de/pocket.properties b/browser/extensions/pocket/locale/de/pocket.properties deleted file mode 100644 index f02f5da05..000000000 --- a/browser/extensions/pocket/locale/de/pocket.properties +++ /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/. - -addtags = Tags hinzufügen -alreadyhaveacct = Sind Sie bereits Pocket-Nutzer? -continueff = Mit Firefox fortfahren -errorgeneric = Beim Speichern des Links bei Pocket ist ein Fehler aufgetreten. -learnmore = Mehr erfahren -loginnow = Anmelden -maxtaglength = Tags dürfen höchsten 25 Zeichen lang sein. -mustbeconnected = Bitte überprüfen Sie, ob Sie mit dem Internet verbunden sind. -onlylinkssaved = Es können nur Links gespeichert werden -pagenotsaved = Seite nicht gespeichert -pageremoved = Seite entfernt -pagesaved = Bei Pocket gespeichert -processingremove = Seite wird entfernt… -processingtags = Tags werden hinzugefügt… -removepage = Seite entfernen -save = Speichern -saving = Speichern… -signupemail = Mit E-Mail registrieren -signuptosave = Registrieren Sie sich bei Pocket. Das ist kostenlos. -suggestedtags = Vorgeschlagene Tags -tagline = Speichern Sie Artikel und Videos aus Firefox bei Pocket, um sie jederzeit und auf jedem Gerät ansehen zu können. -taglinestory_one = Klicken Sie auf die Pocket-Schaltfläche, um beliebige Artikel, Videos und Seiten aus Firefox zu speichern. -taglinestory_two = Lesen Sie diese mit Pocket, jederzeit und auf jedem Gerät. -tagssaved = Tags hinzugefügt -tos = Indem Sie fortfahren, akzeptieren Sie die <a href="%1$S" target="_blank">Nutzungsbedingungen</a> und die <a href="%2$S" target="_blank">Datenschutzerklärung</a> von Pocket. -tryitnow = Jetzt ausprobieren -signinfirefox = Mit Firefox anmelden -signupfirefox = Mit Firefox registrieren -viewlist = Liste anzeigen - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Bei Pocket speichern -saveToPocketCmd.label = Seite bei Pocket speichern -saveToPocketCmd.accesskey = b -saveLinkToPocketCmd.label = Link bei Pocket speichern -saveLinkToPocketCmd.accesskey = c -pocketMenuitem.label = Pocket-Liste anzeigen diff --git a/browser/extensions/pocket/locale/dsb/pocket.properties b/browser/extensions/pocket/locale/dsb/pocket.properties deleted file mode 100644 index a878de329..000000000 --- a/browser/extensions/pocket/locale/dsb/pocket.properties +++ /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/. - -addtags = Wobznamjenja pśidaś -alreadyhaveacct = Sćo južo wužywaŕ Pocket? -continueff = Z Firefox pókšacowaś -errorgeneric = Pśi składowanju do Pocket jo zmólka nastała. -learnmore = Dalšne informacije -loginnow = Pśizjawiś -maxtaglength = Wobznamjenja su na 25 znamuškow wobgranicowane -mustbeconnected = Musyśo z internetom zwězany byś, aby do Pocket składował. Pšosym pśeglědajśo swój zwisk a wopytajśo hyšći raz. -onlylinkssaved = Jano wótkaze daju se składowaś -pagenotsaved = Bok njejo se składł -pageremoved = Bok jo se wótwónoźeł -pagesaved = Do Pocket skłaźony -processingremove = Bok se wótwónoźujo… -processingtags = Wobznamjenja se pśidawaju… -removepage = Bok wótwónoźeś -save = Składowaś -saving = Składujo se… -signupemail = Registrěrujśo se z mejlku -signuptosave = Registrěrujśo se za Pocket. Jo dermo. -suggestedtags = Naraźone wobznamjenja -tagline = Składujśo nastawki a wideo z Firefox, aby se je kuždy cas w Pocket na kuždem rěźe woglědał. -taglinestory_one = Klikniśo na tłocašk Pocket, aby nastawk, wideo abo bok z Firefox składował. -taglinestory_two = Se w Pocket na kuždem rěźee kuždy cas woglědaś. -tagssaved = Wobznamjenja su se pśidali -tos = Gaž pókšacujośo, zwólijośo do <a href="%1$S" target="_blank">wužywarskich wuměnjenjow</a> a <a href="%2$S" target="_blank">pšawidłow priwatnosći</a> Pocket -tryitnow = Wopytajśo to něnto -signinfirefox = Z Firefox pśizjawiś -signupfirefox = Z Firefox registrěrowaś -viewlist = Lisćinu pokazaś - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Do Pocket składowaś -saveToPocketCmd.label = Bok do Pocket składowaś -saveToPocketCmd.accesskey = b -saveLinkToPocketCmd.label = Wótkaz do Pocket składowaś -saveLinkToPocketCmd.accesskey = w -pocketMenuitem.label = Lisćinu Pocket pokazaś diff --git a/browser/extensions/pocket/locale/en-GB/pocket.properties b/browser/extensions/pocket/locale/en-GB/pocket.properties deleted file mode 100644 index bddd825c5..000000000 --- a/browser/extensions/pocket/locale/en-GB/pocket.properties +++ /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/. - -addtags = Add Tags -alreadyhaveacct = Already a Pocket user? -continueff = Continue with Firefox -errorgeneric = There was an error when trying to save to Pocket. -learnmore = Learn More -loginnow = Log in -maxtaglength = Tags are limited to 25 characters -mustbeconnected = You must be connected to the Internet in order to save to Pocket. Please check your connection and try again. -onlylinkssaved = Only links can be saved -pagenotsaved = Page Not Saved -pageremoved = Page Removed -pagesaved = Saved to Pocket -processingremove = Removing Page… -processingtags = Adding tags… -removepage = Remove Page -save = Save -saving = Saving… -signupemail = Sign up with email -signuptosave = Sign up for Pocket. It’s free. -suggestedtags = Suggested Tags -tagline = Save articles and videos from Firefox to view in Pocket on any device, any time. -taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox. -taglinestory_two = View in Pocket on any device, any time. -tagssaved = Tags Added -tos = By continuing, you agree to Pocket’s <a href="%1$S" target="_blank">Terms of Service</a> and <a href="%2$S" target="_blank">Privacy Policy</a> -tryitnow = Try It Now -signinfirefox = Sign in with Firefox -signupfirefox = Sign up with Firefox -viewlist = View List - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Save to Pocket -saveToPocketCmd.label = Save Page to Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Save Link to Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = View Pocket List diff --git a/browser/extensions/pocket/locale/en-US/pocket.properties b/browser/extensions/pocket/locale/en-US/pocket.properties deleted file mode 100644 index dee2681dc..000000000 --- a/browser/extensions/pocket/locale/en-US/pocket.properties +++ /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/. - -addtags = Add Tags -alreadyhaveacct = Already a Pocket user? -continueff = Continue with Firefox -errorgeneric = There was an error when trying to save to Pocket. -learnmore = Learn More -loginnow = Log in -maxtaglength = Tags are limited to 25 characters -mustbeconnected = You must be connected to the Internet in order to save to Pocket. Please check your connection and try again. -onlylinkssaved = Only links can be saved -pagenotsaved = Page Not Saved -pageremoved = Page Removed -pagesaved = Saved to Pocket -processingremove = Removing Page… -processingtags = Adding tags… -removepage = Remove Page -save = Save -saving = Saving… -signupemail = Sign up with email -signuptosave = Sign up for Pocket. It’s free. -suggestedtags = Suggested Tags -tagline = Save articles and videos from Firefox to view in Pocket on any device, any time. -taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox. -taglinestory_two = View in Pocket on any device, any time. -tagssaved = Tags Added -tos = By continuing, you agree to Pocket's <a href="%1$S" target="_blank">Terms of Service</a> and <a href="%2$S" target="_blank">Privacy Policy</a> -tryitnow = Try It Now -signinfirefox = Sign in with Firefox -signupfirefox = Sign up with Firefox -viewlist = View List - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Save to Pocket -saveToPocketCmd.label = Save Page to Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Save Link to Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = View Pocket List diff --git a/browser/extensions/pocket/locale/es-AR/pocket.properties b/browser/extensions/pocket/locale/es-AR/pocket.properties deleted file mode 100644 index 2782d3ccf..000000000 --- a/browser/extensions/pocket/locale/es-AR/pocket.properties +++ /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/. - -addtags = Agregar etiquetas -alreadyhaveacct = ¿Ya es un usuario de Pocket? -continueff = Continuar con Firefox -errorgeneric = Hubo un error al tratar de guardar en Pocket. -learnmore = Conocer más -loginnow = Ingresar -maxtaglength = Las etiquetas están limitadas a 25 caracteres -mustbeconnected = Debe estar conectado a Internet para poder guardar en Pocket. Verifique la conexión e intente nuevamente. -onlylinkssaved = Solamente pueden guardarle enlaces -pagenotsaved = Página no guardada -pageremoved = Página eliminada -pagesaved = Guardado en Pocket -processingremove = Eliminando página… -processingtags = Agregando etiquetas… -removepage = Eliminar página -save = Guardar -saving = Guardando… -signupemail = Ingresar con correo electrónico -signuptosave = Registrarse en Pocket. En grátis. -suggestedtags = Etiquetas sugeridas -tagline = Guardar artículos y videos desde Firefox para ver en Pocket en cualquier dispositivo en cualquier momento. -taglinestory_one = Clic en el botón Pocket para guardar cualquier artículo, video o página desde Firefox. -taglinestory_two = Ver en Pocket en cualquier dispositivo en cualquier momento. -tagssaved = Etiquetas agregadas -tos = Al continuar acepta los <a href="%1$S" target="_blank">términos de servicio</a> y la <a href="%2$S" target="_blank">política de privacidad</a> de Pocket -tryitnow = Probalo ahora -signinfirefox = Ingresar con Firefox -signupfirefox = Registrarse con Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar página en Pocket -saveToPocketCmd.accesskey = G -saveLinkToPocketCmd.label = Guardar enlace en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver lista de Pocket diff --git a/browser/extensions/pocket/locale/es-CL/pocket.properties b/browser/extensions/pocket/locale/es-CL/pocket.properties deleted file mode 100644 index 7a4e6872b..000000000 --- a/browser/extensions/pocket/locale/es-CL/pocket.properties +++ /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/. - -addtags = Añadir etiquetas -alreadyhaveacct = ¿Ya eres usuario de Pocket? -continueff = Continuar con Firefox -errorgeneric = Hubo un error al intentar guardarla en Pocket. -learnmore = Aprender más -loginnow = Conectarse -maxtaglength = Las etiquetas están limitadas a 25 caracteres -mustbeconnected = Debes estar conectado a Internet para guardar en Pocket. Por favor, revisa tu conexión y vuelve a intentarlo. -onlylinkssaved = Solo se pueden guardar enlaces -pagenotsaved = Página no guardada -pageremoved = Página eliminada -pagesaved = Guardada en Pocket -processingremove = Eliminando página… -processingtags = Añadiendo etiquetas… -removepage = Eliminar página -save = Guardar -saving = Guardando… -signupemail = Registrarse usando un email -signuptosave = Registrarse en Pocket. Es gratis. -suggestedtags = Etiquetas sugeridas -tagline = Guarda artículos y videos desde Firefox para verlos en Pocket en cualquier dispositivo y momento. -taglinestory_one = Aprieta el botón Pocket para guardar cualquier artículo, video o página de Firefox. -taglinestory_two = Mírala en Pocket en cualquier dispositivo y momento -tagssaved = Etiquetas añadidas -tos = Al continuar, aceptas los <a href="%1$S" target="_blank">Términos del servicio</a> y la <a href="%2$S" target="_blank">Política de privacidad</a> de Pocket. -tryitnow = Probarlo ahora -signinfirefox = Conectarse con Firefox -signupfirefox = Registrarse con Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar página en Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Guardar enlace en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver lista de Pocket diff --git a/browser/extensions/pocket/locale/es-ES/pocket.properties b/browser/extensions/pocket/locale/es-ES/pocket.properties deleted file mode 100644 index f10a20525..000000000 --- a/browser/extensions/pocket/locale/es-ES/pocket.properties +++ /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/. - -addtags = Añadir etiquetas -alreadyhaveacct = ¿Ya es usuario de Pocket? -continueff = Continuar con Firefox -errorgeneric = Ha sucedido un error al intentar guardar en Pocket. -learnmore = Más información -loginnow = Iniciar sesión -maxtaglength = Las etiquetas están limitadas a 25 caracteres -mustbeconnected = Debe estar conectado a Internet para poder guardar en Pocket. Compruebe su conexión y vuelva a intentarlo. -onlylinkssaved = Solo se pueden guardar enlaces -pagenotsaved = Página no guardada -pageremoved = Página eliminada -pagesaved = Guardado en Pocket -processingremove = Eliminando página… -processingtags = Añadiendo etiquetas… -removepage = Eliminar página -save = Guardar -saving = Guardando… -signupemail = Regístrese con su dirección de correo -signuptosave = Regístrese en Pocket. Es gratis. -suggestedtags = Etiquetas sugeridas -tagline = Guarde artículos y vídeos desde Firefox para verlos en Pocket en cualquier dispositivo, en cualquier momento. -taglinestory_one = Pulse el botón Pocket para guardar cualquier artículo, vídeo o página desde Firefox. -taglinestory_two = Véalo en Pocket en cualquier dispositivo, en cualquier momento. -tagssaved = Etiquetas añadidas -tos = Al continuar, aceptas los <a href="%1$S" target="_blank">Términos del servicio</a> y la <a href="%2$S" target="_blank">Política de privacidad</a> de Pocket -tryitnow = Pruébalo ahora -signinfirefox = Iniciar sesión con Firefox -signupfirefox = Registrarse con Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar página en Pocket -saveToPocketCmd.accesskey = G -saveLinkToPocketCmd.label = Guardar enlace en Pocket -saveLinkToPocketCmd.accesskey = P -pocketMenuitem.label = Ver la lista de Pocket diff --git a/browser/extensions/pocket/locale/es-MX/pocket.properties b/browser/extensions/pocket/locale/es-MX/pocket.properties deleted file mode 100644 index 4d2bb9c4f..000000000 --- a/browser/extensions/pocket/locale/es-MX/pocket.properties +++ /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/. - -addtags = Agregar Etiquetas -alreadyhaveacct = ¿Ya eres usuario de Pocket? -continueff = Continúa con Firefox -errorgeneric = Hubo un error cuando se intentaba guardar en Pocket. -learnmore = Aprende más -loginnow = Ingresar -maxtaglength = Las etiquetas están limitadas a 25 caracteres -mustbeconnected = Debes estar conectado a Internet para guardar en Pocket. Por favor, revisa tu conexión e intenta de nuevo. -onlylinkssaved = Sólo los enlaces pueden guardarse -pagenotsaved = Página no guardada -pageremoved = Página eliminada -pagesaved = Guardado en Pocket -processingremove = Eliminando página… -processingtags = Agregando etiquetas… -removepage = Eliminar página -save = Guardar -saving = Guardando… -signupemail = Regístrate con un correo electrónico -signuptosave = Regístrate en Pocket. Es gratis. -suggestedtags = Etiquetas sugeridas -tagline = Guardar artículos y videos desde Firefox para ver en Pocket o en cualquier dispositivo, en cualquier momento. -taglinestory_one = Haz clic en el botón de Pocket para guardar cualquier artículo, video o página desde Firefox. -taglinestory_two = Ver en Pocker o en cualquier dispositivo, en cualquier momento. -tagssaved = Etiquetas agregadas -tos = Al continuar, aceptas los <a href="%1$S" target="_blank">Términos del servicio</a> y la <a href="%2$S" target="_blank">Política de privacidad</a> de Pocket -tryitnow = Pruébalo ahora -signinfirefox = Ingresa con Firefox -signupfirefox = Regístrate con Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar en Pocket -saveToPocketCmd.label = Guardar página en Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Guardar enlace en Pocket -saveLinkToPocketCmd.accesskey = n -pocketMenuitem.label = Ver la lista de Pocket diff --git a/browser/extensions/pocket/locale/et/pocket.properties b/browser/extensions/pocket/locale/et/pocket.properties deleted file mode 100644 index 5f2d68f9c..000000000 --- a/browser/extensions/pocket/locale/et/pocket.properties +++ /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/. - -addtags = Lisa silte -alreadyhaveacct = Kas oled juba Pocketi kasutaja? -continueff = Jätka Firefoxiga -errorgeneric = Pocketisse salvestamisel esines viga. -learnmore = Rohkem teavet -loginnow = Logi sisse -maxtaglength = Siltide pikkus võib olla kuni 25 tähemärki -mustbeconnected = Pocketisse salvestamiseks on vajalik töötav internetiühendus. Palun kontrolli oma ühendust ja proovi uuesti. -onlylinkssaved = Salvestada saab ainult linke -pagenotsaved = Lehte ei salvestatud -pageremoved = Leht eemaldati -pagesaved = Pocketisse salvestatud -processingremove = Lehe eemaldamine… -processingtags = Siltide lisamine… -removepage = Eemalda leht -save = Salvesta -saving = Salvestamine… -signupemail = Registreeru e-posti teel -signuptosave = Liitu Pocketiga. See on tasuta. -suggestedtags = Soovitatud sildid -tagline = Salvesta Firefoxist artikleid ja videoid, et vaadata neid Pocketist kõigil seadmeil just siis, kui ise soovid. -taglinestory_one = Artikli, video või lehe salvestamiseks klõpsa Pocketi nupul. -taglinestory_two = Vaata Pocketist kõigil seadmeil just siis, kui ise soovid. -tagssaved = Sildid on lisatud -tos = Jätkates nõustud Pocket'i <a href="%1$S" target="_blank">kasutustingimuste</a> ja <a href="%2$S" target="_blank">privaatsuspoliitikaga</a>. -tryitnow = Proovi kohe -signinfirefox = Logi sisse Firefoxiga -signupfirefox = Registreeru Firefoxiga -viewlist = Vaata nimekirja - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Salvesta Pocketisse -saveToPocketCmd.label = Salvesta leht Pocketisse -saveToPocketCmd.accesskey = l -saveLinkToPocketCmd.label = Salvesta link Pocketisse -saveLinkToPocketCmd.accesskey = i -pocketMenuitem.label = Vaata Pocketi nimekirja diff --git a/browser/extensions/pocket/locale/fi/pocket.properties b/browser/extensions/pocket/locale/fi/pocket.properties deleted file mode 100644 index 3cd47e891..000000000 --- a/browser/extensions/pocket/locale/fi/pocket.properties +++ /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/. - -addtags = Lisää tunnisteita -alreadyhaveacct = Oletko jo Pocket-palvelun käyttäjä? -continueff = Jatka Firefoxin parissa -errorgeneric = Tapahtui virhe tallennettaessa Pocket-palveluun. -learnmore = Lue lisää -loginnow = Kirjaudu sisään -maxtaglength = Tunnisteet voivat olla enintään 25 merkkiä pitkiä -mustbeconnected = Tarvitset aktiivisen Internet-yhteyden talllentaaksesi sivuja Pocket-palveluun. Tarkista Internet-yhteytesi ja yritä uudestaan. -onlylinkssaved = Vain linkkejä voidaan tallentaa -pagenotsaved = Sivua ei ole tallennettu -pageremoved = Sivu poistettiin -pagesaved = Tallennettiin Pocket-palveluun -processingremove = Poistetaan sivu… -processingtags = Lisätään tunnisteet… -removepage = Poista sivu -save = Tallenna -saving = Tallennetaan… -signupemail = Rekisteröidy sähköpostiosoitteella -signuptosave = Rekisteröidy Pocket-palveluun. Se on ilmaista. -suggestedtags = Ehdotetut tunnisteet -tagline = Tallenna artikkelit ja videot Firefoxista Pocket-palveluun katseltaviksi millä tahansa laitteella, koska tahansa. -taglinestory_one = Napsauta Pocket-painiketta tallentaaksesi artikkelin, videon tai sivun Firefoxissa. -taglinestory_two = Katsele Pocket-palvelussa millä tahansa laitteella, koska tahansa. -tagssaved = Tunnisteet lisättiin -tos = Jatkamalla hyväksyt Pocketin <a href="%1$S" target="_blank">käyttöehdot</a> ja <a href="%2$S" target="_blank">tietosuojakäytännön</a> -tryitnow = Kokeile nyt -signinfirefox = Kirjaudu sisään Firefox-tilillä -signupfirefox = Rekisteröidy Firefox-tilillä -viewlist = Näytä lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Tallenna Pocket-palveluun -saveToPocketCmd.label = Tallenna sivu Pocket-palveluun -saveToPocketCmd.accesskey = c -saveLinkToPocketCmd.label = Tallenna linkki Pocket-palveluun -saveLinkToPocketCmd.accesskey = k -pocketMenuitem.label = Näytä Pocket-palvelun lista diff --git a/browser/extensions/pocket/locale/fr/pocket.properties b/browser/extensions/pocket/locale/fr/pocket.properties deleted file mode 100644 index cb9b0ca8f..000000000 --- a/browser/extensions/pocket/locale/fr/pocket.properties +++ /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/. - -addtags = Ajouter des étiquettes -alreadyhaveacct = Vous utilisez déjà Pocket ? -continueff = Continuer avec Firefox -errorgeneric = Une erreur s’est produite lors de l’enregistrement dans Pocket. -learnmore = En savoir plus -loginnow = Connectez-vous -maxtaglength = Les étiquettes sont limitées à 25 caractères -mustbeconnected = Vous devez être connecté à Internet pour enregistrer des liens dans Pocket. Veuillez vérifier votre connexion puis réessayer. -onlylinkssaved = Seuls les liens peuvent être enregistrés -pagenotsaved = Page non enregistrée -pageremoved = Page supprimée -pagesaved = Page enregistrée dans Pocket -processingremove = Suppression de la page… -processingtags = Ajout des étiquettes… -removepage = Supprimer la page -save = Enregistrer -saving = Enregistrement… -signupemail = S’inscrire avec une adresse électronique -signuptosave = Inscrivez-vous à Pocket, c’est gratuit. -suggestedtags = Étiquettes suggérées -tagline = Enregistrez des articles et des vidéos depuis Firefox pour les visualiser dans Pocket sur n’importe quel appareil, à tout moment. -taglinestory_one = Cliquez sur le bouton Pocket pour enregistrer depuis Firefox n’importe quel article, vidéo ou page. -taglinestory_two = Affichez vos pages dans Pocket sur n’importe quel appareil, à tout moment. -tagssaved = Étiquettes ajoutées -tos = En continuant, vous acceptez les <a href="%1$S" target="_blank">conditions d’utilisation</a> et la <a href="%2$S" target="_blank">politique de confidentialité</a> de Pocket -tryitnow = Essayer -signinfirefox = Connexion via Firefox -signupfirefox = S’inscrire avec Firefox -viewlist = Afficher la liste - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Enregistrer dans Pocket -saveToPocketCmd.label = Enregistrer la page dans Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Enregistrer le lien dans Pocket -saveLinkToPocketCmd.accesskey = k -pocketMenuitem.label = Afficher la liste Pocket diff --git a/browser/extensions/pocket/locale/fy-NL/pocket.properties b/browser/extensions/pocket/locale/fy-NL/pocket.properties deleted file mode 100644 index 5b41c652f..000000000 --- a/browser/extensions/pocket/locale/fy-NL/pocket.properties +++ /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/. - -addtags = Labels tafoegje -alreadyhaveacct = Al in Pocket-brûker? -continueff = Trochgean mei Firefox -errorgeneric = Der is in flater bard by it bewarjen nei Pocket. -learnmore = Mear ynfo -loginnow = Meld jo oan -maxtaglength = Labels binne beheint ta 25 tekens -mustbeconnected = Jo moatte mei it ynternet ferbûn wêze om nei Pocket bewarje te kinnen. Kontrolearje jo ferbining en probearje it opnij. -onlylinkssaved = Allinnich keppelingen kinne bewarre wurde -pagenotsaved = Side net bewarre -pageremoved = Side fuortsmiten -pagesaved = Bewarre nei Pocket -processingremove = Side fuortsmite… -processingtags = Labels tafoegje… -removepage = Side fuortsmite -save = Bewarje -saving = Bewarje… -signupemail = Registrearje mei e-mailadres -signuptosave = Registrearje foar Pocket. It is fergees. -suggestedtags = Foarstelde labels -tagline = Bewarje artikelen en fideo’s fan Firefox út foar werjaan yn Pocket op ferskate apparaten, wannear dan ek. -taglinestory_one = Klik op de Pocket-knop om artikelen, fideo’s of siden fan Firefox út te bewarjen. -taglinestory_two = Besjoch se op ferskate apparaten, wannear dan ek. -tagssaved = Labels tafoege -tos = Troch fierder te gean, geane jo akkoard mei de <a href="%1$S" target="_blank">Tsjinstbetingsten</a> en it <a href="%2$S" target="_blank">Privacybelied</a> fan Pocket -tryitnow = No probearje -signinfirefox = Oanmelde mei Firefox -signupfirefox = Registrearje mei Firefox -viewlist = List werjaan - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Bewarje nei Pocket -saveToPocketCmd.label = Side bewarje nei Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Keppeling bewarje nei Pocket -saveLinkToPocketCmd.accesskey = e -pocketMenuitem.label = Pocket-list werjaan diff --git a/browser/extensions/pocket/locale/gu-IN/pocket.properties b/browser/extensions/pocket/locale/gu-IN/pocket.properties deleted file mode 100644 index 2261ff5b4..000000000 --- a/browser/extensions/pocket/locale/gu-IN/pocket.properties +++ /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/. - -addtags = ટૅગ્સ ઉમેરો -alreadyhaveacct = પહેલેથી જ એક પોકેટ વપરાશકર્તા છો? -continueff = ફાયરફોક્સ સાથે ચાલુ રાખો -errorgeneric = પોકેટ સાચવી રાખવા માટે પ્રયાસ હતો ત્યારે એક ભૂલ હતી. -learnmore = વધુ શીખો -loginnow = પ્રવેશ કરો -maxtaglength = ટૅગ્સ 25 અક્ષરો સુધી મર્યાદિત છે -mustbeconnected = તમે પોકેટ પર સેવ કરવા માટે ઇન્ટરનેટ સાથે જોડાયેલ હોવા જ જોઈએ. કૃપા કરીને તમારા જોડાણ તપાસ કરો અને ફરીથી પ્રયત્ન કરો. -onlylinkssaved = માત્ર લિંક્સ સાચવી શકાય છે -pagenotsaved = પૃષ્ઠ સાચવેલા નથી -pageremoved = પૃષ્ઠ દૂર -pagesaved = પોકેટ પર સાચવ્યું -processingremove = પૃષ્ઠ દૂર કરી રહ્યા છીએ… -processingtags = ટૅગ્સ ઉમેરી રહ્યું છે… -removepage = પૃષ્ઠ દૂર -save = સાચવો -saving = સાચવી રહ્યું છે… -signupemail = ઇમેઇલ સાથે સાઇનઅપ -signuptosave = પોકેટ માટે સાઇન અપ કરો. તે મફત છે. -suggestedtags = સૂચવેલ ટૅગ્સ -tagline = કોઈપણ ઉપકરણ, કોઈ પણ સમય પર પોકેટ માં જોવા માટે ફાયરફોક્સ ના લેખો અને વીડિયો સાચવો. -taglinestory_one = ફાયરફોક્સ એક લેખ, વિડિઓ અથવા પાનું સેવ કરવા પોકેટ બટન પર ક્લિક કરો. -taglinestory_two = કોઈપણ ઉપકરણ, કોઈ પણ સમય પર પોકેટ માં જુઓ. -tagssaved = ટૅગ્સ ઉમેર્યું -tos = ચાલુ કરવાથી, તમે પોકેટ માટેની <a href="%1$S" target="_blank">સેવાની શરતો</a> અને <a href="%2$S" target="_blank">ગોપનીયતા નીતિ</a>સંમત થશો -tryitnow = અત્યારે પ્રયાસ કરો -signinfirefox = ફાયરફોક્સ સાથે ચાલુ રાખો -signupfirefox = ફાયરફોક્સ સાથે સાઇન અપ કરો -viewlist = યાદી જુઓ - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = પોકેટ -pocket-button.tooltiptext = પોકેટ પર સાચવો -saveToPocketCmd.label = પોકેટ પર પૃષ્ઠ સાચવો -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = પોકેટ પર લિંક સાચવો -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = જુઓ પોકેટની યાદી diff --git a/browser/extensions/pocket/locale/hr/pocket.properties b/browser/extensions/pocket/locale/hr/pocket.properties deleted file mode 100644 index 3b723499f..000000000 --- a/browser/extensions/pocket/locale/hr/pocket.properties +++ /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/. - -addtags = Dodaj oznake -alreadyhaveacct = Postojeći ste Pocket korisnik? -continueff = Nastavite s Firefoxom -errorgeneric = Došlo je do greške pri snimanju u Pocket. -learnmore = Saznajte više -loginnow = Prijava -maxtaglength = Oznake su ograničene na 25 znakova -mustbeconnected = Morate biti povezani na Internet da bi ste mogli snimiti u Pocket. Molimo vas da provjerite vašu vezu i pokušate ponovno. -onlylinkssaved = Mogu se spremiti samo poveznice -pagenotsaved = Stranica nije spremljena -pageremoved = Stranica uklonjena -pagesaved = Spremljeno u Pocket -processingremove = Uklanjanje stranice… -processingtags = Dodavanje oznaka… -removepage = Ukloni stranicu -save = Spremi -saving = Spremanje… -signupemail = Registracija s e-poštom -signuptosave = Registrirajte se na Pocket. Besplatno je. -suggestedtags = Predložene oznake -tagline = Spremite članke, video snimke iz Firefoxa za prikaz u Pocketu, na bilo kojem uređaju, bilo kada. -taglinestory_one = Kliknite na Pocket tipku da biste snimili bilo koji članak, video ili stranicu iz Firefoxa. -taglinestory_two = Pregledajte u Pocketu na bilo kojem uređaju, bilo kada. -tagssaved = Oznake dodane -tos = Nastavljajući, prihvaćate Pocket <a href="%1$S" target="_blank">Uvjete pružanja usluge</a> i <a href="%2$S" target="_blank">Izjavu o privatnosti</a> -tryitnow = Isprobajte odmah -signinfirefox = Prijava s Firefoxom -signupfirefox = Registracija s Firefoxom -viewlist = Prikaži popis - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Spremi u Pocket -saveToPocketCmd.label = Spremi stranicu u Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Spremi poveznicu u Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Prikaži Pocket popis diff --git a/browser/extensions/pocket/locale/hsb/pocket.properties b/browser/extensions/pocket/locale/hsb/pocket.properties deleted file mode 100644 index a5f5583e7..000000000 --- a/browser/extensions/pocket/locale/hsb/pocket.properties +++ /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/. - -addtags = Znački přidać -alreadyhaveacct = Sće hižo wužiwar Pocket? -continueff = Z Firefox pokročować -errorgeneric = Při składowanju do Pocket je zmylk wustupił. -learnmore = Dalše informacije -loginnow = Přizjewić -maxtaglength = Znački su na 25 znamješkow wobmjezowane -mustbeconnected = Dyrbiće z internetom zwjazany być, zo byšće do Pocket składował. Prošu přepruwujće swój zwisk a spytajće hišće raz. -onlylinkssaved = Jenož wotkazy dadźa so składować -pagenotsaved = Strona njeje so składowała -pageremoved = Strona je so wotstroniła -pagesaved = Do Pocket składowany -processingremove = Strona so wotstronja… -processingtags = Znački so přidawaja… -removepage = Stronu wotstronić -save = Składować -saving = Składuje so… -signupemail = Registrujće so z e-mejlku -signuptosave = Registrujće so za Pocket. Je darmo. -suggestedtags = Namjetowane znački -tagline = Składujće nastawki a wideja z Firefox, zo byšće sej je kóždy čas w Pocket na kóždym graće wobhladał. -taglinestory_one = Klikńće na tłóčatko Pocket, zo byšće nastawk, widejo abo stronu z Firefox składował. -taglinestory_two = Sej w Pocket na kóždym graće kóždy čas wobhladać. -tagssaved = Znački su so přidali -tos = Hdyž pokročujeće, zwoliće do <a href="%1$S" target="_blank">wužiwarskich wuměnjenjow</a> a <a href="%2$S" target="_blank">prawidłow priwatnosće</a> Pocket -tryitnow = Spytajće to nětko -signinfirefox = Z Firefox přizjewić -signupfirefox = Z Firefox registrować -viewlist = Lisćinu pokazać - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Do Pocket składować -saveToPocketCmd.label = Stronu do Pocket składować -saveToPocketCmd.accesskey = d -saveLinkToPocketCmd.label = Wotkaz do Pocket składować -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Lisćinu Pocket pokazać diff --git a/browser/extensions/pocket/locale/hu/pocket.properties b/browser/extensions/pocket/locale/hu/pocket.properties deleted file mode 100644 index 767638e82..000000000 --- a/browser/extensions/pocket/locale/hu/pocket.properties +++ /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/. - -addtags = Címkék hozzáadása -alreadyhaveacct = Már Pocket felhasználó? -continueff = Folytatás a Firefoxszal -errorgeneric = Hiba történt a Pocketre mentés közben. -learnmore = Tudjon meg többet -loginnow = Bejelentkezés -maxtaglength = A címkék legfeljebb 25 karakter hosszúak lehetnek -mustbeconnected = Csatlakoznia kell az internethez a Pocketre mentéshez. Ellenőrizze a kapcsolatot, és próbálja újra. -onlylinkssaved = Csak hivatkozások menthetők -pagenotsaved = Az oldal nem lett mentve -pageremoved = Oldal eltávolítva -pagesaved = Mentve a Pocketbe -processingremove = Oldal eltávolítása… -processingtags = Címkék hozzáadása… -removepage = Oldal eltávolítása -save = Mentés -saving = Mentés… -signupemail = Regisztráció e-maillel -signuptosave = Regisztráljon ingyenesen a Pocketre. -suggestedtags = Javasolt címkék -tagline = Mentsen cikkeket és videókat a Firefoxból a Pocketen való megtekintéshez bármely eszközön, bármikor. -taglinestory_one = Kattintson a Pocket gombra bármely cikk, videó vagy oldal mentéséhez a Firefoxból. -taglinestory_two = Nézze meg a Pocketen bármely eszközön, bármikor. -tagssaved = Címkék hozzáadva -tos = A folytatással elfogadja a Pocket <a href="%1$S" target="_blank">Szolgáltatási feltételeit</a> és az <a href="%2$S" target="_blank">Adatvédelmi nyilatkozatot</a> -tryitnow = Próbálja ki most -signinfirefox = Bejelentkezés a Firefoxszal -signupfirefox = Regisztráció a Firefoxszal -viewlist = Lista megjelenítése - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Mentés a Pocketbe -saveToPocketCmd.label = Oldal mentése a Pocketbe -saveToPocketCmd.accesskey = c -saveLinkToPocketCmd.label = Hivatkozás mentése a Pocketbe -saveLinkToPocketCmd.accesskey = H -pocketMenuitem.label = Pocket lista megjelenítése diff --git a/browser/extensions/pocket/locale/it/pocket.properties b/browser/extensions/pocket/locale/it/pocket.properties deleted file mode 100644 index 2105011eb..000000000 --- a/browser/extensions/pocket/locale/it/pocket.properties +++ /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/. - -addtags = Aggiungi etichette -alreadyhaveacct = Hai già un account registrato su Pocket? -continueff = Prosegui con Firefox -errorgeneric = Si è verificato un errore durante il salvataggio in Pocket. -learnmore = Ulteriori informazioni -loginnow = Accedi -maxtaglength = La lunghezza massima per le etichette è di 25 caratteri -mustbeconnected = È necessario essere connessi a Internet per salvare in Pocket. Verificare la connessione e riprovare. -onlylinkssaved = È possibile salvare solo link -pagenotsaved = Pagina non salvata -pageremoved = Pagina rimossa -pagesaved = Salvata in Pocket -processingremove = Rimozione pagina… -processingtags = Salvataggio etichette… -removepage = Rimuovi pagina -save = Salva -saving = Salvataggio… -signupemail = Accedi con email -signuptosave = Registrati su Pocket. È gratis. -suggestedtags = Etichette suggerite -tagline = Salva articoli e video da Firefox per visualizzarli in Pocket da qualunque dispositivo e in qualunque momento. -taglinestory_one = Fai clic sul pulsante Pocket per salvare qualunque articolo, video o pagina da Firefox. -taglinestory_two = Visualizza in Pocket da qualunque dispositivo e in qualunque momento. -tagssaved = Aggiunte etichette -tos = Proseguendo si accettano i <a href="%1$S" target="_blank">termini di servizio</a> e l’<a href="%2$S" target="_blank">informativa sulla privacy</a> -tryitnow = Provalo subito -signinfirefox = Accedi con Firefox -signupfirefox = Registrati con Firefox -viewlist = Visualizza elenco - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Salva in Pocket -saveToPocketCmd.label = Salva pagina in Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Salva link in Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Visualizza elenco Pocket diff --git a/browser/extensions/pocket/locale/ja/pocket.properties b/browser/extensions/pocket/locale/ja/pocket.properties deleted file mode 100644 index 1aef6bba1..000000000 --- a/browser/extensions/pocket/locale/ja/pocket.properties +++ /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/. - -addtags = タグを追加 -alreadyhaveacct = Pocket に登録済みですか? -continueff = Firefox で続行 -errorgeneric = Pocket への保存中にエラーがありました。 -learnmore = 詳細 -loginnow = ログイン -maxtaglength = タグは 25 文字までです -mustbeconnected = Pocket に保存するには、インターネット接続が必要です。接続状況を確認してから、試してみたください。 -onlylinkssaved = リンクのみ保存しました -pagenotsaved = ページを保存しませんでした -pageremoved = ページを削除しました -pagesaved = Pocket に保存しました -processingremove = ページを削除しています... -processingtags = タグを追加しています... -removepage = ページを削除 -save = 保存 -saving = 保存しています... -signupemail = メールアドレスで新規登録 -signuptosave = Pocket に新規登録します。無料です。 -suggestedtags = 提案タグ -tagline = Firefox で記事や動画を保存すると、いつでもどこでも Pocket で閲覧できます。 -taglinestory_one = Firefox で Pocket ボタンをクリックすると、様々な記事や動画やページを保存できます。 -taglinestory_two = Pocket でいつでもどこでも閲覧できます。 -tagssaved = タグを追加しました -tos = 続けることで、Pocket の <a href="%1$S" target="_blank">利用規約</a> と <a href="%2$S" target="_blank">プライバシーポリシー</a> に同意したことになります -tryitnow = 今すぐ試す -signinfirefox = Firefox でログイン -signupfirefox = Firefox で新規登録 -viewlist = リストを表示 - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket に保存 -saveToPocketCmd.label = ページを Pocket に保存 -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = リンクを Pocket に保存 -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket のリストを表示 diff --git a/browser/extensions/pocket/locale/jar.mn b/browser/extensions/pocket/locale/jar.mn deleted file mode 100644 index f29ca7367..000000000 --- a/browser/extensions/pocket/locale/jar.mn +++ /dev/null @@ -1,33 +0,0 @@ -#filter substitution -# 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/. - -# These are used for the big if statement, as the preprocessor can't handle -# dashes. -#define bn_BD bn-BD -#define en_GB en-GB -#define en_US en-US -#define es_AR es-AR -#define es_CL es-CL -#define es_ES es-ES -#define es_MX es-MX -#define fy_NL fy-NL -#define gu_IN gu-IN -#define nn_NO nn-NO -#define pt_BR pt-BR -#define pt_PT pt-PT -#define sv_SE sv-SE -#define zh_CN zh-CN -#define zh_TW zh-TW - -[features/firefox@getpocket.com] @AB_CD@.jar: -% locale pocket @AB_CD@ %locale/@AB_CD@/ - # For locales we support, include the file from the locale's directory in the - # source tree. - # For other locales (and en-US) fallback to the en-US directory. -#if AB_CD == ast || AB_CD == az || AB_CD == bg || AB_CD == bn_BD || AB_CD == cs || AB_CD == da || AB_CD == de || AB_CD == dsb || AB_CD == en_GB || AB_CD == en_US || AB_CD == es_AR || AB_CD == es_CL || AB_CD == es_ES || AB_CD == es_MX || AB_CD == et || AB_CD == fi || AB_CD == fr || AB_CD == fy_NL || AB_CD == gu_IN || AB_CD == hr || AB_CD == hsb || AB_CD == hu || AB_CD == it || AB_CD == ja || AB_CD == ka || AB_CD == kab || AB_CD == lt || AB_CD == lv || AB_CD == mr || AB_CD == ms || AB_CD == nl || AB_CD == nn_NO || AB_CD == or || AB_CD == pl || AB_CD == pt_BR || AB_CD == pt_PT || AB_CD == rm || AB_CD == ro || AB_CD == ru || AB_CD == sk || AB_CD == sl || AB_CD == sq || AB_CD == sr || AB_CD == sv_SE || AB_CD == te || AB_CD == th || AB_CD == tr || AB_CD == uk || AB_CD == zh_CN || AB_CD == zh_TW - locale/@AB_CD@/ (@AB_CD@/*) -#else - locale/@AB_CD@/ (en-US/*) -#endif diff --git a/browser/extensions/pocket/locale/ka/pocket.properties b/browser/extensions/pocket/locale/ka/pocket.properties deleted file mode 100644 index 266ded044..000000000 --- a/browser/extensions/pocket/locale/ka/pocket.properties +++ /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/. - -addtags = იარლიყების დამატება -alreadyhaveacct = უკვე იყენებთ Pocket-ს? -continueff = Firefox-ით გაგრძელება -errorgeneric = Pocket-ში შენახვისას დაფიქსირდა შეცდომა. -learnmore = დაწვრილებით -loginnow = შესვლა -maxtaglength = იარლიყები შეზღუდულია 25 ასომდე -mustbeconnected = Pocket-ში შესანახად საჭიროა ინტერნეთთან კავშირი. გთხოვთ შეამოწმეთ თქვენი კავშირი და ხელახლა ცადეთ. -onlylinkssaved = შესაძლებელია მხოლოდ ბმულების შენახვა -pagenotsaved = გვერდი არ შეინახა -pageremoved = გვერდი წაიშალა -pagesaved = შეინახა Pocket-ში -processingremove = იშლება გვერდი… -processingtags = ემატება იარლიყები… -removepage = გვერდის წაშლა -save = შენახვა -saving = ინახება… -signupemail = რეგისტრაცია ელ-ფოსტით -signuptosave = დარეგისტრირდით Pocket-ზე. ეს უფასოა. -suggestedtags = შემოთავაზებული იარლიყები -tagline = შეინახეთ სტატიები და ვიდეობეი Firefox-იდან მათ Pocket-ში სანახავად ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს. -taglinestory_one = Firefox-იდან ნებისმიერი სტატიის, ვიდეოს ან გვერდის შესანახად დააწკაპეთ Pocket-ის ღილაკს. -taglinestory_two = დაათვალიერეთ Pocket-ში ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს. -tagssaved = იარლიყები დაემატა -tos = გაგრძელების შემთხვევაში თქვენ ეთანხმებით Pocket-ის <a href="%1$S" target="_blank">მომსახურების პირობებს</a> და <a href="%2$S" target="_blank">პრივატულობის პოლიტიკას</a> -tryitnow = სცადეთ ახლავე -signinfirefox = შესვლა Firefox-ით -signupfirefox = რეგისრაცია Firefox-ით -viewlist = სიის ნახვა - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket-ში შენახვა -saveToPocketCmd.label = გვერდის შენახვა Pocket-ში -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = ბმულის შენახვა Pocket-ში -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket სიის ნახვა diff --git a/browser/extensions/pocket/locale/kab/pocket.properties b/browser/extensions/pocket/locale/kab/pocket.properties deleted file mode 100644 index 3f4cc642a..000000000 --- a/browser/extensions/pocket/locale/kab/pocket.properties +++ /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/. - -addtags = Rnu tibzimin -alreadyhaveacct = Aseqdac yakan n Pocket? -continueff = Kemmel s Firefox -errorgeneric = Teḍra-d tuccḍa deg aɛraḍ n usekles ɣer Pocket. -learnmore = Issin ugar -loginnow = Kcem -maxtaglength = Tibzimin ɣur-sent talast n 25 n isekkilen -mustbeconnected = Yessefk ad tiliḍ teqqneḍ ɣer Internet akken ad tizmireḍ ad teskelseḍ ɣer Pocket. Ma ulac aɣilif, senqed tuqqna yinek sakin ɛreḍ tikelt nniḍen. -onlylinkssaved = Al iseɣwan i yezmren ad ttwakelsen -pagenotsaved = Asebter ur yettwakles ara -pageremoved = Asebter yettwakkes -pagesaved = Yettwakles ɣer Pocket -processingremove = Tukksa n isebtar… -processingtags = Timerna n tebzimin… -removepage = Kkes asebter -save = Sekles -saving = Asekles… -signupemail = Jerred s yimayl -signuptosave = Jerred ɣer Pocket. Baṭel. -suggestedtags = Tibzimin yettwasumren -tagline = Sekles imagraden akked tvidyutin si Firefox akken ad twaliḍ di Pocket ɣef yal ibenk, melmi tebɣiḍ. -taglinestory_one = Sit ɣef tqeffalt Pocket akken ad teskelseḍ yal amagrad, tavidyut neɣ asebter si Firefox. -taglinestory_two = Sken di Pocket ɣef yal ibenk yellan, melmi tebɣiḍ. -tagssaved = Tibzimin yettwarnan -tos = Ma tkemleḍ, ad tqebleḍ <a href="%1$S" target="_blank">tiwtilin n useqdec</a> akked <a href="%2$S" target="_blank">tsertit tabaḍnit</a> n Pocket -tryitnow = Ɛreḍ-it tura -signinfirefox = Kcem s Firefox -signupfirefox = Jerred s Firefox -viewlist = Sken tabdart - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Sekles ɣer Pocket -saveToPocketCmd.label = Sekles asebter ɣer Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Sekles aseɣwen ɣer Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Sken tabdart n Pocket diff --git a/browser/extensions/pocket/locale/lt/pocket.properties b/browser/extensions/pocket/locale/lt/pocket.properties deleted file mode 100644 index f3e8df077..000000000 --- a/browser/extensions/pocket/locale/lt/pocket.properties +++ /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/. - -addtags = Pridėkite gairių -alreadyhaveacct = Jau naudojatės „Pocket“? -continueff = Tęsti su „Firefox“ -errorgeneric = Bandant išsaugoti į „Pocket“ įvyko klaida. -learnmore = Sužinokite daugiau -loginnow = Prisijungti -maxtaglength = Gaires gali sudaryti iki 25 simbolių -mustbeconnected = Norėdami saugoti į „Pocket“, turite būti prisijungę prie interneto. Prašome patikrinti savo ryšį ir bandyti vėl. -onlylinkssaved = Išsaugoti galima tik nuorodas -pagenotsaved = Tinklalapis neišsaugotas -pageremoved = Tinklalapis pašalintas -pagesaved = Išsaugota į „Pocket“ -processingremove = Šalinamas tinklalapis… -processingtags = Pridedamos gairės… -removepage = Pašalinti tinklalapį -save = Išsaugoti -saving = Išsaugoma… -signupemail = Prisijungti su el. paštu -signuptosave = Pradėkite naudotis „Pocket“. Tai nemokama. -suggestedtags = Siūlomos gairės -tagline = Išsaugokite straipsnius bei vaizdo įrašus iš „Firefox“ norėdami juos peržiūrėti bet kokiame įrenginyje su „Pocket“, bet kuriuo metu. -taglinestory_one = Spustelėkite „Pocket“ mygtuką norėdami išsaugoti bet kokį straipsnį, vaizdo įrašą ar tinklalapį iš „Firefox“. -taglinestory_two = Peržiūrėkite bet kokiame įrenginyje su „Pocket“, bet kuriuo metu. -tagssaved = Gairės pridėtos -tos = Tęsdami sutinkate su „Pocket“ <a href="%1$S" target="_blank">paslaugos teikimo sąlygomis</a> bei <a href="%2$S" target="_blank">privatumo nuostatais</a> -tryitnow = Išbandykite dabar -signinfirefox = Prisijungti su „Firefox“ -signupfirefox = Prisijungti su „Firefox“ -viewlist = Peržiūrėti sąrašą - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Išsaugoti į „Pocket“ -saveToPocketCmd.label = Išsaugoti tinklalapį į „Pocket“ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Išsaugoti saitą į „Pocket“ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Peržiūrėti „Pocket“ sąrašą diff --git a/browser/extensions/pocket/locale/lv/pocket.properties b/browser/extensions/pocket/locale/lv/pocket.properties deleted file mode 100644 index 40e3bb367..000000000 --- a/browser/extensions/pocket/locale/lv/pocket.properties +++ /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/. - -addtags = Pievienot birkas -alreadyhaveacct = Jau lietojat Pocket? -continueff = Turpināt ar Firefox -errorgeneric = Kļūda saglabājot Pocket. -learnmore = Uzzināt vairāk -loginnow = Pieslēgties -maxtaglength = Birkas nevar būt garākas par 25 simboliem -mustbeconnected = Lai saglabātu Pocket, jābūt savienojumam ar internetu. Lūdzu pārbaudiet savienojumu un mēģiniet vēlreiz. -onlylinkssaved = Saglabāt var tikai saites -pagenotsaved = Lapa nav saglabāta -pageremoved = Lapa ir aizvākta -pagesaved = Saglabāt Pocket -processingremove = Aizvāc lapu… -processingtags = Pievieno birkas… -removepage = Izņemt lapu -save = Saglabāt -saving = Saglabā… -signupemail = Pierakstīties ar epastu -signuptosave = Pierakstīties Pocket. Tas ir bez maksas. -suggestedtags = Ieteiktās birkas -tagline = Saglabājiet Firefox rakstu vai video, lai skatītos to ar Pocket jebkurā ierīcē un jebkurā laikā. -taglinestory_one = Klikšķiniet uz Pocket pogas, lai saglabātu Firefox rakstus, video vai lapas. -taglinestory_two = Skatiet ar Pocket jebkurā ierīcē un jebkurā laikā. -tagssaved = Birkas pievienotas -tos = Turpinot, tu piekrīti Pocket <a href="%1$S" target="_blank">Noteikumiem</a> un <a href="%2$S" target="_blank">Privātuma politikai</a> -tryitnow = Izmēģini tagad -signinfirefox = Pieslēgties ar Firefox -signupfirefox = Pierakstīties ar Firefox -viewlist = Skatījumu saraksts - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Saglabāt Pocket -saveToPocketCmd.label = Saglabāt lapu Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Saglabāt saiti Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Aplūkot Pocket sarakstu diff --git a/browser/extensions/pocket/locale/moz.build b/browser/extensions/pocket/locale/moz.build deleted file mode 100644 index aac3a838c..000000000 --- a/browser/extensions/pocket/locale/moz.build +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/extensions/pocket/locale/mr/pocket.properties b/browser/extensions/pocket/locale/mr/pocket.properties deleted file mode 100644 index af330ec1e..000000000 --- a/browser/extensions/pocket/locale/mr/pocket.properties +++ /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/. - -addtags = टॅग जोडा -alreadyhaveacct = आधीपासून Pocket वापरताय? -continueff = Firefox सोबत पुढे चला -errorgeneric = Pocket मध्ये जतन करताना त्रुटी आली. -learnmore = अधिक जाणून घ्या -loginnow = लॉग इन -maxtaglength = टॅग्ज साठी 25 वर्णांची मर्यादा आहे -mustbeconnected = Pocket मध्ये साठविण्यासाठी आपले इंटरनेट चालू असणे आवश्यक आहे. कृपया आपली जोडणी तपासा आणि पुन्हा प्रयत्न करा. -onlylinkssaved = फक्त दुवे जतन केले जाऊ शकतात -pagenotsaved = पृष्ठ जतन झाले नाही -pageremoved = पृष्ठ काढले गेले -pagesaved = Pocket मध्ये जतन झाले -processingremove = पृष्ठ काढून टाकत आहे... -processingtags = टॅग्ज जोडत आहे… -removepage = पृष्ठ काढून टाका -save = जतन करा -saving = जतन करत आहे... -signupemail = ईमेलसह साईन अप करा -signuptosave = Pocket साठी साईन अप करा. हे मोफत आहे. -suggestedtags = सूचविलेले टॅग्स -tagline = Firefox मधील नोंदी आणि व्हिडीओ कुठल्याही साधनावर केंव्हाही Pocket मध्ये पाहण्यासाठी साठवा. -taglinestory_one = Firefox वरील कोणताही लेख, व्हिडिओ किंवा पृष्ठ जतन करण्यासाठी Pocket बटणावर क्लिक करा. -taglinestory_two = कधीही कुठल्याही साधनावर Pocket मध्ये पाहा. -tagssaved = टॅग्स जोडले -tos = सुरु ठेवुन, आपण Pocketच्या <a href="%1$S" target="_blank">सेवेच्या अटी</a> आणि <a href="%2$S" target="_blank">गोपनीयता धोरणांशी</a> सहमत आहात -tryitnow = आत्ताच वापरुन पाहा -signinfirefox = Firefox सह साइन इन करा -signupfirefox = Firefox सह साईन अप करा -viewlist = यादी पहा - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket मध्ये जतन करा -saveToPocketCmd.label = पृष्ठ Pocket मध्ये जतन करा -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = दुवा Pocket मध्ये संकलित करा -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = पॉकेट सूची पहा diff --git a/browser/extensions/pocket/locale/ms/pocket.properties b/browser/extensions/pocket/locale/ms/pocket.properties deleted file mode 100644 index 67a935be8..000000000 --- a/browser/extensions/pocket/locale/ms/pocket.properties +++ /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/. - -addtags = Tambah Tag -alreadyhaveacct = Sudah menjadi pengguna Poket? -continueff = Teruskan dengan Firefox -errorgeneric = Ada ralat semasa cuba menyimpan ke Pocket. -learnmore = Ketahui Selanjutnya -loginnow = Log masuk -maxtaglength = Tag dihadkan hanya 25 aksara -mustbeconnected = Anda mesti ada sambungan Internet untuk menyimpan ke Pocket. Sila periksa sambungan anda dan cuba lagi. -onlylinkssaved = Hanya pautan boleh disimpan -pagenotsaved = Halaman Tidak Disimpan -pageremoved = Halaman Dialih keluar -pagesaved = Disimpan ke Pocket -processingremove = Sedang mengalih keluar Halaman… -processingtags = Sedang menambah tag… -removepage = Alih keluar Halaman -save = Simpan -saving = Sedang menyimpan… -signupemail = Daftar dengan e-mel -signuptosave = Daftar masuk ke Pocket. Percuma. -suggestedtags = Tag Disyorkan -tagline = Simpan artikel dan video dari Firefox untuk dilihat dalam Pocket pada apa jua peranti pada bila-bila masa. -taglinestory_one = Klik butang Pocket untuk menyimpan apa jua artikel, video atau halaman daripada Firefox. -taglinestory_two = Papar dalam Pocket dalam mana-mana peranti, bila-bila masa saja. -tagssaved = Tag Ditambah -tos = Dengan meneruskan, anda setuju dengan <a href="%1$S" target="_blank">Terma Perkhidmatan</a> Pocket dan <a href="%2$S" target="_blank">Polisi Privasi</a> -tryitnow = Cubanya Sekarang -signinfirefox = Daftar masuk Firefox -signupfirefox = Daftar dengan Firefox -viewlist = Senarai Paparan - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Simpan ke Pocket -saveToPocketCmd.label = Simpan Halaman ke Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Simpan Pautan ke Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Papar Senarai Pocket diff --git a/browser/extensions/pocket/locale/nl/pocket.properties b/browser/extensions/pocket/locale/nl/pocket.properties deleted file mode 100644 index 3abe14491..000000000 --- a/browser/extensions/pocket/locale/nl/pocket.properties +++ /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/. - -addtags = Labels toevoegen -alreadyhaveacct = Al een Pocket-gebruiker? -continueff = Doorgaan met Firefox -errorgeneric = Er is een fout opgetreden bij het opslaan naar Pocket. -learnmore = Meer info -loginnow = Meld u aan -maxtaglength = Labels zijn beperkt tot 25 tekens -mustbeconnected = U moet met het internet zijn verbonden om naar Pocket te kunnen opslaan. Controleer uw verbinding en probeer het opnieuw. -onlylinkssaved = Alleen koppelingen kunnen worden opgeslagen -pagenotsaved = Pagina niet opgeslagen -pageremoved = Pagina verwijderd -pagesaved = Opgeslagen naar Pocket -processingremove = Pagina verwijderen… -processingtags = Labels toevoegen… -removepage = Pagina verwijderen -save = Opslaan -saving = Opslaan… -signupemail = Registreren met e-mailadres -signuptosave = Registreer voor Pocket. Het is gratis. -suggestedtags = Voorgestelde labels -tagline = Sla artikelen en video’s vanuit Firefox op voor weergeven in Pocket op diverse apparaten, wanneer dan ook. -taglinestory_one = Klik op de Pocket-knop om artikelen, video’s of pagina’s vanuit Firefox op te slaan. -taglinestory_two = Bekijk ze op diverse apparaten, wanneer dan ook. -tagssaved = Labels toegevoegd -tos = Door verder te gaan, gaat u akkoord met de <a href="%1$S" target="_blank">Servicevoorwaarden</a> en het <a href="%2$S" target="_blank">Privacybeleid</a> van Pocket -tryitnow = Nu proberen -signinfirefox = Aanmelden met Firefox -signupfirefox = Registreren met Firefox -viewlist = Lijst weergeven - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Opslaan naar Pocket -saveToPocketCmd.label = Pagina opslaan naar Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Koppeling opslaan naar Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket-lijst weergeven diff --git a/browser/extensions/pocket/locale/nn-NO/pocket.properties b/browser/extensions/pocket/locale/nn-NO/pocket.properties deleted file mode 100644 index 3f3dc971e..000000000 --- a/browser/extensions/pocket/locale/nn-NO/pocket.properties +++ /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/. - -addtags = Legg til merkelapp-stikkord -alreadyhaveacct = Allereie ein Pocket-brukar? -continueff = Hald fram med Firefox -errorgeneric = Eit problem oppstod ved lagring til Pocket. -learnmore = Les meir -loginnow = Logg inn -maxtaglength = Merkelapp-stikkord er avgrensa til 25 teikn -mustbeconnected = Du må vera kopla til nettet for å lagra til Pocket. Kontroller tilkoplinga og prøv igjen. -onlylinkssaved = Berre lenker kan lagrast -pagenotsaved = Sida ikkje lagra -pageremoved = Sida fjerna -pagesaved = Lagrar til Pocket -processingremove = Fjernar sida … -processingtags = Legg til merkelapp-stikkord… -removepage = Fjern sida -save = Lagra -saving = Lagrar … -signupemail = Logg inn med e-postadresse -signuptosave = Registrer deg på Pocket. Det er gratis. -suggestedtags = Føreslåtte merkelapp-stikkord -tagline = Lagra artiklar og videoar frå Firefox for å visa dei i Pocket på kva som helst eining, når som helst. -taglinestory_one = Trykk på Pocket-knappen for å lagra kva som helst artikkel, video eller side frå Firefox. -taglinestory_two = Vis i Pocket, på kva som helst eining, når som helst. -tagssaved = Merkelapp-stikkord lagt til -tos = Ved å fortsetta godtek du Pocket sine <a href="%1$S" target="_blank">tenestevilkår</a> og <a href="%2$S" target="_blank">personvernpraksis</a> -tryitnow = Prøv no -signinfirefox = Logg inn med Firefox -signupfirefox = Registrer deg med Firefox -viewlist = Vis liste - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Lagra til Pocket -saveToPocketCmd.label = Lagra sida i Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Lagra lenke til Pocket -saveLinkToPocketCmd.accesskey = l -pocketMenuitem.label = Vis Pocket-liste diff --git a/browser/extensions/pocket/locale/or/pocket.properties b/browser/extensions/pocket/locale/or/pocket.properties deleted file mode 100644 index d2616e484..000000000 --- a/browser/extensions/pocket/locale/or/pocket.properties +++ /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/. - -addtags = ଟ୍ୟାଗ ଯୋଡ଼ନ୍ତୁ -alreadyhaveacct = ଆଗରୁ Pocket ବ୍ୟବହାର କରୁଛନ୍ତି? -continueff = Firefox ଦେଇ ଆଗକୁ ଯିବେ -errorgeneric = Pocketରେ ସାଇତିବା ବେଳେ ଅସୁବିଧାଟିଏ ହେଲା । -learnmore = ଅଧିକ ଶିଖନ୍ତୁ -loginnow = ଲଗ ଇନ -maxtaglength = ଟ୍ୟାଗ 25 ଟି ଅକ୍ଷରରେ ସୀମିତ -mustbeconnected = Pocketରେ ସାଇତିବା ପାଇଁ ଆପଣ ଇଣ୍ଟରନେଟ ସହ ସଂଯୁକ୍ତ ହୋଇଥିବା ଲୋଡ଼ା । ଦୟାକରି ନିଜ ସଂଯୋଗ ପରଖି ଆଉଥରେ ଚେଷ୍ଟାକରନ୍ତୁ । -onlylinkssaved = କେବଳ ଲିଙ୍କ ସାଇତାଯାଇପାରିବ -pagenotsaved = ପୃଷ୍ଠା ସାଇତା ଯାଇନାହିଁ -pageremoved = ପୃଷ୍ଠାଟି ହଟାଗଲା -pagesaved = Pocketରେ ସାଇତାଗଲା -processingremove = ପୃଷ୍ଠା ହଟାଯାଉଛି… -processingtags = ଟ୍ୟାଗ ଯୋଡ଼ାଯାଉଛି… -removepage = ପୃଷ୍ଠା ହଟାନ୍ତୁ -save = ସାଇତିବେ -saving = ସାଇତୁଛି… -signupemail = ଇମେଲରେ ସାଇନ ଅପ -signuptosave = Pocket ପାଇଁ ସାଇନ ଅପ । ଏହା ମାଗଣା । -suggestedtags = ପ୍ରସ୍ତାବିତ ଟ୍ୟାଗ -tagline = ଯେତେବେଳେ ଲୋଡ଼ା କୌଣସି ଏକ ଡିଭାଇସରୁ Pocketରେ ଦେଖିବା ପାଇଁ Firefoxରୁ ପ୍ରସଙ୍ଗ ଓ ଭିଡ଼ିଓ ସାଇତିପାରିବେ । -taglinestory_one = କୌଣସି ପ୍ରସଙ୍ଗ, ଭିଡ଼ିଓ ବା ପୃଷ୍ଠା ସାଇତିବା ପାଇଁ Pocket Button ଟିପନ୍ତୁ । -taglinestory_two = ଯେତେବେଳେ ଲୋଡ଼ା ସବୁ ଡିଭାଇସରୁ Pocketରେ ଦେଖନ୍ତୁ । -tagssaved = ଟ୍ୟାଗ ଯୋଡ଼ାଗଲା -tos = ଆଗକୁ ବଢ଼ିବା ଯୋଗୁ ଆପଣ Pocketର <a href="%1$S" target="_blank">ନୀତି ନିୟମ</a> ଓ <a href="%2$S" target="_blank">ଗୋପନୀୟତା ନୀତିବଳୀ</a> ମାନୁଛନ୍ତି ବୋଲି ଜାଣିରଖିବେ -tryitnow = ଏବେ ଏହା ଚେଷ୍ଟାକରନ୍ତୁ -signinfirefox = Firefoxରେ ସାଇନ ଇନ କରନ୍ତୁ -signupfirefox = Firefoxରେ ସାଇନ ଅପ କରନ୍ତୁ -viewlist = ତାଲିକା ଦେଖନ୍ତୁ - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocketରେ ସାଇତନ୍ତୁ -saveToPocketCmd.label = Pocketରେ ପୃଷ୍ଠା ସାଇତନ୍ତୁ -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Pocketରେ ଲିଙ୍କ ସାଇତନ୍ତୁ -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket ତାଲିକା ଦେଖନ୍ତୁ diff --git a/browser/extensions/pocket/locale/pl/pocket.properties b/browser/extensions/pocket/locale/pl/pocket.properties deleted file mode 100644 index 07b5866f1..000000000 --- a/browser/extensions/pocket/locale/pl/pocket.properties +++ /dev/null @@ -1,48 +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/. - -taglinestory_one=Kliknij przycisk Pocket, aby wysłać dowolny artykuł, film lub stronę z Firefoksa. -taglinestory_two=Czytaj z Pocket o dowolnej porze na dowolnym urządzeniu. -learnmore=Więcej informacji - -signuptosave=Utwórz konto w Pocket. Jest darmowe. -signupfirefox=Utwórz konto z Firefoksem -signupemail=Utwórz konto z adresem e-mail -alreadyhaveacct=Masz już konto Pocket? -loginnow=Zaloguj się - -tos=Kontynuując, wyrażasz zgodę na <a href="%1$S" target="_blank">warunki korzystania z usługi</a> i <a href="%2$S" target="_blank">politykę prywatności</a> -tryitnow=Wypróbuj teraz - -continueff=Kontynuuj z kontem Firefoksa -signinfirefox=Zaloguj się z Firefoksem -viewlist=Otwórz w Pocket - -removepage=Usuń stronę -processingremove=Usuwanie strony… -pageremoved=Usunięto stronę - -save=Wyślij -saving=Wysyłanie… -pagesaved=Wysłano do Pocket - -addtags=Etykiety -processingtags=Wysyłanie etykiet… -tagssaved=Wysłano etykiety -maxtaglength=Etykiety są ograniczone do 25 znaków -suggestedtags=Sugerowane etykiety -tagline=Wysyłaj artykuły i filmy z Firefoksa do Pocket, aby wyświetlić je o dowolnej porze na dowolnym urządzeniu. - -errorgeneric=Wystąpił błąd podczas wysyłania do Pocket. -mustbeconnected=Połączenie z Internetem jest konieczne do przesyłania do Pocket. Proszę sprawdzić połączenie i spróbować ponownie. -onlylinkssaved=Tylko odnośniki mogą być przesyłane -pagenotsaved=Nie przesłano strony - -pocket-button.label=Pocket -pocket-button.tooltiptext=Wyślij do Pocket -saveToPocketCmd.label=Wyślij stronę do Pocket -saveToPocketCmd.accesskey=s -saveLinkToPocketCmd.label=Wyślij odnośnik do Pocket -saveLinkToPocketCmd.accesskey=o -pocketMenuitem.label=Wysłane do Pocket diff --git a/browser/extensions/pocket/locale/pt-BR/pocket.properties b/browser/extensions/pocket/locale/pt-BR/pocket.properties deleted file mode 100644 index a637aea29..000000000 --- a/browser/extensions/pocket/locale/pt-BR/pocket.properties +++ /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/. - -addtags = Adicionar etiquetas -alreadyhaveacct = Já é um usuário do Pocket? -continueff = Continuar com o Firefox -errorgeneric = Houve um erro ao tentar salvar no Pocket. -learnmore = Saber mais -loginnow = Entrar -maxtaglength = As etiquetas estão limitadas a 25 caracteres -mustbeconnected = Você deve estar conectado à Internet para salvar no Pocket. Verifique a sua conexão e tente novamente. -onlylinkssaved = Somente links podem ser salvos -pagenotsaved = Página não salva -pageremoved = Página removida -pagesaved = Salva no Pocket -processingremove = Removendo página… -processingtags = Adicionando etiquetas… -removepage = Remover página -save = Salvar -saving = Salvando… -signupemail = Registrar com e-mail -signuptosave = Registre-se no Pocket. É gratuito. -suggestedtags = Etiquetas sugeridas -tagline = Salve os artigos e vídeos do Firefox no Pocket para vê-los mais tarde e em qualquer local. -taglinestory_one = Clique no botão Pocket para salvar um artigo, vídeo ou página do Firefox. -taglinestory_two = Ver no Pocket em qualquer dispositivo, a qualquer hora. -tagssaved = Etiquetas adicionadas -tos = Continuando, você concorda com os <a href="%1$S" target="_blank">Termos de serviço</a> e <a href="%2$S" target="_blank">Política de privacidade</a> do Pocket -tryitnow = Experimente-o agora -signinfirefox = Entrar com o Firefox -signupfirefox = Cadastre-se com o Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Salvar no Pocket -saveToPocketCmd.label = Salvar página no Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Salvar link no Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver lista do Pocket diff --git a/browser/extensions/pocket/locale/pt-PT/pocket.properties b/browser/extensions/pocket/locale/pt-PT/pocket.properties deleted file mode 100644 index 90eafe77f..000000000 --- a/browser/extensions/pocket/locale/pt-PT/pocket.properties +++ /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/. - -addtags = Adicionar etiquetas -alreadyhaveacct = Já é um utilizador do Pocket? -continueff = Continuar com o Firefox -errorgeneric = Ocorreu um erro ao tentar guardar no Pocket. -learnmore = Saber mais -loginnow = Iniciar sessão -maxtaglength = As etiquetas estão limitadas a 25 caracteres -mustbeconnected = É necessária uma ligação à Internet para poder guardar no Pocket. Por favor, verifique a sua ligação à Internet e tente novamente. -onlylinkssaved = Só podem ser guardadas ligações -pagenotsaved = Página não guardada -pageremoved = Página removida -pagesaved = Guardado no Pocket -processingremove = A remover página… -processingtags = A adicionar etiquetas… -removepage = Remover página -save = Guardar -saving = A guardar… -signupemail = Registar com email -signuptosave = Registe-se no Pocket. É gratuito. -suggestedtags = Etiquetas sugeridas -tagline = Guardar artigos e vídeos do Firefox para os ver no Pocket em qualquer dispositivo, em qualquer altura. -taglinestory_one = Clique no botão Pocket para guardar qualquer artigo, vídeo ou página a partir Firefox. -taglinestory_two = Ver no Pocket em qualquer dispositivo, a qualquer altura. -tagssaved = Etiquetas adicionadas -tos = Ao continuar, concorda com os <a href="%1$S" target="_blank">termos do serviço</a> e <a href="%2$S" target="_blank">política de privacidade</a> do Pocket -tryitnow = Experimente-o agora -signinfirefox = Iniciar sessão com Firefox -signupfirefox = Registar com Firefox -viewlist = Ver lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Guardar no Pocket -saveToPocketCmd.label = Guardar página no Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Guardar ligação no Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Ver lista do Pocket diff --git a/browser/extensions/pocket/locale/rm/pocket.properties b/browser/extensions/pocket/locale/rm/pocket.properties deleted file mode 100644 index 803277b21..000000000 --- a/browser/extensions/pocket/locale/rm/pocket.properties +++ /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/. - -addtags = Agiuntar tags -alreadyhaveacct = Es ti gia in utilisader da Pocket? -continueff = Cuntinuar cun Firefox -errorgeneric = Ina errur è succedida durant empruvar da memorisar en Pocket. -learnmore = Ulteriuras infurmaziuns -loginnow = S'annunziar -maxtaglength = Tags èn limitads a 25 caracters -mustbeconnected = Ti stos esser connectà cun l'internet per pudair memorisar en Pocket. Controllescha p.pl. tia connexiun ed emprova anc ina giada. -onlylinkssaved = Mo colliaziuns pon vegnir memorisadas -pagenotsaved = Betg memorisà la pagina -pageremoved = Allontanà la pagina -pagesaved = Memorisà en Pocket -processingremove = Allontanar la pagina… -processingtags = Agiuntar tags… -removepage = Allontanar la pagina -save = Memorisar -saving = Memorisar… -signupemail = Sa registrar cun l'adressa dad e-mail -signuptosave = Ta registrescha tar Pocket. Gratuit. -suggestedtags = Tags proponids -tagline = Memorisescha artitgels e videos ord Firefox per als vesair en Pocket, sin mintga apparat, da tut temp. -taglinestory_one = Clicca sin il buttun da Pocket per memorisar directamain ord Firefox tge artitgel, video u pagina ch'i saja. -taglinestory_two = Vesair en Pocket sin mintga apparat, da tut temp. -tagssaved = Tags agiuntads -tos = Cun cuntinuar accepteschas ti il <a href="%1$S" target="_blank">Contract da licenza</a> e las <a href="%2$S" target="_blank">Directivas per la protecziun da datas</a> da Pocket -tryitnow = Emprova ussa -signinfirefox = S'annunziar cun Firefox -signupfirefox = Sa registrar cun Firefox -viewlist = Mussar la glista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Memorisar en Pocket -saveToPocketCmd.label = Memorisar la pagina en Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Memorisar la colliaziun en Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Mussar la glista da Pocket diff --git a/browser/extensions/pocket/locale/ro/pocket.properties b/browser/extensions/pocket/locale/ro/pocket.properties deleted file mode 100644 index eedb756f9..000000000 --- a/browser/extensions/pocket/locale/ro/pocket.properties +++ /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/. - -addtags = Adaugă etichete -alreadyhaveacct = Ești deja un utilizator Pocket? -continueff = Continuă cu Firefox -errorgeneric = A apărut o eroare la încercarea de salvare în Pocket. -learnmore = Află mai multe -loginnow = Autentificare -maxtaglength = Etichetele sunt limitate la 25 de caractere -mustbeconnected = Trebuie să fii conectat la internet pentru a salva în Pocket. Te rugăm să verifici conexiunea și să încerci din nou. -onlylinkssaved = Doar linkurile pot fi salvate -pagenotsaved = Pagină nesalvată -pageremoved = Pagină eliminată -pagesaved = Salvat în Pocket -processingremove = Se elimină pagina… -processingtags = Se adaugă etichete… -removepage = Elimină pagina -save = Salvează -saving = Se salvează... -signupemail = Înregistrare cu e-mail -signuptosave = Înregistrează-te pentru Pocket. Este gratuit. -suggestedtags = Etichete sugerate -tagline = Salvează articole și videoclipuri din Firefox pentru a le vedea în Pocket de pe orice dispozitiv, oricând. -taglinestory_one = Clic pe butonul Pocket pentru a salva orice articol, videoclip sau pagină din Firefox. -taglinestory_two = Vezi în Pocket de pe orice dispozitiv, oricând. -tagssaved = Etichete adăugate -tos = Continuând, ești de acord cu <a href="%1$S" target="_blank">termenii de utilizare a serviciului</a> și <a href="%2$S" target="_blank">politica de confidențialitate</a> a Pocket -tryitnow = Încearcă acum -signinfirefox = Autentificare în Firefox -signupfirefox = Înregistrare în Firefox -viewlist = Vezi lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Salvează în Pocket -saveToPocketCmd.label = Salvează pagina în Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Salvează linkul în Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Vezi lista Pocket diff --git a/browser/extensions/pocket/locale/ru/pocket.properties b/browser/extensions/pocket/locale/ru/pocket.properties deleted file mode 100644 index 0da716e8a..000000000 --- a/browser/extensions/pocket/locale/ru/pocket.properties +++ /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/. - -addtags = Добавить теги -alreadyhaveacct = Уже используете Pocket? -continueff = Продолжить через Firefox -errorgeneric = При попытке сохранить в Pocket произошла ошибка. -learnmore = Узнайте больше -loginnow = Войдите -maxtaglength = Длина тега не должна превышать 25 символов -mustbeconnected = Чтобы сохранять в Pocket, вы должны быть подключены к Интернету. Пожалуйста, проверьте ваше соединение и попробуйте снова. -onlylinkssaved = Можно сохранять только ссылки -pagenotsaved = Страница не сохранена -pageremoved = Страница удалена -pagesaved = Сохранено в Pocket -processingremove = Удаление страницы… -processingtags = Добавление тегов… -removepage = Удалить страницу -save = Сохранить -saving = Сохранение… -signupemail = Регистрация по эл. почте -signuptosave = Зарегистрируйтесь в Pocket. Это бесплатно. -suggestedtags = Рекомендуемые теги -tagline = Сохраняйте статьи и видео из Firefox для просмотра в Pocket на любом устройстве, в любой момент. -taglinestory_one = Щёлкните по кнопке Pocket, чтобы сохранить любую статью, видео или страницу из Firefox. -taglinestory_two = Просматривайте их в Pocket на любом устройстве, в любой момент. -tagssaved = Теги добавлены -tos = Продолжая, вы принимаете <a href="%1$S" target="_blank">Условия службы</a> и <a href="%2$S" target="_blank">Политику приватности</a> Pocket -tryitnow = Попробовать сейчас -signinfirefox = Войти через Firefox -signupfirefox = Регистрация через Firefox -viewlist = Просмотреть список - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Сохранить в Pocket -saveToPocketCmd.label = Сохранить страницу в Pocket -saveToPocketCmd.accesskey = х -saveLinkToPocketCmd.label = Сохранить ссылку в Pocket -saveLinkToPocketCmd.accesskey = о -pocketMenuitem.label = Показать список Pocket diff --git a/browser/extensions/pocket/locale/sk/pocket.properties b/browser/extensions/pocket/locale/sk/pocket.properties deleted file mode 100644 index 57327365c..000000000 --- a/browser/extensions/pocket/locale/sk/pocket.properties +++ /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/. - -addtags = Pridať značky -alreadyhaveacct = Už ste používateľom služby Pocket? -continueff = Pokračovať s Firefoxom -errorgeneric = Počas ukladania údajov do služby Pocket sa vyskytla chyba. -learnmore = Ďalšie informácie -loginnow = Prihlásiť sa -maxtaglength = Značky môžu obsahovať najviac 25 znakov -mustbeconnected = Ak chcete ukladať údaje do služby Pocket, musíte byť pripojený k sieti Internet. Skontrolujte svoje pripojenie a skúste to znova. -onlylinkssaved = Uložené môžu byť len odkazy -pagenotsaved = Stránka nebola uložená -pageremoved = Stránka bola odstránená -pagesaved = Uložená do služby Pocket -processingremove = Stránka sa odstraňuje… -processingtags = Pridávajú sa značky… -removepage = Odstrániť stránku -save = Uložiť -saving = Ukladá sa… -signupemail = Zaregistrovať sa pomocou e-mailu -signuptosave = Zaregistrujte sa v službe Pocket. Je zadarmo. -suggestedtags = Navrhované značky -tagline = Ukladajte si články a videá z Firefoxu a majte ich dostupné kdekoľvek a na akomkoľvek zariadení pomocou služby Pocket. -taglinestory_one = Kliknutím na tlačidlo Pocket vo Firefoxe uložíte akýkoľvek článok, video alebo stránku. -taglinestory_two = Tieto sú potom so službou Pocket dostupné kdekoľvek a na akomkoľvek zariadení. -tagssaved = Značky boli pridané -tos = Pokračovaním vyjadrujete súhlas s <a href="%1$S" target="_blank">podmienkami používania</a> služby Pocket a so <a href="%2$S" target="_blank">zásadami ochrany osobných údajov</a> -tryitnow = Vyskúšajte to hneď teraz -signinfirefox = Prihlásiť sa pomocou Firefoxu -signupfirefox = Zaregistrovať sa pomocou Firefoxu -viewlist = Zobraziť zoznam - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Služba Pocket -pocket-button.tooltiptext = Uložiť do služby Pocket -saveToPocketCmd.label = Uložiť stránku do služby Pocket -saveToPocketCmd.accesskey = P -saveLinkToPocketCmd.label = Uložiť odkaz do služby Pocket -saveLinkToPocketCmd.accesskey = d -pocketMenuitem.label = Zobraziť zoznam služby Pocket diff --git a/browser/extensions/pocket/locale/sl/pocket.properties b/browser/extensions/pocket/locale/sl/pocket.properties deleted file mode 100644 index e0451d72b..000000000 --- a/browser/extensions/pocket/locale/sl/pocket.properties +++ /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/. - -addtags = Dodaj oznake -alreadyhaveacct = Že uporabljate Pocket? -continueff = Nadaljuj s Firefoxom -errorgeneric = Med shranjevanjem na Pocket je prišlo do napake. -learnmore = Več o tem -loginnow = Prijava -maxtaglength = Oznake so omejene na 25 znakov -mustbeconnected = Za shranjevanje na Pocket morate biti povezani na internet. Preverite povezavo in poskusite znova. -onlylinkssaved = Shranite lahko samo povezave -pagenotsaved = Stran ni bila shranjena -pageremoved = Stran odstranjena -pagesaved = Shranjeno na Pocket -processingremove = Odstranjevanje strani … -processingtags = Dodajanje oznak … -removepage = Odstrani stran -save = Shrani -saving = Shranjevanje … -signupemail = Registrirajte se z e-pošto -signuptosave = Brezplačno se registrirajte na Pocketu. -suggestedtags = Predlagane oznake -tagline = Shranite članke in videe v Firefoxu in si jih oglejte na Pocketu iz katere koli naprave. -taglinestory_one = Kliknite gumb Pocket v Firefoxu in shranite članek, video ali stran. -taglinestory_two = Oglejte si v Pocketu na kateri koli napravi. -tagssaved = Oznake dodane -tos = Če nadaljujete, sprejemate <a href="%1$S" target="_blank">Pogoje uporabe</a> in <a href="%2$S" target="_blank">Politiko zasebnosti</a> storitve Pocket -tryitnow = Preizkusite ga zdaj -signinfirefox = Prijavite se s Firefoxom -signupfirefox = Registrirajte se s Firefoxom -viewlist = Ogled seznama - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Shrani v Pocket -saveToPocketCmd.label = Shrani stran v Pocket -saveToPocketCmd.accesskey = r -saveLinkToPocketCmd.label = Shrani povezavo v Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pokaži seznam Pocket diff --git a/browser/extensions/pocket/locale/sq/pocket.properties b/browser/extensions/pocket/locale/sq/pocket.properties deleted file mode 100644 index b8b17ad22..000000000 --- a/browser/extensions/pocket/locale/sq/pocket.properties +++ /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/. - -addtags = Shtoni Etiketa -alreadyhaveacct = Jeni tashmë përdorues Pocket-i? -continueff = Vazhdoni me Firefox-in -errorgeneric = Pati një gabim teksa përpiqej të ruante te Pocket. -learnmore = Mësoni më tepër -loginnow = Hyni -maxtaglength = Etiketat kufizohen deri në 25 shenja -mustbeconnected = Që të ruani në Pocket, duhet të jeni i lidhur në Internet. Ju lutemi, kontrolloni lidhjen tuaj dhe riprovoni. -onlylinkssaved = Mund të ruhen vetëm lidhje -pagenotsaved = Faqja S’u Ruajt -pageremoved = Faqja u Hoq -pagesaved = U ruajt te Pocket -processingremove = Po hiqet Faqja… -processingtags = Po shtohen etiketa… -removepage = Hiqe Faqen -save = Ruaje -saving = Po ruhet… -signupemail = Regjistrohuni me email -signuptosave = Regjistrohuni në Pocket. Është falas. -suggestedtags = Etiketa të Këshilluara -tagline = Ruani që nga Firefoxc-i artikuj dhe video për t’i parë në Pocket në çfarëdo pajisje, kurdo. -taglinestory_one = Klikoni butonin Pocket që të ruani që nga Firefox-i çfarëdo artikulli, video ose faqe. -taglinestory_two = Shihini në Pocket, në çfarëdo pajisje, kurdo. -tagssaved = Etiketat u Shtuan -tos = Duke vazhduar, pajtoheni me <a href="%1$S" target="_blank">Kushtet e Shërbimit</a> dhe <a href="%2$S" target="_blank">Rregullat e Privatësisë</a> për Pocket-in -tryitnow = Provojeni Që Tani -signinfirefox = Hyni me Firefox -signupfirefox = Regjistrohuni me Firefox -viewlist = Shihni Listën - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Ruajeni te Pocket -saveToPocketCmd.label = Ruajeni Faqen te Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Ruajeni lidhjen te Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Shihni Listën te Pocket diff --git a/browser/extensions/pocket/locale/sr/pocket.properties b/browser/extensions/pocket/locale/sr/pocket.properties deleted file mode 100644 index c3dbf2ece..000000000 --- a/browser/extensions/pocket/locale/sr/pocket.properties +++ /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/. - -addtags = Додај ознаку -alreadyhaveacct = Већ сте Pocket корисник? -continueff = Настави са Firefox-ом -errorgeneric = Десила се грешка при покушају снимања у Pocket. -learnmore = Сазнајте више -loginnow = Пријава -maxtaglength = Ознаке су ограничене на 25 карактера -mustbeconnected = Морате бити повезани на интернет да бисте снимили у Pocket. Проверити везу и покушајте поново. -onlylinkssaved = Само се везе могу снимити -pagenotsaved = Страница није снимљена -pageremoved = Страница уклоњена -pagesaved = Снимљено у Pocket -processingremove = Уклањам страницу… -processingtags = Додајем ознаку… -removepage = Уклони страницу -save = Сними -saving = Снимам… -signupemail = Региструј се са е-поштом -signuptosave = Региструјте се да користите Pocket. Бесплатно је. -suggestedtags = Предложене ознаке -tagline = Снимите чланке и видео снимке из Firefox-а да бисте их погледали у Pocket-у на било ком уређају било када. -taglinestory_one = Кликните на Pocket дугме да бисте снимили чланак, видео или страницу из Firefox-а. -taglinestory_two = Погледајте садржај у Pocket-у на било ком уређају било када. -tagssaved = Ознаке додате -tos = Настављањем прихватате <a href="%1$S" target="_blank">услове коришћења</a> и <a href="%2$S" target="_blank">полису приватности</a> Pocket-а -tryitnow = Покушајте сада -signinfirefox = Пријави се -signupfirefox = Региструј се -viewlist = Прикажи листу - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Сними у Pocket -saveToPocketCmd.label = Сними страницу у Pocket -saveToPocketCmd.accesskey = С -saveLinkToPocketCmd.label = Сними везу у Pocket -saveLinkToPocketCmd.accesskey = в -pocketMenuitem.label = Прикажи Pocket листу diff --git a/browser/extensions/pocket/locale/sv-SE/pocket.properties b/browser/extensions/pocket/locale/sv-SE/pocket.properties deleted file mode 100644 index e01ac7373..000000000 --- a/browser/extensions/pocket/locale/sv-SE/pocket.properties +++ /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/. - -addtags = Lägg till etiketter -alreadyhaveacct = Redan en Pocket användare? -continueff = Fortsätt med Firefox\u0020 -errorgeneric = Ett fel upptäcktes då du försökte spara till Pocket. -learnmore = Läs mer -loginnow = Logga in -maxtaglength = Etiketter kan max vara 25 tecken -mustbeconnected = Du måste vara ansluten till internet för att kunna spara till Pocket. Kontrollera din anslutning och försök igen. -onlylinkssaved = Bara länkar kan sparas\u0020 -pagenotsaved = Sidan sparades inte\u0020 -pageremoved = Sidan borttagen -pagesaved = Spara till Pocket\u0020 -processingremove = Tar bort sida… -processingtags = Lägger till etiketter… -removepage = Ta bort sida -save = Spara -saving = Sparar… -signupemail = Registrera dig med din E-postadress -signuptosave = Registrera dig för Pocket. Det är gratis. -suggestedtags = Föreslagna etiketter -tagline = Spara artiklar och videor från Firefox för att visa i Pocket på vilken enhet som helst, när som helst. -taglinestory_one = Klicka på Pocket knappen för att spara vilken artikel, video eller sida som helst från Firefox.\u0020 -taglinestory_two = Visa i Pocket på vilken enhet som helst, när som helst.\u0020 -tagssaved = Etiketter Tillagda -tos = Genom att fortsätta godkänner du Pocket's <a href="%1$S" target="_blank">användarvillkor</a> och <a href="%2$S" target="_blank">sekretesspolicy</a> -tryitnow = Prova nu -signinfirefox = Logga in med Firefox\u0020 -signupfirefox = Registrera dig med Firefox\u0020 -viewlist = Visa lista - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Spara till Pocket -saveToPocketCmd.label = Spara sida till Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Spara Länk till Pocket -saveLinkToPocketCmd.accesskey = l -pocketMenuitem.label = Visa Pocket Lista\u0020 diff --git a/browser/extensions/pocket/locale/te/pocket.properties b/browser/extensions/pocket/locale/te/pocket.properties deleted file mode 100644 index 2e9552793..000000000 --- a/browser/extensions/pocket/locale/te/pocket.properties +++ /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/. - -addtags = టాగ్లను జోడించు -alreadyhaveacct = ఇప్పటికే ఒక పాకెట్ యూజర్? -continueff = ఫైర్ఫాక్స్ తో కొనసాగించుము -errorgeneric = పాకెట్ కు సేవ్ చేయడానికి ప్రయత్నిస్తున్నప్పుడు లోపం ఉంది. -learnmore = మరింత తెలుసుకోండి -loginnow = లాగ్ ఇన్ -maxtaglength = టాగ్లు 25 అక్షరాలకు పరిమితం చేయబడ్డాయి -mustbeconnected = మీరు పాకెట్ కు సేవ్ చేయడానికి ఇంటర్నెట్ కనెక్ట్ చేయక తప్పదు. మీ కనెక్షన్ను తనిఖీ చేసి, మళ్ళీ ప్రయత్నించండి. -onlylinkssaved = కేవలం లింకులు సేవ్ చేయవచ్చు -pagenotsaved = పేజీ సేవ్ చేయబడలేదు -pageremoved = పేజీ తీసివేయబడెను -pagesaved = పాకెట్ కు సేవ్ చేయబడింది -processingremove = పేజీని తొలగించు… -processingtags = టాగ్లు జోడిస్తోంది... -removepage = పేజీని తొలగించు -save = సేవ్ చేయి -saving = సేవ్ చేస్తోంది... -signupemail = ఇమెయిల్ తో సైన్అప్ అవ్వండ్ -signuptosave = పాకెట్ కోసం సైన్ అప్ చేయండి. ఇది ఉచితం. -suggestedtags = సూచించిన టాగ్లు -tagline = ఏ పరికరం, ఏ సమయం లో పాకెట్ వీక్షించడానికి Firefox నుండి వ్యాసాలు మరియు వీడియోలను సేవ్ చేయవచ్చు. -taglinestory_one = ఫైర్ఫాక్సు నుండి ఒక వ్యాసం, వీడియో లేదా పేజీ సేవ్ పాకెట్ బటన్ క్లిక్ చేయండి. -taglinestory_two = ఏ పరికరంలో అయినా, ఏ సమయంలో అయినా పాకెట్ లో చూడండి. -tagssaved = టాగ్లు చేర్చబడింది -tos = కొనసాగించడం ద్వారా, మీరు పాకెట్ యొక్క <a href="%1$S" target="_blank"> సేవా నిబంధనలు</a> మరియు <a href="%2$S" target="_blank"> గోప్యతా విధానము</a> ను అంగీకరిచబడుతారు -tryitnow = దీన్ని ఇప్పుడు ప్రయత్నించండి -signinfirefox = ఫైర్ఫాక్సుకు ప్రవేశించండి -signupfirefox = ఫైర్ఫాక్సుకు ప్రవేశించండి -viewlist = జాబితాను చూడండి - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = పాకెట్ -pocket-button.tooltiptext = పాకెట్ కు సేవ్ చేయండి -saveToPocketCmd.label = పాకెట్ కు సేవ్ చేయండి -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = పాకెట్ కు లింక్ ను సేవ్ చేయండి -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = పాకెట్ జాబితా చూడండి diff --git a/browser/extensions/pocket/locale/th/pocket.properties b/browser/extensions/pocket/locale/th/pocket.properties deleted file mode 100644 index 6cdf1c9ec..000000000 --- a/browser/extensions/pocket/locale/th/pocket.properties +++ /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/. - -addtags = เพิ่มป้ายกำกับ -alreadyhaveacct = เป็นผู้ใช้ Pocket อยู่แล้ว? -continueff = ดำเนินการต่อด้วย Firefox -errorgeneric = เกิดข้อผิดพลาดระหว่างการบันทึกไปยัง Pocket -learnmore = เรียนรู้เพิ่มเติม -loginnow = เข้าสู่ระบบ -maxtaglength = ป้ายกำกับถูกจำกัดไว้ที่ 25 ตัวอักษร -mustbeconnected = คุณต้องเชื่อมต่อกับอินเทอร์เน็ตก่อนที่จะบันทึก Pocket โปรดตรวจสอบการเชื่อมต่อของคุณและลองอีกครั้ง -onlylinkssaved = ลิงก์เท่านั้นที่สามารถถูกบันทึกได้ -pagenotsaved = หน้าไม่ถูกบันทึก -pageremoved = ลบหน้าแล้ว -pagesaved = บันทึกไปยัง Pocket -processingremove = กำลังลบหน้า… -processingtags = กำลังเพิ่มป้ายกำกับ… -removepage = ลบหน้า -save = บันทึก -saving = กำลังบันทึก… -signupemail = ลงทะเบียนด้วยอีเมล -signuptosave = ไม่มีค่าใช้จ่ายในการลงทะเบียน Pocket -suggestedtags = ป้ายกำกับที่ถูกแนะนำ -tagline = บันทึกบทความและวิดีโอจาก Firefox เพื่อดูใน Pocket บนอุปกรณ์ต่าง ๆ เวลาไหนก็ได้ -taglinestory_one = คลิกปุ่ม Pocket เพื่อบันทึกบทความ วิดีโอ หรือหน้าจาก Firefox -taglinestory_two = ดูใน Pocket บนอุปกรณ์ต่าง ๆ เวลาไหนก็ได้ -tagssaved = ป้ายกำกับถูกเพิ่มแล้ว -tos = หากตกลง หมายความว่า คุณยอมรับ<a href="%1$S" target="_blank">เงื่อนไขการให้บริการ</a> และ<a href="%2$S" target="_blank">นโยบายความเป็นส่วนตัว</a>ของ Pocket -tryitnow = ลองเลย -signinfirefox = ลงชื่อเข้าด้วย Firefox -signupfirefox = ลงทะเบียนกับ Firefox -viewlist = ดูรายการ - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = บันทึกไปยัง Pocket -saveToPocketCmd.label = บันทึกหน้าไปยัง Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = บันทึกลิงก์ไปยัง Pocket -saveLinkToPocketCmd.accesskey = ป -pocketMenuitem.label = ดูรายการ Pocket diff --git a/browser/extensions/pocket/locale/tr/pocket.properties b/browser/extensions/pocket/locale/tr/pocket.properties deleted file mode 100644 index ea1970a7d..000000000 --- a/browser/extensions/pocket/locale/tr/pocket.properties +++ /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/. - -addtags = Etiket ekle -alreadyhaveacct = Zaten Pocket kullanıcısı mısınız? -continueff = Firefox ile devam et -errorgeneric = Pocket’a kaydetmeye çalışırken bir hata oluştu. -learnmore = Daha fazla bilgi al -loginnow = Giriş yapın -maxtaglength = Etiketler en fazla 25 karakter olabilir -mustbeconnected = Pocket’a kaydetmek için internete bağlı olmalısınız. Lütfen bağlantınızı kontrol edip yeniden deneyin. -onlylinkssaved = Yalnızca bağlantılar kaydedilebilir -pagenotsaved = Sayfa kaydedilmedi -pageremoved = Sayfa silindi -pagesaved = Pocket’a kaydedildi -processingremove = Sayfa siliniyor… -processingtags = Etiketler ekleniyor… -removepage = Sayfayı sil -save = Kaydet -saving = Kaydediliyor… -signupemail = E-postayla kaydol -signuptosave = Pocket’a kaydolun. Ücretsiz! -suggestedtags = Önerilen etiketler -tagline = İstediğiniz cihazda, istediğiniz zaman görmek istediğiniz yazı ve videoları Firefox’tan Pocket’a kaydedin. -taglinestory_one = Firefox’ta istediğiniz yazıyı, videoyu veya sayfayı kaydetmek için Pocket düğmesine tıklayın. -taglinestory_two = İstediğiniz cihazda, istediğiniz zaman Pocket’tan bakın. -tagssaved = Etiketler eklendi -tos = Devam ederseniz Pocket'ın <a href="%1$S" target="_blank">Kullanım Koşullarını</a> ve <a href="%2$S" target="_blank">Gizlilik İlkelerini</a> kabul etmiş sayılırsınız -tryitnow = Hemen deneyin -signinfirefox = Firefox ile giriş yap -signupfirefox = Firefox ile kaydol -viewlist = Listeyi göster - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Pocket’a kaydet -saveToPocketCmd.label = Sayfayı Pocket’a kaydet -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = Bağlantıyı Pocket’a kaydet -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = Pocket listesini göster diff --git a/browser/extensions/pocket/locale/uk/pocket.properties b/browser/extensions/pocket/locale/uk/pocket.properties deleted file mode 100644 index d15049b2c..000000000 --- a/browser/extensions/pocket/locale/uk/pocket.properties +++ /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/. - -addtags = Додати мітки -alreadyhaveacct = Вже використовуєте Pocket? -continueff = Продовжити з Firefox -errorgeneric = При спробі збереження в Pocket сталася помилка. -learnmore = Докладніше -loginnow = Увійти -maxtaglength = Мітки мають обмеження до 25 символів -mustbeconnected = Для можливості збереження в Pocket ви повинні бути підключені до Інтернету. Перевірте своє з'єднання і спробуйте знову. -onlylinkssaved = Можна зберігати лише посилання -pagenotsaved = Сторінку не збережено -pageremoved = Сторінку вилучено -pagesaved = Збережено в Pocket -processingremove = Вилучення сторінки… -processingtags = Додавання міток… -removepage = Вилучити сторінку -save = Зберегти -saving = Збереження… -signupemail = Реєстрація за адресою електронної пошти -signuptosave = Зареєструйтеся в Pocket. Це безплатно. -suggestedtags = Пропоновані мітки -tagline = Зберігайте статті та відео з Firefox, щоб переглядати їх в Pocket на будь-якому пристрої та в будь-який час. -taglinestory_one = Натисніть кнопку Pocket для збереження будь-якої статті, відео чи сторінки з Firefox. -taglinestory_two = Переглядайте в Pocket на будь-якому пристрої та в будь-який час. -tagssaved = Мітки додано -tos = Продовжуючи, ви погоджуєтесь з <a href="%1$S" target="_blank">Умовами використання</a> і <a href="%2$S" target="_blank">Політикою приватності</a> -tryitnow = Спробувати зараз -signinfirefox = Увійти через Firefox -signupfirefox = Реєстрація через Firefox -viewlist = Перегляд списку - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = Зберегти в Pocket -saveToPocketCmd.label = Зберегти сторінку в Pocket -saveToPocketCmd.accesskey = З -saveLinkToPocketCmd.label = Зберегти посилання в Pocket -saveLinkToPocketCmd.accesskey = п -pocketMenuitem.label = Перегляд списку Pocket diff --git a/browser/extensions/pocket/locale/zh-CN/pocket.properties b/browser/extensions/pocket/locale/zh-CN/pocket.properties deleted file mode 100644 index e913887b8..000000000 --- a/browser/extensions/pocket/locale/zh-CN/pocket.properties +++ /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/. - -addtags = 添加标签 -alreadyhaveacct = 已有 Pocket 账号? -continueff = 使用 Firefox 继续 -errorgeneric = 尝试保存到 Pocket 时出错。 -learnmore = 详细了解 -loginnow = 登录 -maxtaglength = 标签不能超过 25 个字符 -mustbeconnected = 您必须已连接互联网才能保存到 Pocket。请检查您的连接,然后再试。 -onlylinkssaved = 只有链接能被保存 -pagenotsaved = 页面未保存 -pageremoved = 页面已移除 -pagesaved = 已保存到 Pocket -processingremove = 正在移除页面… -processingtags = 正在添加标签… -removepage = 移除页面 -save = 保存 -saving = 正在保存… -signupemail = 通过电子邮件注册 -signuptosave = 免费注册 Pocket。 -suggestedtags = 推荐标签 -tagline = 在 Firefox 上保存文章和视频,以供在任何时间、任何设备上用 Pocket 访问。 -taglinestory_one = 点击 Pocket 按钮保存 Firefox 上的任何文章、视频或页面。 -taglinestory_two = 在任何时间、任何设备上的 Pocket 中查看。 -tagssaved = 标签已添加 -tos = 继续则表示您同意 Pocket 的<a href="%1$S" target="_blank">服务条款</a>和<a href="%2$S" target="_blank">隐私政策</a> -tryitnow = 立即尝试 -signinfirefox = 使用 Firefox 登录 -signupfirefox = 使用 Firefox 注册 -viewlist = 查看列表 - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = 保存到 Pocket -saveToPocketCmd.label = 保存页面到 Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = 保存链接到 Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = 查看 Pocket 列表 diff --git a/browser/extensions/pocket/locale/zh-TW/pocket.properties b/browser/extensions/pocket/locale/zh-TW/pocket.properties deleted file mode 100644 index 02cf5223b..000000000 --- a/browser/extensions/pocket/locale/zh-TW/pocket.properties +++ /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/. - -addtags = 新增標籤 -alreadyhaveacct = 已經是 Pocket 使用者了嗎? -continueff = 使用 Firefox 繼續 -errorgeneric = 嘗試儲存至 Pocket 時發生錯誤。 -learnmore = 更多資訊 -loginnow = 登入 -maxtaglength = 標籤僅能有 25 字元 -mustbeconnected = 您必須連線至網際網路才能儲存至 Pocket。請檢查您的連線狀態後再試一次。 -onlylinkssaved = 僅能儲存鏈結 -pagenotsaved = 未儲存頁面 -pageremoved = 已移除頁面 -pagesaved = 已儲存至 Pocket -processingremove = 正在移除頁面… -processingtags = 正在新增標籤… -removepage = 移除頁面 -save = 儲存 -saving = 儲存中… -signupemail = 使用電子郵件地址註冊 -signuptosave = 免費註冊 Pocket 帳號。 -suggestedtags = 建議的標籤 -tagline = 隨時隨地在任何裝置上的 Firefox 來儲存文章與影片,稍後再用 Pocket 開啟。 -taglinestory_one = 在 Firefox 中點擊 Pocket 按鈕來儲存任何文章、影片或網頁。 -taglinestory_two = 隨時隨地在任何裝置上用 Pocket 檢視。 -tagssaved = 已新增標籤 -tos = 繼續使用就代表您同意 Pocket 的 <a href="%1$S" target="_blank">服務條款</a> 及 <a href="%2$S" target="_blank">隱私權保護政策</a> -tryitnow = 立刻試試 -signinfirefox = 使用 Firefox 登入 -signupfirefox = 使用 Firefox 註冊 -viewlist = 檢視清單 - -# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label): -# "Pocket" is a brand name. -pocket-button.label = Pocket -pocket-button.tooltiptext = 儲存至 Pocket -saveToPocketCmd.label = 將頁面儲存至 Pocket -saveToPocketCmd.accesskey = k -saveLinkToPocketCmd.label = 將鏈結儲存至 Pocket -saveLinkToPocketCmd.accesskey = o -pocketMenuitem.label = 檢視 Pocket 清單 diff --git a/browser/extensions/pocket/moz.build b/browser/extensions/pocket/moz.build deleted file mode 100644 index 52227bb8b..000000000 --- a/browser/extensions/pocket/moz.build +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -DIRS += ['locale'] - -FINAL_TARGET_FILES.features['firefox@getpocket.com'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['firefox@getpocket.com'] += [ - 'install.rdf.in' -] - -JAR_MANIFESTS += ['jar.mn'] diff --git a/browser/extensions/pocket/skin/linux/Toolbar-inverted.png b/browser/extensions/pocket/skin/linux/Toolbar-inverted.png Binary files differdeleted file mode 100644 index 68f5125ea..000000000 --- a/browser/extensions/pocket/skin/linux/Toolbar-inverted.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/Toolbar-inverted@2x.png b/browser/extensions/pocket/skin/linux/Toolbar-inverted@2x.png Binary files differdeleted file mode 100644 index 89056295c..000000000 --- a/browser/extensions/pocket/skin/linux/Toolbar-inverted@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/Toolbar.png b/browser/extensions/pocket/skin/linux/Toolbar.png Binary files differdeleted file mode 100644 index be9b0e6d2..000000000 --- a/browser/extensions/pocket/skin/linux/Toolbar.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/Toolbar@2x.png b/browser/extensions/pocket/skin/linux/Toolbar@2x.png Binary files differdeleted file mode 100644 index 5dc4e754a..000000000 --- a/browser/extensions/pocket/skin/linux/Toolbar@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/menuPanel.png b/browser/extensions/pocket/skin/linux/menuPanel.png Binary files differdeleted file mode 100644 index 55bc46cc9..000000000 --- a/browser/extensions/pocket/skin/linux/menuPanel.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/menuPanel@2x.png b/browser/extensions/pocket/skin/linux/menuPanel@2x.png Binary files differdeleted file mode 100644 index ad13ca4ce..000000000 --- a/browser/extensions/pocket/skin/linux/menuPanel@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/linux/pocket.css b/browser/extensions/pocket/skin/linux/pocket.css deleted file mode 100644 index 156964923..000000000 --- a/browser/extensions/pocket/skin/linux/pocket.css +++ /dev/null @@ -1,10 +0,0 @@ -@import url("chrome://pocket-shared/skin/pocket.css"); - -#nav-bar #pocket-button > .toolbarbutton-icon { - padding: 2px 6px; -} - -:-moz-any(#TabsToolbar, .widget-overflow-list) #pocket-button > .toolbarbutton-icon { - max-width: 18px; - padding: 0; -}
\ No newline at end of file diff --git a/browser/extensions/pocket/skin/osx/Toolbar-inverted.png b/browser/extensions/pocket/skin/osx/Toolbar-inverted.png Binary files differdeleted file mode 100644 index 0f4d57b4e..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar-inverted.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/Toolbar-inverted@2x.png b/browser/extensions/pocket/skin/osx/Toolbar-inverted@2x.png Binary files differdeleted file mode 100644 index 03c3b42d5..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar-inverted@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/Toolbar-yosemite.png b/browser/extensions/pocket/skin/osx/Toolbar-yosemite.png Binary files differdeleted file mode 100644 index 28602b186..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar-yosemite.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/Toolbar-yosemite@2x.png b/browser/extensions/pocket/skin/osx/Toolbar-yosemite@2x.png Binary files differdeleted file mode 100644 index 53040cb46..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar-yosemite@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/Toolbar.png b/browser/extensions/pocket/skin/osx/Toolbar.png Binary files differdeleted file mode 100644 index 1a8d7a51c..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/Toolbar@2x.png b/browser/extensions/pocket/skin/osx/Toolbar@2x.png Binary files differdeleted file mode 100644 index 91bf3ef6f..000000000 --- a/browser/extensions/pocket/skin/osx/Toolbar@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/menuPanel-yosemite.png b/browser/extensions/pocket/skin/osx/menuPanel-yosemite.png Binary files differdeleted file mode 100644 index 30b475cc0..000000000 --- a/browser/extensions/pocket/skin/osx/menuPanel-yosemite.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/menuPanel-yosemite@2x.png b/browser/extensions/pocket/skin/osx/menuPanel-yosemite@2x.png Binary files differdeleted file mode 100644 index 389d96ec7..000000000 --- a/browser/extensions/pocket/skin/osx/menuPanel-yosemite@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/menuPanel.png b/browser/extensions/pocket/skin/osx/menuPanel.png Binary files differdeleted file mode 100644 index d2bf61888..000000000 --- a/browser/extensions/pocket/skin/osx/menuPanel.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/menuPanel@2x.png b/browser/extensions/pocket/skin/osx/menuPanel@2x.png Binary files differdeleted file mode 100644 index f58afbc4d..000000000 --- a/browser/extensions/pocket/skin/osx/menuPanel@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/osx/pocket.css b/browser/extensions/pocket/skin/osx/pocket.css deleted file mode 100644 index 534a881a5..000000000 --- a/browser/extensions/pocket/skin/osx/pocket.css +++ /dev/null @@ -1,42 +0,0 @@ -@import url("chrome://pocket-shared/skin/pocket.css"); - -#pocket-button[cui-areatype="toolbar"] > .toolbarbutton-icon { - max-width: 18px; - margin: 0; -} - -#pocket-button[cui-areatype="toolbar"][open] { - -moz-image-region: rect(36px, 18px, 54px, 0); -} - -@media (min-resolution: 2dppx) { - #panelMenu_pocket, - #menu_pocket, - #BMB_pocket { - list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16@2x.png"); - } - - #panelMenu_pocket > .toolbarbutton-icon { - width: 16px; - } -} - -@media not all and (min-resolution: 1.1dppx) { - #pocket-button:hover:active:not([disabled="true"]):not([cui-areatype="menu-panel"]) { - -moz-image-region: rect(18px, 18px, 36px, 0); - } -} - -@media (min-resolution: 1.1dppx) { - #pocket-button[cui-areatype="toolbar"][open] { - -moz-image-region: rect(72px, 36px, 108px, 0); - } - - #pocket-button:hover:active:not([disabled="true"]):not([cui-areatype="menu-panel"]) { - -moz-image-region: rect(36px, 36px, 72px, 0); - } -} - -#PanelUI-pocketView[mainview=true] > .panel-subview-body > #pocket-panel-iframe { - border-radius: var(--arrowpanel-border-radius); -} diff --git a/browser/extensions/pocket/skin/shared/pocket.css b/browser/extensions/pocket/skin/shared/pocket.css deleted file mode 100644 index ec46e1890..000000000 --- a/browser/extensions/pocket/skin/shared/pocket.css +++ /dev/null @@ -1,79 +0,0 @@ -/* Bug 1164419 - increase Pocket panel size to accomidate wider Russian text. */ -panelmultiview[mainViewId=PanelUI-pocketView] > .panel-viewcontainer > .panel-viewstack > .panel-mainview:not([panelid="PanelUI-popup"]) { - max-width: 33em; /* standaloneSubviewWidth + 3 */ -} - -.cui-widget-panel[viewId="PanelUI-pocketView"] > .panel-arrowcontainer > .panel-arrowcontent { - padding-top: 0; - padding-bottom: 0; -} - -#PanelUI-pocketView > .panel-subview-body, -#PanelUI-pocketView { - overflow: visible; -} - -#pocket-button { - list-style-image: url("chrome://pocket/skin/Toolbar.png"); - -moz-image-region: rect(0, 18px, 18px, 0); -} - -toolbar[brighttext] #pocket-button { - list-style-image: url(chrome://pocket/skin/Toolbar-inverted.png); -} - -@media not all and (min-resolution: 1.1dppx) { - #pocket-button[cui-areatype="menu-panel"], - toolbarpaletteitem[place="palette"] > #pocket-button { - list-style-image: url(chrome://pocket/skin/menuPanel.png); - -moz-image-region: rect(0, 32px, 32px, 0); - } - - #pocket-button[cui-areatype="menu-panel"][panel-multiview-anchor=true] { - -moz-image-region: rect(32px, 32px, 64px, 0); - } -} - -@media (min-resolution: 1.1dppx) { - #pocket-button[cui-areatype="menu-panel"], - toolbarpaletteitem[place="palette"] > #pocket-button { - list-style-image: url(chrome://pocket/skin/menuPanel@2x.png); - -moz-image-region: rect(0px, 64px, 64px, 0); - } - - #pocket-button[cui-areatype="menu-panel"][panel-multiview-anchor=true] { - -moz-image-region: rect(64px, 64px, 128px, 0); - } -} - -#pocket-button[cui-areatype="toolbar"] { - -moz-image-region: rect(0, 18px, 18px, 0); -} - -#pocket-button[cui-areatype="toolbar"][open] { - -moz-image-region: rect(18px, 18px, 36px, 0); -} - -@media (min-resolution: 1.1dppx) { - #pocket-button { - list-style-image: url("chrome://pocket/skin/Toolbar@2x.png"); - } - - toolbar[brighttext] #pocket-button { - list-style-image: url("chrome://pocket/skin/Toolbar-inverted@2x.png"); - } - - #pocket-button[cui-areatype="toolbar"] { - -moz-image-region: rect(0, 36px, 36px, 0px); - } - - #pocket-button[cui-areatype="toolbar"][open] { - -moz-image-region: rect(36px, 36px, 72px, 0px); - } -} - -#panelMenu_pocket, -#menu_pocket, -#BMB_pocket { - list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16.png"); -} diff --git a/browser/extensions/pocket/skin/windows/Toolbar-XP.png b/browser/extensions/pocket/skin/windows/Toolbar-XP.png Binary files differdeleted file mode 100644 index 9220a207f..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-XP.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-aero.png b/browser/extensions/pocket/skin/windows/Toolbar-aero.png Binary files differdeleted file mode 100644 index 7b373acb9..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-aero.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-aero@2x.png b/browser/extensions/pocket/skin/windows/Toolbar-aero@2x.png Binary files differdeleted file mode 100644 index 6e83dcc60..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-aero@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-inverted.png b/browser/extensions/pocket/skin/windows/Toolbar-inverted.png Binary files differdeleted file mode 100644 index 70e95f464..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-inverted.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-inverted@2x.png b/browser/extensions/pocket/skin/windows/Toolbar-inverted@2x.png Binary files differdeleted file mode 100644 index ba0b7e2af..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-inverted@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-lunaSilver.png b/browser/extensions/pocket/skin/windows/Toolbar-lunaSilver.png Binary files differdeleted file mode 100644 index 5afe7ca44..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-lunaSilver.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-win8.png b/browser/extensions/pocket/skin/windows/Toolbar-win8.png Binary files differdeleted file mode 100644 index 208dc03ae..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-win8.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar-win8@2x.png b/browser/extensions/pocket/skin/windows/Toolbar-win8@2x.png Binary files differdeleted file mode 100644 index 3704f0885..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar-win8@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar.png b/browser/extensions/pocket/skin/windows/Toolbar.png Binary files differdeleted file mode 100644 index 4801961f8..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/Toolbar@2x.png b/browser/extensions/pocket/skin/windows/Toolbar@2x.png Binary files differdeleted file mode 100644 index f3a1cc738..000000000 --- a/browser/extensions/pocket/skin/windows/Toolbar@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/menuPanel-aero.png b/browser/extensions/pocket/skin/windows/menuPanel-aero.png Binary files differdeleted file mode 100644 index 459e82634..000000000 --- a/browser/extensions/pocket/skin/windows/menuPanel-aero.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/menuPanel-aero@2x.png b/browser/extensions/pocket/skin/windows/menuPanel-aero@2x.png Binary files differdeleted file mode 100644 index eef525741..000000000 --- a/browser/extensions/pocket/skin/windows/menuPanel-aero@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/menuPanel.png b/browser/extensions/pocket/skin/windows/menuPanel.png Binary files differdeleted file mode 100644 index 55bc46cc9..000000000 --- a/browser/extensions/pocket/skin/windows/menuPanel.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/menuPanel@2x.png b/browser/extensions/pocket/skin/windows/menuPanel@2x.png Binary files differdeleted file mode 100644 index ad13ca4ce..000000000 --- a/browser/extensions/pocket/skin/windows/menuPanel@2x.png +++ /dev/null diff --git a/browser/extensions/pocket/skin/windows/pocket.css b/browser/extensions/pocket/skin/windows/pocket.css deleted file mode 100644 index 011b821a9..000000000 --- a/browser/extensions/pocket/skin/windows/pocket.css +++ /dev/null @@ -1,16 +0,0 @@ -@import url("chrome://pocket-shared/skin/pocket.css"); - -#nav-bar #pocket-button > .toolbarbutton-icon { - padding: calc(var(--toolbarbutton-vertical-inner-padding)) 6px; -} - -:-moz-any(#TabsToolbar, .widget-overflow-list) #pocket-button > .toolbarbutton-icon { - max-width: 18px; - padding: 0; -} - -@media (-moz-windows-theme: luna-silver) and (max-resolution: 1dppx) { - #pocket-button { - list-style-image: url(Toolbar-lunaSilver.png); - } -} diff --git a/browser/extensions/webcompat/bootstrap.js b/browser/extensions/webcompat/bootstrap.js deleted file mode 100644 index 19141a0f5..000000000 --- a/browser/extensions/webcompat/bootstrap.js +++ /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/. */ - -"use strict"; -function startup() {} -function shutdown() {} -function install() {} -function uninstall() {} diff --git a/browser/extensions/webcompat/install.rdf.in b/browser/extensions/webcompat/install.rdf.in deleted file mode 100644 index 2c4406f25..000000000 --- a/browser/extensions/webcompat/install.rdf.in +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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/. --> - -#filter substitution - -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:em="http://www.mozilla.org/2004/em-rdf#"> - - <Description about="urn:mozilla:install-manifest"> - <em:id>webcompat@mozilla.org</em:id> - <em:version>1.0</em:version> - <em:type>2</em:type> - <em:bootstrap>true</em:bootstrap> - <em:multiprocessCompatible>true</em:multiprocessCompatible> - - <!-- Target Application this extension can install into, - with minimum and maximum supported versions. --> - <em:targetApplication> - <Description> - <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> - <em:minVersion>@MOZ_APP_VERSION@</em:minVersion> - <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion> - </Description> - </em:targetApplication> - - <!-- Front End MetaData --> - <em:name>Web Compat</em:name> - <em:description>Urgent post-release fixes for web compatibility.</em:description> - </Description> -</RDF> diff --git a/browser/extensions/webcompat/moz.build b/browser/extensions/webcompat/moz.build deleted file mode 100644 index 7d592013b..000000000 --- a/browser/extensions/webcompat/moz.build +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION'] - -FINAL_TARGET_FILES.features['webcompat@mozilla.org'] += [ - 'bootstrap.js' -] - -FINAL_TARGET_PP_FILES.features['webcompat@mozilla.org'] += [ - 'install.rdf.in' -] diff --git a/browser/fonts/EmojiOneMozilla.ttf b/browser/fonts/EmojiOneMozilla.ttf Binary files differdeleted file mode 100644 index 50356509d..000000000 --- a/browser/fonts/EmojiOneMozilla.ttf +++ /dev/null diff --git a/browser/fonts/README.txt b/browser/fonts/README.txt index 188ea3fff..ac1f6d9de 100644 --- a/browser/fonts/README.txt +++ b/browser/fonts/README.txt @@ -1,9 +1,9 @@ -EmojiOne Mozilla +Twemoji Mozilla ================ -The upstream repository of EmojiOne Mozilla can be found at +The upstream repository of Twemoji Mozilla can be found at - https://github.com/mozilla/emojione-colr + https://github.com/mozilla/twemoji-colr Please refer commit history for the current version of the font. This file purposely omit the version, so there is no need to update it here. diff --git a/browser/fonts/TwemojiMozilla.ttf b/browser/fonts/TwemojiMozilla.ttf Binary files differnew file mode 100644 index 000000000..1933891d9 --- /dev/null +++ b/browser/fonts/TwemojiMozilla.ttf diff --git a/browser/fonts/moz.build b/browser/fonts/moz.build index b1a43e528..5cb98333b 100644 --- a/browser/fonts/moz.build +++ b/browser/fonts/moz.build @@ -7,5 +7,5 @@ if CONFIG['OS_ARCH'] in ('WINNT', 'Linux'): DIST_SUBDIR = '' FINAL_TARGET_FILES.fonts += [ - 'EmojiOneMozilla.ttf' + 'TwemojiMozilla.ttf' ] diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 015daa8c7..5540feed9 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -374,8 +374,6 @@ @RESPATH@/browser/components/devtools-startup.js @RESPATH@/browser/components/webideCli.js @RESPATH@/browser/components/webideComponents.manifest -@RESPATH@/browser/components/Experiments.manifest -@RESPATH@/browser/components/ExperimentsService.js @RESPATH@/browser/components/browser-newtab.xpt @RESPATH@/browser/components/aboutNewTabService.js @RESPATH@/browser/components/NewTabComponents.manifest @@ -781,28 +779,6 @@ bin/libfreebl_32int64_3.so @BINPATH@/maintenanceservice_installer.exe #endif -; [Crash Reporter] -; -#ifdef MOZ_CRASHREPORTER -@RESPATH@/components/CrashService.manifest -@RESPATH@/components/CrashService.js -@RESPATH@/components/toolkit_crashservice.xpt -#ifdef XP_MACOSX -@BINPATH@/crashreporter.app/ -#else -@BINPATH@/crashreporter@BIN_SUFFIX@ -@BINPATH@/minidump-analyzer@BIN_SUFFIX@ -@RESPATH@/crashreporter.ini -#ifdef XP_UNIX -@RESPATH@/Throbber-small.gif -#endif -#endif -@RESPATH@/browser/crashreporter-override.ini -#ifdef MOZ_CRASHREPORTER_INJECTOR -@BINPATH@/breakpadinjector.dll -#endif -#endif - @RESPATH@/components/dom_audiochannel.xpt ; Shutdown Terminator diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in index b3ecfd359..b8aee0f14 100644 --- a/browser/locales/Makefile.in +++ b/browser/locales/Makefile.in @@ -61,10 +61,10 @@ STUB_HOOK = $(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'; \ $(NULL) endif -SEARCHPLUGINS_FILENAMES := $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD))) +SEARCHPLUGINS_FILENAMES := $(or $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD))), $(error Missing search plugins)) SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD) SEARCHPLUGINS_TARGET := libs searchplugins -SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(warning Missing searchplugin: $(plugin)))) +SEARCHPLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCHPLUGINS_FILENAMES)),$(or $(wildcard $(srcdir)/searchplugins/$(plugin)),$(error Missing searchplugin: $(plugin)))) # Some locale-specific search plugins may have preprocessor directives, but the # default en-US ones do not. SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings @@ -165,11 +165,6 @@ else endif endif -ifdef MOZ_CRASHREPORTER -libs:: crashreporter-override.ini - $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) -endif - ident: @printf 'fx_revision ' @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \ diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index 6f3aab397..31f61632b 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -85,11 +85,14 @@ addonInstallError-2=The add-on could not be installed because it does not match addonInstallError-3=The add-on downloaded from this site could not be installed because it appears to be corrupt. addonInstallError-4=%2$S could not be installed because %1$S cannot modify the needed file. addonInstallError-5=%1$S has prevented this site from installing an unverified add-on. +addonInstallError-9=%2$S could not be installed because %1$S does not support WebExtensions. addonLocalInstallError-1=This add-on could not be installed because of a filesystem error. addonLocalInstallError-2=This add-on could not be installed because it does not match the add-on %1$S expected. addonLocalInstallError-3=This add-on could not be installed because it appears to be corrupt. addonLocalInstallError-4=%2$S could not be installed because %1$S cannot modify the needed file. addonLocalInstallError-5=This add-on could not be installed because it has not been verified. +addonLocalInstallError-9=%2$S could not be installed because %1$S does not support WebExtensions. + # LOCALIZATION NOTE (addonInstallErrorIncompatible): # %1$S is the application name, %2$S is the application version, %3$S is the add-on name diff --git a/browser/locales/en-US/firefox-l10n.js b/browser/locales/en-US/firefox-l10n.js index c1e5510f3..642ad6534 100644 --- a/browser/locales/en-US/firefox-l10n.js +++ b/browser/locales/en-US/firefox-l10n.js @@ -4,8 +4,4 @@ #filter substitution -# LOCALIZATION NOTE: this preference is set to true for en-US specifically, -# locales without this line have the setting set to false by default. -pref("browser.search.geoSpecificDefaults", true); - pref("general.useragent.locale", "@AB_CD@"); diff --git a/browser/locales/search/list.json b/browser/locales/search/list.json index 9f7d82b4e..722f3186f 100644 --- a/browser/locales/search/list.json +++ b/browser/locales/search/list.json @@ -5,36 +5,6 @@ ] }, "regionOverrides": { - "US": { - "google": "google-nocodes" - }, - "CA": { - "google": "google-nocodes" - }, - "KZ": { - "google": "google-nocodes" - }, - "BY": { - "google": "google-nocodes" - }, - "RU": { - "google": "google-nocodes" - }, - "TR": { - "google": "google-nocodes" - }, - "UA": { - "google": "google-nocodes" - }, - "CN": { - "google": "google-nocodes" - }, - "TW": { - "google": "google-nocodes" - }, - "HK": { - "google": "google-nocodes" - } }, "locales": { "en-US": { diff --git a/browser/modules/AboutHome.jsm b/browser/modules/AboutHome.jsm index 01cbafba9..639194c20 100644 --- a/browser/modules/AboutHome.jsm +++ b/browser/modules/AboutHome.jsm @@ -24,17 +24,10 @@ XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); -// Url to fetch snippets, in the urlFormatter service format. -const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl"; - -// Should be bumped up if the snippets content format changes. -const STARTPAGE_VERSION = 4; +// Should be bumped up if any data content format changes. +const STARTPAGE_VERSION = 5; this.AboutHomeUtils = { - get snippetsVersion() { - return STARTPAGE_VERSION; - }, - /* * showKnowYourRights - Determines if the user should be shown the * about:rights notification. The notification should *not* be shown if @@ -54,7 +47,7 @@ this.AboutHomeUtils = { return !Services.prefs.getBoolPref("browser.EULA.override"); } catch (e) { } - if (!AppConstants.MOZILLA_OFFICIAL) { + if (!AppConstants.MC_OFFICIAL) { // Non-official builds shouldn't show the notification. return false; } @@ -77,16 +70,6 @@ this.AboutHomeUtils = { }; /** - * Returns the URL to fetch snippets from, in the urlFormatter service format. - */ -XPCOMUtils.defineLazyGetter(AboutHomeUtils, "snippetsURL", function() { - let updateURL = Services.prefs - .getCharPref(SNIPPETS_URL_PREF) - .replace("%STARTPAGE_VERSION%", STARTPAGE_VERSION); - return Services.urlFormatter.formatURL(updateURL); -}); - -/** * This code provides services to the about:home page. Whenever * about:home needs to do something chrome-privileged, it sends a * message that's handled here. @@ -169,9 +152,7 @@ var AboutHome = { ss.promiseInitialized.then(function() { let data = { showRestoreLastSession: ss.canRestoreLastSession, - snippetsURL: AboutHomeUtils.snippetsURL, - showKnowYourRights: AboutHomeUtils.showKnowYourRights, - snippetsVersion: AboutHomeUtils.snippetsVersion, + showKnowYourRights: AboutHomeUtils.showKnowYourRights }; if (AboutHomeUtils.showKnowYourRights) { diff --git a/browser/modules/ContentCrashHandlers.jsm b/browser/modules/ContentCrashHandlers.jsm index 2f755d142..488cc4f26 100644 --- a/browser/modules/ContentCrashHandlers.jsm +++ b/browser/modules/ContentCrashHandlers.jsm @@ -90,8 +90,6 @@ this.TabCrashHandler = { Services.telemetry .getHistogramById("FX_CONTENT_CRASH_DUMP_UNAVAILABLE") .add(1); - } else if (AppConstants.MOZ_CRASHREPORTER) { - this.childMap.set(childID, dumpID); } if (!this.flushCrashedBrowserQueue(childID)) { @@ -115,15 +113,6 @@ this.TabCrashHandler = { } } - // check for environment affecting crash reporting - let env = Cc["@mozilla.org/process/environment;1"] - .getService(Ci.nsIEnvironment); - let shutdown = env.exists("MOZ_CRASHREPORTER_SHUTDOWN"); - - if (shutdown) { - Services.startup.quit(Ci.nsIAppStartup.eForceQuit); - } - break; } case "oop-frameloader-crashed": { @@ -306,105 +295,10 @@ this.TabCrashHandler = { /** * Submits a crash report from about:tabcrashed, if the crash * reporter is enabled and a crash report can be found. - * - * @param aBrowser - * The <xul:browser> that the report was sent from. - * @param aFormData - * An Object with the following properties: - * - * includeURL (bool): - * Whether to include the URL that the user was on - * in the crashed tab before the crash occurred. - * URL (String) - * The URL that the user was on in the crashed tab - * before the crash occurred. - * emailMe (bool): - * Whether or not to include the user's email address - * in the crash report. - * email (String): - * The email address of the user. - * comments (String): - * Any additional comments from the user. - * - * Note that it is expected that all properties are set, - * even if they are empty. */ maybeSendCrashReport(message) { - if (!AppConstants.MOZ_CRASHREPORTER) { - return; - } - - if (!message.data.hasReport) { - // There was no report, so nothing to do. - return; - } - - let browser = message.target.browser; - - if (message.data.autoSubmit) { - // The user has opted in to autosubmitted backlogged - // crash reports in the future. - UnsubmittedCrashHandler.autoSubmit = true; - } - - let childID = this.browserMap.get(browser.permanentKey); - let dumpID = this.childMap.get(childID); - if (!dumpID) { - return; - } - - if (!message.data.sendReport) { - Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1); - this.prefs.setBoolPref("sendReport", false); - return; - } - - let { - includeURL, - comments, - email, - emailMe, - URL, - } = message.data; - - let extraExtraKeyVals = { - "Comments": comments, - "Email": email, - "URL": URL, - }; - - // For the entries in extraExtraKeyVals, we only want to submit the - // extra data values where they are not the empty string. - for (let key in extraExtraKeyVals) { - let val = extraExtraKeyVals[key].trim(); - if (!val) { - delete extraExtraKeyVals[key]; - } - } - - // URL is special, since it's already been written to extra data by - // default. In order to make sure we don't send it, we overwrite it - // with the empty string. - if (!includeURL) { - extraExtraKeyVals["URL"] = ""; - } - - CrashSubmit.submit(dumpID, { - recordSubmission: true, - extraExtraKeyVals, - }).then(null, Cu.reportError); - - this.prefs.setBoolPref("sendReport", true); - this.prefs.setBoolPref("includeURL", includeURL); - this.prefs.setBoolPref("emailMe", emailMe); - if (emailMe) { - this.prefs.setCharPref("email", email); - } else { - this.prefs.setCharPref("email", ""); - } - - this.childMap.set(childID, null); // Avoid resubmission. - this.removeSubmitCheckboxesForSameCrash(childID); + /*** STUB ***/ + return; }, removeSubmitCheckboxesForSameCrash: function(childID) { @@ -518,17 +412,10 @@ this.TabCrashHandler = { /** * For some <xul:browser>, return a crash report dump ID for that browser * if we have been informed of one. Otherwise, return null. - * - * @param browser (<xul:browser) - * The browser to try to get the dump ID for - * @returns dumpID (String) */ getDumpID(browser) { - if (!AppConstants.MOZ_CRASHREPORTER) { - return null; - } - - return this.childMap.get(this.browserMap.get(browser.permanentKey)); + /*** STUB ***/ + return null; }, } diff --git a/browser/modules/ContentWebRTC.jsm b/browser/modules/ContentWebRTC.jsm index bfb98a868..fd50176a0 100644 --- a/browser/modules/ContentWebRTC.jsm +++ b/browser/modules/ContentWebRTC.jsm @@ -208,6 +208,7 @@ function prompt(aContentWindow, aWindowID, aCallID, aConstraints, aDevices, aSec let request = { callID: aCallID, windowID: aWindowID, + origin: aContentWindow.origin, documentURI: aContentWindow.document.documentURI, secure: aSecure, requestTypes: requestTypes, diff --git a/browser/modules/PluginContent.jsm b/browser/modules/PluginContent.jsm index 1bbfa9a50..622d608bc 100644 --- a/browser/modules/PluginContent.jsm +++ b/browser/modules/PluginContent.jsm @@ -660,30 +660,8 @@ PluginContent.prototype = { }, submitReport: function submitReport(plugin) { - if (!AppConstants.MOZ_CRASHREPORTER) { - return; - } - if (!plugin) { - Cu.reportError("Attempted to submit crash report without an associated plugin."); - return; - } - if (!(plugin instanceof Ci.nsIObjectLoadingContent)) { - Cu.reportError("Attempted to submit crash report on plugin that does not" + - "implement nsIObjectLoadingContent."); - return; - } - - let runID = plugin.runID; - let submitURLOptIn = this.getPluginUI(plugin, "submitURLOptIn").checked; - let keyVals = {}; - let userComment = this.getPluginUI(plugin, "submitComment").value.trim(); - if (userComment) - keyVals.PluginUserComment = userComment; - if (submitURLOptIn) - keyVals.PluginContentURL = plugin.ownerDocument.URL; - - this.global.sendAsyncMessage("PluginContent:SubmitReport", - { runID, keyVals, submitURLOptIn }); + /*** STUB ***/ + return; }, reloadPage: function () { diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm index b24135bfc..08de46bb3 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -290,7 +290,13 @@ function prompt(aBrowser, aRequest) { let {audioDevices: audioDevices, videoDevices: videoDevices, sharingScreen: sharingScreen, sharingAudio: sharingAudio, requestTypes: requestTypes} = aRequest; - let uri = Services.io.newURI(aRequest.documentURI, null, null); + let uri; + try { + // This fails for principals that serialize to "null", e.g. file URIs. + uri = Services.io.newURI(aRequest.origin, null, null); + } catch (e) { + uri = Services.io.newURI(aRequest.documentURI, null, null); + } let host = getHost(uri); let chromeDoc = aBrowser.ownerDocument; let chromeWin = chromeDoc.defaultView; diff --git a/browser/moz.build b/browser/moz.build index a691aeef2..0985148c0 100644 --- a/browser/moz.build +++ b/browser/moz.build @@ -11,7 +11,6 @@ SPHINX_TREES['browser'] = 'docs' DIRS += [ 'base', 'components', - 'experiments', 'fonts', 'locales', 'modules', diff --git a/browser/moz.configure b/browser/moz.configure index fba4603be..d5e7dba11 100644 --- a/browser/moz.configure +++ b/browser/moz.configure @@ -4,9 +4,4 @@ # 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/. -imply_option('MOZ_PLACES', True) -imply_option('MOZ_SERVICES_HEALTHREPORT', True) -imply_option('MOZ_SERVICES_SYNC', True) -imply_option('MOZ_SERVICES_CLOUDSYNC', True) - include('../toolkit/moz.configure') diff --git a/browser/themes/osx/shared.inc b/browser/themes/osx/shared.inc index b3ea4e199..3076450e2 100644 --- a/browser/themes/osx/shared.inc +++ b/browser/themes/osx/shared.inc @@ -1,4 +1,4 @@ -%include ../../../toolkit/themes/osx/global/shared.inc
+%include ../../../../toolkit/themes/osx/global/shared.inc
%include ../shared/browser.inc
%filter substitution
|