summaryrefslogtreecommitdiffstats
path: root/application/basilisk
diff options
context:
space:
mode:
Diffstat (limited to 'application/basilisk')
-rw-r--r--application/basilisk/app/Makefile.in2
-rw-r--r--application/basilisk/app/macbuild/Contents/Info.plist.in4
-rw-r--r--application/basilisk/app/profile/basilisk.js16
-rw-r--r--application/basilisk/base/content/browser-fullScreenAndPointerLock.js3
-rw-r--r--application/basilisk/base/content/browser-fxaccounts.js173
-rw-r--r--application/basilisk/base/content/browser-gestureSupport.js10
-rw-r--r--application/basilisk/base/content/browser-syncui.js82
-rw-r--r--application/basilisk/base/content/browser.css5
-rw-r--r--application/basilisk/base/content/browser.js37
-rw-r--r--application/basilisk/base/content/browser.xul7
-rw-r--r--application/basilisk/base/content/sanitize.js55
-rw-r--r--application/basilisk/base/content/sync/quota.js247
-rw-r--r--application/basilisk/base/content/sync/quota.xul65
-rw-r--r--application/basilisk/base/content/tab-content.js7
-rw-r--r--application/basilisk/base/content/tabbrowser.xml63
-rw-r--r--application/basilisk/base/content/web-panels.xul15
-rw-r--r--application/basilisk/base/jar.mn2
-rw-r--r--application/basilisk/branding/official/branding.nsi38
-rw-r--r--application/basilisk/branding/official/disk.icnsbin459117 -> 41448 bytes
-rw-r--r--application/basilisk/branding/official/document.icnsbin660004 -> 39113 bytes
-rw-r--r--application/basilisk/branding/official/firefox.icnsbin801511 -> 39138 bytes
-rw-r--r--application/basilisk/branding/unofficial/branding.nsi35
-rw-r--r--application/basilisk/components/customizableui/CustomizableWidgets.jsm73
-rw-r--r--application/basilisk/components/customizableui/content/panelUI.inc.xul7
-rw-r--r--application/basilisk/components/migration/AutoMigrate.jsm18
-rw-r--r--application/basilisk/components/migration/MigrationUtils.jsm16
-rw-r--r--application/basilisk/components/migration/content/migration.xul6
-rw-r--r--application/basilisk/components/places/content/history-panel.js7
-rw-r--r--application/basilisk/components/places/content/places.js3
-rw-r--r--application/basilisk/components/preferences/in-content/content.js31
-rw-r--r--application/basilisk/components/preferences/in-content/content.xul24
-rw-r--r--application/basilisk/components/preferences/in-content/sync.js119
-rw-r--r--application/basilisk/components/preferences/in-content/sync.xul8
-rw-r--r--application/basilisk/components/preferences/jar.mn2
-rw-r--r--application/basilisk/components/preferences/translation.js255
-rw-r--r--application/basilisk/components/preferences/translation.xul88
-rw-r--r--application/basilisk/components/sessionstore/SessionFile.jsm2
-rw-r--r--application/basilisk/components/sessionstore/SessionSaver.jsm16
-rw-r--r--application/basilisk/components/sessionstore/SessionStorage.jsm9
-rw-r--r--application/basilisk/components/sessionstore/SessionStore.jsm16
-rw-r--r--application/basilisk/components/sessionstore/TabAttributes.jsm5
-rw-r--r--application/basilisk/components/sessionstore/nsSessionStartup.js1
-rw-r--r--application/basilisk/components/translation/BingTranslator.jsm449
-rw-r--r--application/basilisk/components/translation/Translation.jsm446
-rw-r--r--application/basilisk/components/translation/TranslationContentHandler.jsm181
-rw-r--r--application/basilisk/components/translation/TranslationDocument.jsm683
-rw-r--r--application/basilisk/components/translation/YandexTranslator.jsm343
-rw-r--r--application/basilisk/components/translation/jar.mn6
-rw-r--r--application/basilisk/components/translation/microsoft-translator-attribution.pngbin3422 -> 0 bytes
-rw-r--r--application/basilisk/components/translation/moz.build7
-rw-r--r--application/basilisk/components/translation/translation-infobar.xml441
-rw-r--r--application/basilisk/confvars.sh8
-rw-r--r--application/basilisk/installer/package-manifest.in11
-rw-r--r--application/basilisk/installer/windows/Makefile.in4
-rw-r--r--application/basilisk/installer/windows/nsis/defines.nsi.in27
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/browser.dtd7
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd15
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties6
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd6
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd1
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd24
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd2
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd2
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/translation.dtd75
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/translation.properties12
-rw-r--r--application/basilisk/locales/en-US/installer/nsisstrings.properties67
-rw-r--r--application/basilisk/locales/jar.mn3
-rw-r--r--application/basilisk/themes/linux/browser.css74
-rw-r--r--application/basilisk/themes/linux/preferences/preferences.css6
-rw-r--r--application/basilisk/themes/osx/browser.css133
-rw-r--r--application/basilisk/themes/osx/preferences/preferences.css5
-rw-r--r--application/basilisk/themes/shared/jar.inc.mn4
-rw-r--r--application/basilisk/themes/shared/notification-icons.inc.css24
-rw-r--r--application/basilisk/themes/shared/translation/infobar.inc.css95
-rw-r--r--application/basilisk/themes/shared/translation/translating-16.pngbin21270 -> 0 bytes
-rw-r--r--application/basilisk/themes/shared/translation/translating-16@2x.pngbin29889 -> 0 bytes
-rw-r--r--application/basilisk/themes/shared/translation/translation-16.pngbin889 -> 0 bytes
-rw-r--r--application/basilisk/themes/shared/translation/translation-16@2x.pngbin2076 -> 0 bytes
-rw-r--r--application/basilisk/themes/windows/browser.css81
-rw-r--r--application/basilisk/themes/windows/preferences/preferences.css7
80 files changed, 487 insertions, 4340 deletions
diff --git a/application/basilisk/app/Makefile.in b/application/basilisk/app/Makefile.in
index 4a3b9758e..83d6cb36a 100644
--- a/application/basilisk/app/Makefile.in
+++ b/application/basilisk/app/Makefile.in
@@ -87,8 +87,10 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME)
rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) $(dist_dest)/Contents/MacOS
cp -RL $(DIST)/branding/firefox.icns $(dist_dest)/Contents/Resources/firefox.icns
cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns
+ifdef MOZ_UPDATER
$(MKDIR) -p $(dist_dest)/Contents/Library/LaunchServices
mv -f $(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater $(dist_dest)/Contents/Library/LaunchServices
ln -s ../../../../Library/LaunchServices/org.mozilla.updater $(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater
+endif
printf APPLMOZB > $(dist_dest)/Contents/PkgInfo
endif
diff --git a/application/basilisk/app/macbuild/Contents/Info.plist.in b/application/basilisk/app/macbuild/Contents/Info.plist.in
index d6902fffd..3f9380606 100644
--- a/application/basilisk/app/macbuild/Contents/Info.plist.in
+++ b/application/basilisk/app/macbuild/Contents/Info.plist.in
@@ -143,7 +143,7 @@
</dict>
</array>
<key>CFBundleExecutable</key>
- <string>firefox</string>
+ <string>basilisk</string>
<key>CFBundleGetInfoString</key>
<string>%MAC_APP_NAME% %APP_VERSION%</string>
<key>CFBundleIconFile</key>
@@ -213,7 +213,7 @@
<key>LSFileQuarantineEnabled</key>
<true/>
<key>LSMinimumSystemVersion</key>
- <string>10.9.0</string>
+ <string>10.7.0</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSPrincipalClass</key>
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
index 2df95a97f..cff5f599f 100644
--- a/application/basilisk/app/profile/basilisk.js
+++ b/application/basilisk/app/profile/basilisk.js
@@ -543,9 +543,10 @@ pref("browser.gesture.tap", "cmd_fullZoomReset");
pref("browser.snapshots.limit", 0);
// 0: Nothing happens
-// 1: Scrolling contents
+// 1: Scroll contents
// 2: Go back or go forward, in your history
-// 3: Zoom in or out.
+// 3: Zoom in or out
+// 4: Scroll contents with X and Y swapped
#ifdef XP_MACOSX
// On OS X, if the wheel has one axis only, shift+wheel comes through as a
// horizontal scroll event. Thus, we can't assign anything other than normal
@@ -579,6 +580,10 @@ pref("network.captive-portal-service.enabled", true);
// If true, network link events will change the value of navigator.onLine
pref("network.manage-offline-status", true);
+// Enable opportunistic encryption by default
+pref("network.http.altsvc.oe", true);
+pref("network.http.upgrade-insecure-requests", true);
+
// We want to make sure mail URLs are handled externally...
pref("network.protocol-handler.external.mailto", true); // for mail
pref("network.protocol-handler.external.news", true); // for news
@@ -1265,13 +1270,6 @@ pref("media.gmp-widevinecdm.enabled", true);
// -1 means no experiment is run and we use the preferred value for frecency (6h)
pref("browser.cache.frecency_experiment", 0);
-pref("browser.translation.detectLanguage", false);
-pref("browser.translation.neverForLanguages", "");
-// Show the translation UI bits, like the info bar, notification icon and preferences.
-pref("browser.translation.ui.show", false);
-// Allows to define the translation engine. Bing is default, Yandex may optionally switched on.
-pref("browser.translation.engine", "bing");
-
// Telemetry settings.
// Determines if Telemetry pings can be archived locally.
pref("toolkit.telemetry.archive.enabled", true);
diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
index dbc9478c1..ebe55377f 100644
--- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
+++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
@@ -379,12 +379,10 @@ var FullScreen = {
let topWin = event.target.ownerGlobal.top;
browser = gBrowser.getBrowserForContentWindow(topWin);
}
- TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS");
this.enterDomFullscreen(browser);
break;
}
case "MozDOMFullscreen:Exited":
- TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS");
this.cleanupDomFullscreen();
break;
}
@@ -410,7 +408,6 @@ var FullScreen = {
}
case "DOMFullscreen:Painted": {
Services.obs.notifyObservers(window, "fullscreen-painted", "");
- TelemetryStopwatch.finish("FULLSCREEN_CHANGE_MS");
break;
}
}
diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js
index 0bbce3e26..e1d556bff 100644
--- a/application/basilisk/base/content/browser-fxaccounts.js
+++ b/application/basilisk/base/content/browser-fxaccounts.js
@@ -4,8 +4,6 @@
var gFxAccounts = {
- SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration",
-
_initialized: false,
_inCustomizationMode: false,
_cachedProfile: null,
@@ -26,7 +24,6 @@ var gFxAccounts = {
"weave:service:setup-complete",
"weave:service:sync:error",
"weave:ui:login:error",
- "fxa-migration:state-changed",
this.FxAccountsCommon.ONLOGIN_NOTIFICATION,
this.FxAccountsCommon.ONLOGOUT_NOTIFICATION,
this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION,
@@ -80,15 +77,6 @@ var gFxAccounts = {
return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED;
},
- get sendTabToDeviceEnabled() {
- return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled");
- },
-
- get remoteClients() {
- return Weave.Service.clientsEngine.remoteClients
- .sort((a, b) => a.name.localeCompare(b.name));
- },
-
init: function () {
// Bail out if we're already initialized and for pop-up windows.
if (this._initialized || !window.toolbar.visible) {
@@ -122,9 +110,6 @@ var gFxAccounts = {
observe: function (subject, topic, data) {
switch (topic) {
- case "fxa-migration:state-changed":
- this.onMigrationStateChanged(data, subject);
- break;
case this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION:
this._cachedProfile = null;
// Fallthrough intended
@@ -134,48 +119,6 @@ var gFxAccounts = {
}
},
- onMigrationStateChanged: function () {
- // Since we nuked most of the migration code, this notification will fire
- // once after legacy Sync has been disconnected (and should never fire
- // again)
- let nb = window.document.getElementById("global-notificationbox");
-
- let msg = this.strings.GetStringFromName("autoDisconnectDescription")
- let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label");
- let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey");
- let learnMoreLink = this.fxaMigrator.learnMoreLink;
-
- let buttons = [
- {
- label: signInLabel,
- accessKey: signInAccessKey,
- callback: () => {
- this.openPreferences();
- }
- }
- ];
-
- let fragment = document.createDocumentFragment();
- let msgNode = document.createTextNode(msg);
- fragment.appendChild(msgNode);
- if (learnMoreLink) {
- let link = document.createElement("label");
- link.className = "text-link";
- link.setAttribute("value", learnMoreLink.text);
- link.href = learnMoreLink.href;
- fragment.appendChild(link);
- }
-
- nb.appendNotification(fragment,
- this.SYNC_MIGRATION_NOTIFICATION_TITLE,
- undefined,
- nb.PRIORITY_WARNING_LOW,
- buttons);
-
- // ensure the hamburger menu reflects the newly disconnected state.
- this.updateAppMenuItem();
- },
-
handleEvent: function (event) {
this._inCustomizationMode = event.type == "customizationstarting";
this.updateAppMenuItem();
@@ -201,11 +144,6 @@ var gFxAccounts = {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
} catch (e) { }
- // Bail out if FxA is disabled.
- if (!this.weave.fxAccountsEnabled) {
- return Promise.resolve();
- }
-
this.panelUIFooter.hidden = false;
// Make sure the button is disabled in customization mode.
@@ -224,6 +162,7 @@ var gFxAccounts = {
let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel");
let errorLabel = this.panelUIStatus.getAttribute("errorlabel");
let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel");
+ let settingslabel = this.panelUIStatus.getAttribute("settingslabel");
// The localization string is for the signed in text, but it's the default text as well
let defaultTooltiptext = this.panelUIStatus.getAttribute("signedinTooltiptext");
@@ -239,34 +178,19 @@ var gFxAccounts = {
this.panelUIFooter.removeAttribute("fxastatus");
this.panelUIFooter.removeAttribute("fxaprofileimage");
this.panelUIAvatar.style.removeProperty("list-style-image");
- let showErrorBadge = false;
- if (userData) {
- // At this point we consider the user as logged-in (but still can be in an error state)
- if (this.loginFailed) {
- let tooltipDescription = this.strings.formatStringFromName("reconnectDescription", [userData.email], 1);
- this.panelUIFooter.setAttribute("fxastatus", "error");
- this.panelUILabel.setAttribute("label", errorLabel);
- this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription);
- showErrorBadge = true;
- } else if (!userData.verified) {
- let tooltipDescription = this.strings.formatStringFromName("verifyDescription", [userData.email], 1);
- this.panelUIFooter.setAttribute("fxastatus", "error");
- this.panelUIFooter.setAttribute("unverified", "true");
- this.panelUILabel.setAttribute("label", unverifiedLabel);
- this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription);
- showErrorBadge = true;
- } else {
- this.panelUIFooter.setAttribute("fxastatus", "signedin");
- this.panelUILabel.setAttribute("label", userData.email);
- }
- if (profileInfoEnabled) {
- this.panelUIFooter.setAttribute("fxaprofileimage", "enabled");
- }
+
+ if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED) {
+ // Leave the default state
+ return;
}
- if (showErrorBadge) {
- gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication");
+
+ if (this.loginFailed) {
+ this.panelUIFooter.setAttribute("fxastatus", "error");
+ this.panelUILabel.setAttribute("label", errorLabel);
} else {
- gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA);
+ this.panelUIFooter.setAttribute("fxastatus", "signedin");
+ this.panelUILabel.setAttribute("label", settingslabel);
+ this.panelUIStatus.setAttribute("tooltiptext", "");
}
}
@@ -370,81 +294,12 @@ var gFxAccounts = {
this.openAccountsPage("reauth", { entrypoint: entryPoint });
},
- sendTabToDevice: function (url, clientId, title) {
- Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
- },
-
- populateSendTabToDevicesMenu: function (devicesPopup, url, title) {
- // remove existing menu items
- while (devicesPopup.hasChildNodes()) {
- devicesPopup.removeChild(devicesPopup.firstChild);
- }
-
- const fragment = document.createDocumentFragment();
-
- const onTargetDeviceCommand = (event) => {
- const clientId = event.target.getAttribute("clientId");
- const clients = clientId
- ? [clientId]
- : this.remoteClients.map(client => client.id);
-
- clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
- }
-
- function addTargetDevice(clientId, name) {
- const targetDevice = document.createElement("menuitem");
- targetDevice.addEventListener("command", onTargetDeviceCommand, true);
- targetDevice.setAttribute("class", "sendtab-target");
- targetDevice.setAttribute("clientId", clientId);
- targetDevice.setAttribute("label", name);
- fragment.appendChild(targetDevice);
- }
-
- const clients = this.remoteClients;
- for (let client of clients) {
- addTargetDevice(client.id, client.name);
- }
-
- // "All devices" menu item
- if (clients.length > 1) {
- const separator = document.createElement("menuseparator");
- fragment.appendChild(separator);
- const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem");
- addTargetDevice("", allDevicesLabel);
- }
-
- devicesPopup.appendChild(fragment);
- },
-
updateTabContextMenu: function (aPopupMenu) {
- if (!this.sendTabToDeviceEnabled) {
- return;
- }
-
- const remoteClientPresent = this.remoteClients.length > 0;
- ["context_sendTabToDevice", "context_sendTabToDevice_separator"]
- .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
+ // STUB
},
initPageContextMenu: function (contextMenu) {
- if (!this.sendTabToDeviceEnabled) {
- return;
- }
-
- const remoteClientPresent = this.remoteClients.length > 0;
- // showSendLink and showSendPage are mutually exclusive
- const showSendLink = remoteClientPresent
- && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
- const showSendPage = !showSendLink && remoteClientPresent
- && !(contextMenu.isContentSelected ||
- contextMenu.onImage || contextMenu.onCanvas ||
- contextMenu.onVideo || contextMenu.onAudio ||
- contextMenu.onLink || contextMenu.onTextInput);
-
- ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
- .forEach(id => contextMenu.showItem(id, showSendPage));
- ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
- .forEach(id => contextMenu.showItem(id, showSendLink));
+ // STUB
}
};
diff --git a/application/basilisk/base/content/browser-gestureSupport.js b/application/basilisk/base/content/browser-gestureSupport.js
index f472e5c9a..6c21a6ad5 100644
--- a/application/basilisk/base/content/browser-gestureSupport.js
+++ b/application/basilisk/base/content/browser-gestureSupport.js
@@ -1001,13 +1001,10 @@ var gHistorySwipeAnimation = {
ctx.DRAWWINDOW_ASYNC_DECODE_IMAGES |
ctx.DRAWWINDOW_USE_WIDGET_LAYERS);
- TelemetryStopwatch.start("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE");
try {
this._installCurrentPageSnapshot(canvas);
this._assignSnapshotToCurrentBrowser(canvas);
- } finally {
- TelemetryStopwatch.finish("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE");
- }
+ } catch (e) {}
},
/**
@@ -1058,7 +1055,6 @@ var gHistorySwipeAnimation = {
return;
}
- TelemetryStopwatch.start("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE");
try {
let browser = gBrowser.selectedBrowser;
let snapshots = browser.snapshots;
@@ -1072,9 +1068,7 @@ var gHistorySwipeAnimation = {
}
}, "image/png"
);
- } finally {
- TelemetryStopwatch.finish("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE");
- }
+ } catch (e) {}
},
/**
diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js
index 51bcb15d5..3a57140f2 100644
--- a/application/basilisk/base/content/browser-syncui.js
+++ b/application/basilisk/base/content/browser-syncui.js
@@ -19,6 +19,7 @@ var gSyncUI = {
_obs: ["weave:service:sync:start",
"weave:service:sync:finish",
"weave:service:sync:error",
+ "weave:service:quota:remaining",
"weave:service:setup-complete",
"weave:service:login:start",
"weave:service:login:finish",
@@ -246,6 +247,21 @@ var gSyncUI = {
this.updateUI();
},
+ onQuotaNotice: function onQuotaNotice(subject, data) {
+ let title = this._stringBundle.GetStringFromName("warning.sync.quota.label");
+ let description = this._stringBundle.GetStringFromName("warning.sync.quota.description");
+ let buttons = [];
+ buttons.push(new Weave.NotificationButton(
+ this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"),
+ this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"),
+ function() { gSyncUI.openQuotaDialog(); return true; }
+ ));
+
+ let notification = new Weave.Notification(
+ title, description, null, Weave.Notifications.PRIORITY_WARNING, buttons);
+ Weave.Notifications.replaceTitle(notification);
+ },
+
_getAppName: function () {
let brand = new StringBundle("chrome://branding/locale/brand.properties");
return brand.get("brandShortName");
@@ -293,17 +309,13 @@ var gSyncUI = {
*/
openSetup: function SUI_openSetup(wizardType, entryPoint = "syncbutton") {
- if (this.weaveService.fxAccountsEnabled) {
- this.openPrefs(entryPoint);
- } else {
- let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
- if (win)
- win.focus();
- else {
- window.openDialog("chrome://browser/content/sync/setup.xul",
- "weaveSetup", "centerscreen,chrome,resizable=no",
- wizardType);
- }
+ let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
+ if (win)
+ win.focus();
+ else {
+ window.openDialog("chrome://browser/content/sync/setup.xul",
+ "weaveSetup", "centerscreen,chrome,resizable=no",
+ wizardType);
}
},
@@ -328,23 +340,6 @@ var gSyncUI = {
gFxAccounts.openSignInAgainPage(entryPoint);
},
- openSyncedTabsPanel() {
- let placement = CustomizableUI.getPlacementOfWidget("sync-button");
- let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR;
- let anchor = document.getElementById("sync-button") ||
- document.getElementById("PanelUI-menu-button");
- if (area == CustomizableUI.AREA_PANEL) {
- // The button is in the panel, so we need to show the panel UI, then our
- // subview.
- PanelUI.show().then(() => {
- PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
- }).catch(Cu.reportError);
- } else {
- // It is placed somewhere else - just try and show it.
- PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
- }
- },
-
/* After Sync is initialized we perform a once-only check for the sync
button being in "customize purgatory" and if so, move it to the panel.
This is done primarily for profiles created before SyncedTabs landed,
@@ -456,6 +451,32 @@ var gSyncUI = {
}
},
+ onSyncError: function SUI_onSyncError() {
+ this.log.debug("onSyncError: login=${login}, sync=${sync}", Weave.Status);
+ let title = this._stringBundle.GetStringFromName("error.sync.title");
+ let error = Weave.Utils.getErrorString(Weave.Status.sync);
+ let description =
+ this._stringBundle.formatStringFromName("error.sync.description", [error], 1);
+ let priority = Weave.Notifications.PRIORITY_WARNING;
+ let buttons = [];
+
+ if (Weave.Status.sync == Weave.OVER_QUOTA) {
+ description = this._stringBundle.GetStringFromName("error.sync.quota.description");
+ buttons.push(new Weave.NotificationButton(
+ this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"),
+ this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"),
+ function() { gSyncUI.openQuotaDialog(); return true; } )
+ );
+ // Only show the notification bar on Quota error. the panel will show the rest.
+ let notification =
+ new Weave.Notification(title, description, null, priority, buttons);
+ Weave.Notifications.replaceTitle(notification);
+ }
+
+ this.updateUI();
+ },
+
+
observe: function SUI_observe(subject, topic, data) {
this.log.debug("observed", topic);
if (this._unloaded) {
@@ -487,12 +508,17 @@ var gSyncUI = {
// Do nothing.
break;
case "weave:ui:sync:error":
+ this.onSyncError();
+ break;
case "weave:service:setup-complete":
case "weave:service:login:finish":
case "weave:service:login:start":
case "weave:service:start-over":
this.updateUI();
break;
+ case "weave:service:quota:remaining":
+ this.onQuotaNotice();
+ break;
case "weave:ui:login:error":
case "weave:service:login:error":
this.onLoginError();
diff --git a/application/basilisk/base/content/browser.css b/application/basilisk/base/content/browser.css
index e951985dc..517c1c5eb 100644
--- a/application/basilisk/base/content/browser.css
+++ b/application/basilisk/base/content/browser.css
@@ -933,11 +933,6 @@ html|*#gcli-output-frame,
transition: none;
}
-/* Translation */
-notification[value="translation"] {
- -moz-binding: url("chrome://browser/content/translation-infobar.xml#translationbar");
-}
-
/** See bug 872317 for why the following rule is necessary. */
#downloads-button {
diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js
index 031144dfd..9fb997a42 100644
--- a/application/basilisk/base/content/browser.js
+++ b/application/basilisk/base/content/browser.js
@@ -45,8 +45,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm");
["SitePermissions", "resource:///modules/SitePermissions.jsm"],
["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"],
["Task", "resource://gre/modules/Task.jsm"],
- ["TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm"],
- ["Translation", "resource:///modules/translation/Translation.jsm"],
["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"],
["Weave", "resource://services-sync/main.js"],
["fxAccounts", "resource://gre/modules/FxAccounts.jsm"],
@@ -970,7 +968,6 @@ var gBrowserInit = {
// the listener is registered.
DOMLinkHandler.init();
gPageStyleMenu.init();
- LanguageDetectionListener.init();
BrowserOnClick.init();
FeedHandler.init();
DevEdition.init();
@@ -3818,8 +3815,6 @@ function toOpenWindowByType(inType, uri, features)
function OpenBrowserWindow(options)
{
- var telemetryObj = {};
- TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj);
function newDocumentShown(doc, topic, data) {
if (topic == "document-shown" &&
@@ -3827,7 +3822,6 @@ function OpenBrowserWindow(options)
doc.defaultView == win) {
Services.obs.removeObserver(newDocumentShown, "document-shown");
Services.obs.removeObserver(windowClosed, "domwindowclosed");
- TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj);
}
}
@@ -4623,25 +4617,6 @@ var TabsProgressListener = {
_startedLoadTimer: new WeakSet(),
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
- // Collect telemetry data about tab load times.
- if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) {
- if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
- if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
- this._startedLoadTimer.add(aBrowser);
- TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
- Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
- } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
- this._startedLoadTimer.has(aBrowser)) {
- this._startedLoadTimer.delete(aBrowser);
- TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
- }
- } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
- aStatus == Cr.NS_BINDING_ABORTED &&
- this._startedLoadTimer.has(aBrowser)) {
- this._startedLoadTimer.delete(aBrowser);
- TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);
- }
- }
// We used to listen for clicks in the browser here, but when that
// became unnecessary, removing the code below caused focus issues.
@@ -5703,16 +5678,6 @@ function setStyleDisabled(disabled) {
gPageStyleMenu.disableStyle();
}
-
-var LanguageDetectionListener = {
- init: function() {
- window.messageManager.addMessageListener("Translation:DocumentState", msg => {
- Translation.documentStateReceived(msg.target, msg.data);
- });
- }
-};
-
-
var BrowserOffline = {
_inited: false,
@@ -6382,7 +6347,7 @@ function checkEmptyPageOrigin(browser = gBrowser.selectedBrowser,
}
function BrowserOpenSyncTabs() {
- gSyncUI.openSyncedTabsPanel();
+ switchToTabHavingURI("about:sync-tabs", true);
}
/**
diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul
index 982edfcd9..3208538c1 100644
--- a/application/basilisk/base/content/browser.xul
+++ b/application/basilisk/base/content/browser.xul
@@ -521,8 +521,7 @@
tabbrowser="content"
flex="1"
setfocus="false"
- tooltip="tabbrowser-tab-tooltip"
- stopwatchid="FX_TAB_CLICK_MS">
+ tooltip="tabbrowser-tab-tooltip">
<tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
</tabs>
@@ -676,10 +675,6 @@
tooltiptext="&urlbar.webRTCShareScreenNotificationAnchor.tooltip;"/>
<image id="servicesInstall-notification-icon" class="notification-anchor-icon service-icon" role="button"
tooltiptext="&urlbar.servicesNotificationAnchor.tooltip;"/>
- <image id="translate-notification-icon" class="notification-anchor-icon translation-icon" role="button"
- tooltiptext="&urlbar.translateNotificationAnchor.tooltip;"/>
- <image id="translated-notification-icon" class="notification-anchor-icon translation-icon in-use" role="button"
- tooltiptext="&urlbar.translatedNotificationAnchor.tooltip;"/>
<image id="eme-notification-icon" class="notification-anchor-icon drm-icon" role="button"
tooltiptext="&urlbar.emeNotificationAnchor.tooltip;"/>
</box>
diff --git a/application/basilisk/base/content/sanitize.js b/application/basilisk/base/content/sanitize.js
index 841376580..0a00defa4 100644
--- a/application/basilisk/base/content/sanitize.js
+++ b/application/basilisk/base/content/sanitize.js
@@ -19,8 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
"resource:///modules/DownloadsCommon.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
- "resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
@@ -154,8 +152,6 @@ Sanitizer.prototype = {
// we catch and store them, but continue to sanitize as much as possible.
// Callers should check returned errors and give user feedback
// about items that could not be sanitized
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_TOTAL", refObj);
let annotateError = (name, ex) => {
progress[name] = "failed";
@@ -188,7 +184,7 @@ Sanitizer.prototype = {
}
// Sanitization is complete.
- TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj);
+
// Reset the inProgress preference since we were not killed during
// sanitization.
Preferences.reset(Sanitizer.PREF_SANITIZE_IN_PROGRESS);
@@ -210,8 +206,6 @@ Sanitizer.prototype = {
cache: {
clear: Task.async(function* (range) {
let seenException;
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_CACHE", refObj);
try {
// Cache doesn't consult timespan, nor does it have the
@@ -232,7 +226,6 @@ Sanitizer.prototype = {
seenException = ex;
}
- TelemetryStopwatch.finish("FX_SANITIZE_CACHE", refObj);
if (seenException) {
throw seenException;
}
@@ -243,10 +236,8 @@ Sanitizer.prototype = {
clear: Task.async(function* (range) {
let seenException;
let yieldCounter = 0;
- let refObj = {};
// Clear cookies.
- TelemetryStopwatch.start("FX_SANITIZE_COOKIES_2", refObj);
try {
let cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Ci.nsICookieManager);
@@ -274,8 +265,6 @@ Sanitizer.prototype = {
}
} catch (ex) {
seenException = ex;
- } finally {
- TelemetryStopwatch.finish("FX_SANITIZE_COOKIES_2", refObj);
}
// Clear deviceIds. Done asynchronously (returns before complete).
@@ -332,13 +321,6 @@ Sanitizer.prototype = {
if (!range || age >= 0) {
let tags = ph.getPluginTags();
for (let tag of tags) {
- let refObj = {};
- let probe = "";
- if (/\bFlash\b/.test(tag.name)) {
- probe = tag.loaded ? "FX_SANITIZE_LOADED_FLASH"
- : "FX_SANITIZE_UNLOADED_FLASH";
- TelemetryStopwatch.start(probe, refObj);
- }
try {
let rv = yield new Promise(resolve =>
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, age, resolve)
@@ -349,14 +331,8 @@ Sanitizer.prototype = {
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, -1, resolve)
);
}
- if (probe) {
- TelemetryStopwatch.finish(probe, refObj);
- }
} catch (ex) {
// Ignore errors from plug-ins
- if (probe) {
- TelemetryStopwatch.cancel(probe, refObj);
- }
}
}
}
@@ -413,8 +389,6 @@ Sanitizer.prototype = {
history: {
clear: Task.async(function* (range) {
let seenException;
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_HISTORY", refObj);
try {
if (range) {
yield PlacesUtils.history.removeVisitsByFilter({
@@ -427,8 +401,6 @@ Sanitizer.prototype = {
}
} catch (ex) {
seenException = ex;
- } finally {
- TelemetryStopwatch.finish("FX_SANITIZE_HISTORY", refObj);
}
try {
@@ -455,8 +427,6 @@ Sanitizer.prototype = {
formdata: {
clear: Task.async(function* (range) {
let seenException;
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj);
try {
// Clear undo history of all searchBars
let windows = Services.wm.getEnumerator("navigator:browser");
@@ -504,7 +474,6 @@ Sanitizer.prototype = {
seenException = ex;
}
- TelemetryStopwatch.finish("FX_SANITIZE_FORMDATA", refObj);
if (seenException) {
throw seenException;
}
@@ -513,8 +482,6 @@ Sanitizer.prototype = {
downloads: {
clear: Task.async(function* (range) {
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_DOWNLOADS", refObj);
try {
let filterByTime = null;
if (range) {
@@ -528,16 +495,13 @@ Sanitizer.prototype = {
// Clear all completed/cancelled downloads
let list = yield Downloads.getList(Downloads.ALL);
list.removeFinished(filterByTime);
- } finally {
- TelemetryStopwatch.finish("FX_SANITIZE_DOWNLOADS", refObj);
- }
+ } catch (ex) {
+ }
})
},
sessions: {
clear: Task.async(function* (range) {
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_SESSIONS", refObj);
try {
// clear all auth tokens
@@ -547,17 +511,14 @@ Sanitizer.prototype = {
// clear FTP and plain HTTP auth sessions
Services.obs.notifyObservers(null, "net:clear-active-logins", null);
- } finally {
- TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj);
- }
+ } catch (ex) {
+ }
})
},
siteSettings: {
clear: Task.async(function* (range) {
let seenException;
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_SITESETTINGS", refObj);
let startDateMS = range ? range[0] / 1000 : null;
@@ -615,7 +576,6 @@ Sanitizer.prototype = {
seenException = ex;
}
- TelemetryStopwatch.finish("FX_SANITIZE_SITESETTINGS", refObj);
if (seenException) {
throw seenException;
}
@@ -672,9 +632,6 @@ Sanitizer.prototype = {
// If/once we get here, we should actually be able to close all windows.
- let refObj = {};
- TelemetryStopwatch.start("FX_SANITIZE_OPENWINDOWS", refObj);
-
// First create a new window. We do this first so that on non-mac, we don't
// accidentally close the app by closing all the windows.
let handler = Cc["@mozilla.org/browser/clh;1"].getService(Ci.nsIBrowserHandler);
@@ -719,7 +676,6 @@ Sanitizer.prototype = {
newWindowOpened = true;
// If we're the last thing to happen, invoke callback.
if (numWindowsClosing == 0) {
- TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj);
resolve();
}
}
@@ -731,7 +687,6 @@ Sanitizer.prototype = {
Services.obs.removeObserver(onWindowClosed, "xul-window-destroyed");
// If we're the last thing to happen, invoke callback.
if (newWindowOpened) {
- TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj);
resolve();
}
}
diff --git a/application/basilisk/base/content/sync/quota.js b/application/basilisk/base/content/sync/quota.js
new file mode 100644
index 000000000..b416a44cc
--- /dev/null
+++ b/application/basilisk/base/content/sync/quota.js
@@ -0,0 +1,247 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const Ci = Components.interfaces;
+const Cc = Components.classes;
+const Cr = Components.results;
+const Cu = Components.utils;
+
+Cu.import("resource://services-sync/main.js");
+Cu.import("resource://gre/modules/DownloadUtils.jsm");
+
+var gSyncQuota = {
+
+ init: function init() {
+ this.bundle = document.getElementById("quotaStrings");
+ let caption = document.getElementById("treeCaption");
+ caption.firstChild.nodeValue = this.bundle.getString("quota.treeCaption.label");
+
+ gUsageTreeView.init();
+ this.tree = document.getElementById("usageTree");
+ this.tree.view = gUsageTreeView;
+
+ this.loadData();
+ },
+
+ loadData: function loadData() {
+ this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE,
+ function (error, usage) {
+ delete gSyncQuota._usage_req;
+ // displayUsageData handles null values, so no need to check 'error'.
+ gUsageTreeView.displayUsageData(usage);
+ });
+
+ let usageLabel = document.getElementById("usageLabel");
+ let bundle = this.bundle;
+
+ this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA,
+ function (error, quota) {
+ delete gSyncQuota._quota_req;
+
+ if (error) {
+ usageLabel.value = bundle.getString("quota.usageError.label");
+ return;
+ }
+ let used = gSyncQuota.convertKB(quota[0]);
+ if (!quota[1]) {
+ // No quota on the server.
+ usageLabel.value = bundle.getFormattedString(
+ "quota.usageNoQuota.label", used);
+ return;
+ }
+ let percent = Math.round(100 * quota[0] / quota[1]);
+ let total = gSyncQuota.convertKB(quota[1]);
+ usageLabel.value = bundle.getFormattedString(
+ "quota.usagePercentage.label", [percent].concat(used).concat(total));
+ });
+ },
+
+ onCancel: function onCancel() {
+ if (this._usage_req) {
+ this._usage_req.abort();
+ }
+ if (this._quota_req) {
+ this._quota_req.abort();
+ }
+ return true;
+ },
+
+ onAccept: function onAccept() {
+ let engines = gUsageTreeView.getEnginesToDisable();
+ for each (let engine in engines) {
+ Weave.Service.engineManager.get(engine).enabled = false;
+ }
+ if (engines.length) {
+ // The 'Weave' object will disappear once the window closes.
+ let Service = Weave.Service;
+ Weave.Utils.nextTick(function() { Service.sync(); });
+ }
+ return this.onCancel();
+ },
+
+ convertKB: function convertKB(value) {
+ return DownloadUtils.convertByteUnits(value * 1024);
+ }
+
+};
+
+var gUsageTreeView = {
+
+ _ignored: {keys: true,
+ meta: true,
+ clients: true},
+
+ /*
+ * Internal data structures underlaying the tree.
+ */
+ _collections: [],
+ _byname: {},
+
+ init: function init() {
+ let retrievingLabel = gSyncQuota.bundle.getString("quota.retrieving.label");
+ for each (let engine in Weave.Service.engineManager.getEnabled()) {
+ if (this._ignored[engine.name])
+ continue;
+
+ // Some engines use the same pref, which means they can only be turned on
+ // and off together. We need to combine them here as well.
+ let existing = this._byname[engine.prefName];
+ if (existing) {
+ existing.engines.push(engine.name);
+ continue;
+ }
+
+ let obj = {name: engine.prefName,
+ title: this._collectionTitle(engine),
+ engines: [engine.name],
+ enabled: true,
+ sizeLabel: retrievingLabel};
+ this._collections.push(obj);
+ this._byname[engine.prefName] = obj;
+ }
+ },
+
+ _collectionTitle: function _collectionTitle(engine) {
+ try {
+ return gSyncQuota.bundle.getString(
+ "collection." + engine.prefName + ".label");
+ } catch (ex) {
+ return engine.Name;
+ }
+ },
+
+ /*
+ * Process the quota information as returned by info/collection_usage.
+ */
+ displayUsageData: function displayUsageData(data) {
+ for each (let coll in this._collections) {
+ coll.size = 0;
+ // If we couldn't retrieve any data, just blank out the label.
+ if (!data) {
+ coll.sizeLabel = "";
+ continue;
+ }
+
+ for each (let engineName in coll.engines)
+ coll.size += data[engineName] || 0;
+ let sizeLabel = "";
+ sizeLabel = gSyncQuota.bundle.getFormattedString(
+ "quota.sizeValueUnit.label", gSyncQuota.convertKB(coll.size));
+ coll.sizeLabel = sizeLabel;
+ }
+ let sizeColumn = this.treeBox.columns.getNamedColumn("size");
+ this.treeBox.invalidateColumn(sizeColumn);
+ },
+
+ /*
+ * Handle click events on the tree.
+ */
+ onTreeClick: function onTreeClick(event) {
+ if (event.button == 2)
+ return;
+
+ let cell = this.treeBox.getCellAt(event.clientX, event.clientY);
+ if (cell.col && cell.col.id == "enabled")
+ this.toggle(cell.row);
+ },
+
+ /*
+ * Toggle enabled state of an engine.
+ */
+ toggle: function toggle(row) {
+ // Update the tree
+ let collection = this._collections[row];
+ collection.enabled = !collection.enabled;
+ this.treeBox.invalidateRow(row);
+ },
+
+ /*
+ * Return a list of engines (or rather their pref names) that should be
+ * disabled.
+ */
+ getEnginesToDisable: function getEnginesToDisable() {
+ // Tycho: return [coll.name for each (coll in this._collections) if (!coll.enabled)];
+ let engines = [];
+ for each (let coll in this._collections) {
+ if (!coll.enabled) {
+ engines.push(coll.name);
+ }
+ }
+ return engines;
+ },
+
+ // nsITreeView
+
+ get rowCount() {
+ return this._collections.length;
+ },
+
+ getRowProperties: function(index) { return ""; },
+ getCellProperties: function(row, col) { return ""; },
+ getColumnProperties: function(col) { return ""; },
+ isContainer: function(index) { return false; },
+ isContainerOpen: function(index) { return false; },
+ isContainerEmpty: function(index) { return false; },
+ isSeparator: function(index) { return false; },
+ isSorted: function() { return false; },
+ canDrop: function(index, orientation, dataTransfer) { return false; },
+ drop: function(row, orientation, dataTransfer) {},
+ getParentIndex: function(rowIndex) {},
+ hasNextSibling: function(rowIndex, afterIndex) { return false; },
+ getLevel: function(index) { return 0; },
+ getImageSrc: function(row, col) {},
+
+ getCellValue: function(row, col) {
+ return this._collections[row].enabled;
+ },
+
+ getCellText: function getCellText(row, col) {
+ let collection = this._collections[row];
+ switch (col.id) {
+ case "collection":
+ return collection.title;
+ case "size":
+ return collection.sizeLabel;
+ default:
+ return "";
+ }
+ },
+
+ setTree: function setTree(tree) {
+ this.treeBox = tree;
+ },
+
+ toggleOpenState: function(index) {},
+ cycleHeader: function(col) {},
+ selectionChanged: function() {},
+ cycleCell: function(row, col) {},
+ isEditable: function(row, col) { return false; },
+ isSelectable: function (row, col) { return false; },
+ setCellValue: function(row, col, value) {},
+ setCellText: function(row, col, value) {},
+ performAction: function(action) {},
+ performActionOnRow: function(action, row) {},
+ performActionOnCell: function(action, row, col) {}
+
+};
diff --git a/application/basilisk/base/content/sync/quota.xul b/application/basilisk/base/content/sync/quota.xul
new file mode 100644
index 000000000..99e6ed78b
--- /dev/null
+++ b/application/basilisk/base/content/sync/quota.xul
@@ -0,0 +1,65 @@
+<?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/. -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/skin/syncQuota.css"?>
+
+<!DOCTYPE dialog [
+<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
+<!ENTITY % syncQuotaDTD SYSTEM "chrome://browser/locale/syncQuota.dtd">
+%brandDTD;
+%syncBrandDTD;
+%syncQuotaDTD;
+]>
+<dialog id="quotaDialog"
+ windowtype="Sync:ViewQuota"
+ persist="screenX screenY width height"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ onload="gSyncQuota.init()"
+ buttons="accept,cancel"
+ title="&quota.dialogTitle.label;"
+ ondialogcancel="return gSyncQuota.onCancel();"
+ ondialogaccept="return gSyncQuota.onAccept();">
+
+ <script type="application/javascript"
+ src="chrome://browser/content/sync/quota.js"/>
+
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="quotaStrings"
+ src="chrome://browser/locale/syncQuota.properties"/>
+ </stringbundleset>
+
+ <vbox flex="1">
+ <label id="usageLabel"
+ value="&quota.retrievingInfo.label;"/>
+ <separator/>
+ <tree id="usageTree"
+ seltype="single"
+ hidecolumnpicker="true"
+ onclick="gUsageTreeView.onTreeClick(event);"
+ flex="1">
+ <treecols>
+ <treecol id="enabled"
+ type="checkbox"
+ fixed="true"/>
+ <splitter class="tree-splitter"/>
+ <treecol id="collection"
+ label="&quota.typeColumn.label;"
+ flex="1"/>
+ <splitter class="tree-splitter"/>
+ <treecol id="size"
+ label="&quota.sizeColumn.label;"
+ flex="1"/>
+ </treecols>
+ <treechildren flex="1"/>
+ </tree>
+ <separator/>
+ <description id="treeCaption"> </description>
+ </vbox>
+
+</dialog>
diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js
index 11a9fabce..6d053dd2b 100644
--- a/application/basilisk/base/content/tab-content.js
+++ b/application/basilisk/base/content/tab-content.js
@@ -558,13 +558,6 @@ var PageStyleHandler = {
};
PageStyleHandler.init();
-// Keep a reference to the translation content handler to avoid it it being GC'ed.
-var trHandler = null;
-if (Services.prefs.getBoolPref("browser.translation.detectLanguage")) {
- Cu.import("resource:///modules/translation/TranslationContentHandler.jsm");
- trHandler = new TranslationContentHandler(global, docShell);
-}
-
function gKeywordURIFixup(fixupInfo) {
fixupInfo.QueryInterface(Ci.nsIURIFixupInfo);
if (!fixupInfo.consumer) {
diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml
index f8dbcf364..043838020 100644
--- a/application/basilisk/base/content/tabbrowser.xml
+++ b/application/basilisk/base/content/tabbrowser.xml
@@ -1042,11 +1042,6 @@
</body>
</method>
- <!-- Holds a unique ID for the tab change that's currently being timed.
- Used to make sure that multiple, rapid tab switches do not try to
- create overlapping timers. -->
- <field name="_tabSwitchID">null</field>
-
<method name="updateCurrentBrowser">
<parameter name="aForceUpdate"/>
<body>
@@ -1055,33 +1050,6 @@
if (this.mCurrentBrowser == newBrowser && !aForceUpdate)
return;
- if (!aForceUpdate) {
- TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS");
- if (!gMultiProcessBrowser) {
- // old way of measuring tab paint which is not valid with e10s.
- // Waiting until the next MozAfterPaint ensures that we capture
- // the time it takes to paint, upload the textures to the compositor,
- // and then composite.
- if (this._tabSwitchID) {
- TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS");
- }
-
- let tabSwitchID = Symbol();
-
- TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS");
- this._tabSwitchID = tabSwitchID;
-
- let onMozAfterPaint = () => {
- if (this._tabSwitchID === tabSwitchID) {
- TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS");
- this._tabSwitchID = null;
- }
- window.removeEventListener("MozAfterPaint", onMozAfterPaint);
- }
- window.addEventListener("MozAfterPaint", onMozAfterPaint);
- }
- }
-
var oldTab = this.mCurrentTab;
// Preview mode should not reset the owner
@@ -1274,9 +1242,6 @@
});
this.dispatchEvent(event);
}
-
- if (!aForceUpdate)
- TelemetryStopwatch.finish("FX_TAB_SWITCH_UPDATE_MS");
]]>
</body>
</method>
@@ -2136,6 +2101,7 @@
var aRelatedBrowser;
var aOriginPrincipal;
var aOpener;
+ var aSkipBackgroundNotify;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -2158,6 +2124,7 @@
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
aOpener = params.opener;
+ aSkipBackgroundNotify = params.skipBackgroundNotify;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
@@ -2186,6 +2153,11 @@
t.setAttribute("crop", "end");
t.setAttribute("onerror", "this.removeAttribute('image');");
+
+ if (aSkipBackgroundNotify) {
+ t.setAttribute("skipbackgroundnotify", true);
+ }
+
t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing();
@@ -4145,8 +4117,6 @@
*/
startTabSwitch: function () {
- TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
- TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
this.addMarker("AsyncTabSwitch:Start");
this.switchInProgress = true;
},
@@ -4162,31 +4132,18 @@
this.getTabState(this.requestedTab) == this.STATE_LOADED) {
// After this point the tab has switched from the content thread's point of view.
// The changes will be visible after the next refresh driver tick + composite.
- let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
- if (time != -1) {
- TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
- this.log("DEBUG: tab switch time = " + time);
this.addMarker("AsyncTabSwitch:Finish");
- }
this.switchInProgress = false;
}
},
spinnerDisplayed: function () {
this.assert(!this.spinnerTab);
- TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
- // We have a second, similar probe for capturing recordings of
- // when the spinner is displayed for very long periods.
- TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window);
this.addMarker("AsyncTabSwitch:SpinnerShown");
},
spinnerHidden: function () {
this.assert(this.spinnerTab);
- this.log("DEBUG: spinner time = " +
- TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window));
- TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
- TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window);
this.addMarker("AsyncTabSwitch:SpinnerHidden");
// we do not get a onPaint after displaying the spinner
this.maybeFinishTabSwitch();
@@ -5982,7 +5939,11 @@
this._fillTrailingGap();
this._handleTabSelect();
} else {
- this._notifyBackgroundTab(tab);
+ if (tab.hasAttribute("skipbackgroundnotify")) {
+ tab.removeAttribute("skipbackgroundnotify");
+ } else {
+ this._notifyBackgroundTab(tab);
+ }
}
// XXXmano: this is a temporary workaround for bug 345399
diff --git a/application/basilisk/base/content/web-panels.xul b/application/basilisk/base/content/web-panels.xul
index 223b20ed7..ed868c24a 100644
--- a/application/basilisk/base/content/web-panels.xul
+++ b/application/basilisk/base/content/web-panels.xul
@@ -44,6 +44,21 @@
disabled="true"/>
<command id="Browser:Stop" oncommand="PanelBrowserStop();"/>
<command id="Browser:Reload" oncommand="PanelBrowserReload();"/>
+ <command id="Browser:BackOrBackDuplicate"
+ oncommand="getPanelBrowser().webNavigation.goBack(event);"
+ disabled="true">
+ <observes element="Browser:Back" attribute="disabled"/>
+ </command>
+ <command id="Browser:ForwardOrForwardDuplicate"
+ oncommand="getPanelBrowser().webNavigation.goForward(event);"
+ disabled="true">
+ <observes element="Browser:Forward" attribute="disabled"/>
+ </command>
+ <command id="Browser:ReloadOrDuplicate"
+ oncommand="PanelBrowserReload(event)"
+ disabled="true">
+ <observes element="Browser:Reload" attribute="disabled"/>
+ </command>
</commandset>
<popupset id="mainPopupSet">
diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn
index 5ec92d79a..c288685b9 100644
--- a/application/basilisk/base/jar.mn
+++ b/application/basilisk/base/jar.mn
@@ -150,6 +150,8 @@ browser.jar:
content/browser/sync/customize.xul (content/sync/customize.xul)
content/browser/sync/customize.js (content/sync/customize.js)
content/browser/sync/customize.css (content/sync/customize.css)
+ content/browser/sync/quota.xul (content/sync/quota.xul)
+ content/browser/sync/quota.js (content/sync/quota.js)
content/browser/safeMode.css (content/safeMode.css)
content/browser/safeMode.js (content/safeMode.js)
content/browser/safeMode.xul (content/safeMode.xul)
diff --git a/application/basilisk/branding/official/branding.nsi b/application/basilisk/branding/official/branding.nsi
index 58d7554df..250abd84d 100644
--- a/application/basilisk/branding/official/branding.nsi
+++ b/application/basilisk/branding/official/branding.nsi
@@ -12,39 +12,5 @@
!define CompanyName "Moonchild Productions"
!define URLInfoAbout "https://www.basilisk-browser.org"
!define URLUpdateInfo "https://www.basilisk-browser.org/releasenotes.shtml"
-!define HelpLink "https://www.basilisk-browser.org"
-
-; The OFFICIAL define is a workaround to support different urls for Release and
-; Beta since they share the same branding when building with other branches that
-; set the update channel to beta.
-!define OFFICIAL
-!define URLStubDownload ""
-!define URLManualDownload ""
-!define URLSystemRequirements "http://www.basilisk-browser.org/requirements.shtml"
-!define Channel "release"
-
-# The installer's certificate name and issuer expected by the stub installer
-!define CertNameDownload ""
-!define CertIssuerDownload ""
-
-# Dialog units are used so the UI displays correctly with the system's DPI
-# settings.
-# The dialog units for the bitmap's dimensions should match exactly with the
-# bitmap's width and height in pixels.
-!define APPNAME_BMP_WIDTH_DU "134u"
-!define APPNAME_BMP_HEIGHT_DU "36u"
-!define INTRO_BLURB_WIDTH_DU "258u"
-!define INTRO_BLURB_EDGE_DU "170u"
-!define INTRO_BLURB_LTR_TOP_DU "20u"
-!define INTRO_BLURB_RTL_TOP_DU "12u"
-
-# UI Colors that can be customized for each channel
-!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000000
-!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x666666
-!define FOOTER_BKGRD_COLOR 0xFFFFFF
-!define INTRO_BLURB_TEXT_COLOR 0x666666
-!define INSTALL_BLURB_TEXT_COLOR 0x666666
-!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666666
-!define COMMON_TEXT_COLOR_NORMAL 0x000000
-!define COMMON_TEXT_COLOR_FADED 0x666666
-!define COMMON_BKGRD_COLOR 0xF0F0F0
+!define HelpLink "https://www.basilisk-browser.org/contact.shtml"
+!define URLSystemRequirements "https://www.basilisk-browser.org/requirements.shtml"
diff --git a/application/basilisk/branding/official/disk.icns b/application/basilisk/branding/official/disk.icns
index 82fdccff8..bb3fdd5e4 100644
--- a/application/basilisk/branding/official/disk.icns
+++ b/application/basilisk/branding/official/disk.icns
Binary files differ
diff --git a/application/basilisk/branding/official/document.icns b/application/basilisk/branding/official/document.icns
index 5f03305d7..388296713 100644
--- a/application/basilisk/branding/official/document.icns
+++ b/application/basilisk/branding/official/document.icns
Binary files differ
diff --git a/application/basilisk/branding/official/firefox.icns b/application/basilisk/branding/official/firefox.icns
index 4d2ad5a04..8b9232cba 100644
--- a/application/basilisk/branding/official/firefox.icns
+++ b/application/basilisk/branding/official/firefox.icns
Binary files differ
diff --git a/application/basilisk/branding/unofficial/branding.nsi b/application/basilisk/branding/unofficial/branding.nsi
index 77f08a4cb..586dd0074 100644
--- a/application/basilisk/branding/unofficial/branding.nsi
+++ b/application/basilisk/branding/unofficial/branding.nsi
@@ -10,36 +10,7 @@
# instead of BrandFullName and typically should not be modified.
!define BrandFullNameInternal "Serpent"
!define CompanyName "Moonchild Productions"
-!define URLInfoAbout "http://www.basilisk-browser.org"
+!define URLInfoAbout "https://www.basilisk-browser.org"
+!define URLUpdateInfo "https://www.basilisk-browser.org"
!define HelpLink "https://forum.palemoon.org"
-
-!define URLStubDownload ""
-!define URLManualDownload ""
-!define URLSystemRequirements ""
-!define Channel "unofficial"
-
-# The installer's certificate name and issuer expected by the stub installer
-!define CertNameDownload ""
-!define CertIssuerDownload ""
-
-# Dialog units are used so the UI displays correctly with the system's DPI
-# settings.
-# The dialog units for the bitmap's dimensions should match exactly with the
-# bitmap's width and height in pixels.
-!define APPNAME_BMP_WIDTH_DU 159u
-!define APPNAME_BMP_HEIGHT_DU 50u
-!define INTRO_BLURB_WIDTH_DU "230u"
-!define INTRO_BLURB_EDGE_DU "198u"
-!define INTRO_BLURB_LTR_TOP_DU "16u"
-!define INTRO_BLURB_RTL_TOP_DU "11u"
-
-# UI Colors that can be customized for each channel
-!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000000
-!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999
-!define FOOTER_BKGRD_COLOR 0xFFFFFF
-!define INTRO_BLURB_TEXT_COLOR 0xFFFFFF
-!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
-!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
-!define COMMON_TEXT_COLOR_NORMAL 0xFFFFFF
-!define COMMON_TEXT_COLOR_FADED 0xA1AAB3
-!define COMMON_BKGRD_COLOR 0x0F1B26
+!define URLSystemRequirements "https://www.basilisk-browser.org"
diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
index 642e06f0f..09b3f167e 100644
--- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm
+++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
@@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
"resource://gre/modules/CharsetMenu.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs",
- "resource://services-sync/SyncedTabs.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
@@ -312,77 +310,6 @@ const CustomizableWidgets = [
obnode.setAttribute("element", "sync-status");
obnode.setAttribute("attribute", "syncstatus");
aNode.appendChild(obnode);
-
- // A somewhat complicated dance to format the mobilepromo label.
- let bundle = doc.getElementById("bundle_browser");
- let formatArgs = ["android", "ios"].map(os => {
- let link = doc.createElement("label");
- link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`);
- link.setAttribute("mobile-promo-os", os);
- link.className = "text-link remotetabs-promo-link";
- return link.outerHTML;
- });
- let promoParentElt = doc.getElementById("PanelUI-remotetabs-mobile-promo");
- // Put it all together...
- let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs);
- promoParentElt.innerHTML = contents;
- // We manually manage the "click" event to open the promo links because
- // allowing the "text-link" widget handle it has 2 problems: (1) it only
- // supports button 0 and (2) it's tricky to intercept when it does the
- // open and auto-close the panel. (1) can probably be fixed, but (2) is
- // trickier without hard-coding here the knowledge of exactly what buttons
- // it does support.
- // So we allow left and middle clicks to open the link in a new tab and
- // close the panel; not setting a "href" attribute prevents the text-link
- // widget handling it, and we build the final URL in the click handler to
- // make testing easier (ie, so tests can change the pref after the links
- // were created and have the new pref value used.)
- promoParentElt.addEventListener("click", e => {
- let os = e.target.getAttribute("mobile-promo-os");
- if (!os || e.button > 1) {
- return;
- }
- let link = Services.prefs.getCharPref(`identity.mobilepromo.${os}`) + "synced-tabs";
- doc.defaultView.openUILinkIn(link, "tab");
- CustomizableUI.hidePanelForNode(e.target);
- });
- },
- onViewShowing(aEvent) {
- let doc = aEvent.target.ownerDocument;
- this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist");
- Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED, false);
-
- if (SyncedTabs.isConfiguredToSyncTabs) {
- if (SyncedTabs.hasSyncedThisSession) {
- this.setDeckIndex(this.deckIndices.DECKINDEX_TABS);
- } else {
- // Sync hasn't synced tabs yet, so show the "fetching" panel.
- this.setDeckIndex(this.deckIndices.DECKINDEX_FETCHING);
- }
- // force a background sync.
- SyncedTabs.syncTabs().catch(ex => {
- Cu.reportError(ex);
- });
- // show the current list - it will be updated by our observer.
- this._showTabs();
- } else {
- // not configured to sync tabs, so no point updating the list.
- this.setDeckIndex(this.deckIndices.DECKINDEX_TABSDISABLED);
- }
- },
- onViewHiding() {
- Services.obs.removeObserver(this, SyncedTabs.TOPIC_TABS_CHANGED);
- this._tabsList = null;
- },
- _tabsList: null,
- observe(subject, topic, data) {
- switch (topic) {
- case SyncedTabs.TOPIC_TABS_CHANGED:
- this._showTabs();
- break;
- default:
- break;
- }
},
setDeckIndex(index) {
let deck = this._tabsList.ownerDocument.getElementById("PanelUI-remotetabs-deck");
diff --git a/application/basilisk/components/customizableui/content/panelUI.inc.xul b/application/basilisk/components/customizableui/content/panelUI.inc.xul
index e389b14bf..8ebd93327 100644
--- a/application/basilisk/components/customizableui/content/panelUI.inc.xul
+++ b/application/basilisk/components/customizableui/content/panelUI.inc.xul
@@ -23,10 +23,11 @@
<hbox id="PanelUI-footer-fxa">
<hbox id="PanelUI-fxa-status"
defaultlabel="&fxaSignIn.label;"
- signedinTooltiptext="&fxaSignedIn.tooltip;"
- tooltiptext="&fxaSignedIn.tooltip;"
+ signedinTooltiptext="&syncSettings.label;"
+ tooltiptext="&syncSettings.label;"
errorlabel="&fxaSignInError.label;"
unverifiedlabel="&fxaUnverified.label;"
+ settingslabel="&syncSettings.label;"
onclick="if (event.which == 1) gFxAccounts.onMenuPanelCommand();">
<image id="PanelUI-fxa-avatar"/>
<toolbarbutton id="PanelUI-fxa-label"
@@ -111,7 +112,7 @@
<vbox id="PanelUI-remotetabs-buttons">
<toolbarbutton id="PanelUI-remotetabs-view-sidebar"
class="subviewbutton"
- observes="viewTabsSidebar"
+ oncommand="BrowserOpenSyncTabs();"
label="&appMenuRemoteTabs.sidebar.label;"/>
<toolbarbutton id="PanelUI-remotetabs-syncnow"
observes="sync-status"
diff --git a/application/basilisk/components/migration/AutoMigrate.jsm b/application/basilisk/components/migration/AutoMigrate.jsm
index b38747825..003f70d70 100644
--- a/application/basilisk/components/migration/AutoMigrate.jsm
+++ b/application/basilisk/components/migration/AutoMigrate.jsm
@@ -37,8 +37,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
- "resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
const kBrandBundle = "chrome://branding/locale/brand.properties";
@@ -211,7 +209,6 @@ const AutoMigrate = {
undo: Task.async(function* () {
let browserId = Preferences.get(kAutoMigrateBrowserPref, "unknown");
- TelemetryStopwatch.startKeyed("FX_STARTUP_MIGRATION_UNDO_TOTAL_MS", browserId);
let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_UNDO");
histogram.add(0);
if (!(yield this.canUndo())) {
@@ -236,38 +233,24 @@ const AutoMigrate = {
Services.telemetry.getKeyedHistogramById(histogramId).add(browserId, this._errorMap[type]);
};
- let startTelemetryStopwatch = resourceType => {
- let histogramId = `FX_STARTUP_MIGRATION_UNDO_${resourceType.toUpperCase()}_MS`;
- TelemetryStopwatch.startKeyed(histogramId, browserId);
- };
- let stopTelemetryStopwatch = resourceType => {
- let histogramId = `FX_STARTUP_MIGRATION_UNDO_${resourceType.toUpperCase()}_MS`;
- TelemetryStopwatch.finishKeyed(histogramId, browserId);
- };
- startTelemetryStopwatch("bookmarks");
yield this._removeUnchangedBookmarks(stateData.get("bookmarks")).catch(ex => {
Cu.reportError("Uncaught exception when removing unchanged bookmarks!");
Cu.reportError(ex);
});
- stopTelemetryStopwatch("bookmarks");
reportErrorTelemetry("bookmarks");
histogram.add(15);
- startTelemetryStopwatch("visits");
yield this._removeSomeVisits(stateData.get("visits")).catch(ex => {
Cu.reportError("Uncaught exception when removing history visits!");
Cu.reportError(ex);
});
- stopTelemetryStopwatch("visits");
reportErrorTelemetry("visits");
histogram.add(20);
- startTelemetryStopwatch("logins");
yield this._removeUnchangedLogins(stateData.get("logins")).catch(ex => {
Cu.reportError("Uncaught exception when removing unchanged logins!");
Cu.reportError(ex);
});
- stopTelemetryStopwatch("logins");
reportErrorTelemetry("logins");
histogram.add(25);
@@ -278,7 +261,6 @@ const AutoMigrate = {
this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED);
histogram.add(30);
- TelemetryStopwatch.finishKeyed("FX_STARTUP_MIGRATION_UNDO_TOTAL_MS", browserId);
}),
_removeNotificationBars() {
diff --git a/application/basilisk/components/migration/MigrationUtils.jsm b/application/basilisk/components/migration/MigrationUtils.jsm
index e133ec520..ccae006fe 100644
--- a/application/basilisk/components/migration/MigrationUtils.jsm
+++ b/application/basilisk/components/migration/MigrationUtils.jsm
@@ -32,8 +32,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "ResponsivenessMonitor",
"resource://gre/modules/ResponsivenessMonitor.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
"resource://gre/modules/Sqlite.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
- "resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
"resource://gre/modules/WindowsRegistry.jsm");
@@ -254,14 +252,6 @@ this.MigratorPrototype = {
let browserKey = this.getBrowserKey();
- let maybeStartTelemetryStopwatch = resourceType => {
- let histogramId = getHistogramIdForResourceType(resourceType, "FX_MIGRATION_*_IMPORT_MS");
- if (histogramId) {
- TelemetryStopwatch.startKeyed(histogramId, browserKey);
- }
- return histogramId;
- };
-
let maybeStartResponsivenessMonitor = resourceType => {
let responsivenessMonitor;
let responsivenessHistogramId =
@@ -323,8 +313,6 @@ this.MigratorPrototype = {
for (let [migrationType, itemResources] of resourcesGroupedByItems) {
notify("Migration:ItemBeforeMigrate", migrationType);
- let stopwatchHistogramId = maybeStartTelemetryStopwatch(migrationType);
-
let {responsivenessMonitor, responsivenessHistogramId} =
maybeStartResponsivenessMonitor(migrationType);
@@ -340,10 +328,6 @@ this.MigratorPrototype = {
migrationType);
resourcesGroupedByItems.delete(migrationType);
- if (stopwatchHistogramId) {
- TelemetryStopwatch.finishKeyed(stopwatchHistogramId, browserKey);
- }
-
maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId);
if (resourcesGroupedByItems.size == 0) {
diff --git a/application/basilisk/components/migration/content/migration.xul b/application/basilisk/components/migration/content/migration.xul
index e85091002..62c97c107 100644
--- a/application/basilisk/components/migration/content/migration.xul
+++ b/application/basilisk/components/migration/content/migration.xul
@@ -24,11 +24,9 @@
<wizardpage id="importSource" pageid="importSource" next="selectProfile"
label="&importSource.title;"
onpageadvanced="return MigrationWizard.onImportSourcePageAdvanced();">
-#ifdef XP_WIN
+
<description id="importAll" control="importSourceGroup">&importFrom.label;</description>
-#else
- <description id="importAll" control="importSourceGroup">&importFromUnix.label;</description>
-#endif
+
<description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
<radiogroup id="importSourceGroup" align="start">
diff --git a/application/basilisk/components/places/content/history-panel.js b/application/basilisk/components/places/content/history-panel.js
index 20dbbb5bd..65f00e93b 100644
--- a/application/basilisk/components/places/content/history-panel.js
+++ b/application/basilisk/components/places/content/history-panel.js
@@ -3,8 +3,6 @@
* 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/. */
-Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm");
-
var gHistoryTree;
var gSearchBox;
var gHistoryGrouping = "";
@@ -81,16 +79,11 @@ function searchHistory(aInput)
options.resultType = resultType;
options.includeHidden = !!aInput;
- if (gHistoryGrouping == "lastvisited")
- this.TelemetryStopwatch.start("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
-
// call load() on the tree manually
// instead of setting the place attribute in history-panel.xul
// otherwise, we will end up calling load() twice
gHistoryTree.load([query], options);
- if (gHistoryGrouping == "lastvisited")
- this.TelemetryStopwatch.finish("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
}
window.addEventListener("SidebarFocused",
diff --git a/application/basilisk/components/places/content/places.js b/application/basilisk/components/places/content/places.js
index aa43b20e6..375c3de17 100644
--- a/application/basilisk/components/places/content/places.js
+++ b/application/basilisk/components/places/content/places.js
@@ -5,7 +5,6 @@
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
"resource:///modules/MigrationUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
@@ -810,9 +809,7 @@ var PlacesSearchBox = {
currentView.load([query], options);
}
else {
- TelemetryStopwatch.start(HISTORY_LIBRARY_SEARCH_TELEMETRY);
currentView.applyFilter(filterString, null, true);
- TelemetryStopwatch.finish(HISTORY_LIBRARY_SEARCH_TELEMETRY);
}
break;
case "downloads":
diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js
index a957b1dd5..2eac10ca4 100644
--- a/application/basilisk/components/preferences/in-content/content.js
+++ b/application/basilisk/components/preferences/in-content/content.js
@@ -31,18 +31,6 @@ var gContentPane = {
menulist.value = FontBuilder.readFontSelection(menulist);
}
- // Show translation preferences if we may:
- const prefName = "browser.translation.ui.show";
- if (Services.prefs.getBoolPref(prefName)) {
- let row = document.getElementById("translationBox");
- row.removeAttribute("hidden");
- // Showing attribution only for Bing Translator.
- Components.utils.import("resource:///modules/translation/Translation.jsm");
- if (Translation.translationEngine == "bing") {
- document.getElementById("bingAttribution").removeAttribute("hidden");
- }
- }
-
if (AlertsServiceDND) {
let notificationsDoNotDisturbRow =
document.getElementById("notificationsDoNotDisturbRow");
@@ -66,10 +54,6 @@ var gContentPane = {
gContentPane.configureColors);
setEventListener("chooseLanguage", "command",
gContentPane.showLanguages);
- setEventListener("translationAttributionImage", "click",
- gContentPane.openTranslationProviderAttribution);
- setEventListener("translateButton", "command",
- gContentPane.showTranslationExceptions);
setEventListener("notificationsDoNotDisturb", "command",
gContentPane.toggleDoNotDisturbNotifications);
@@ -274,21 +258,6 @@ var gContentPane = {
gSubDialog.open("chrome://browser/content/preferences/languages.xul");
},
- /**
- * Displays the translation exceptions dialog where specific site and language
- * translation preferences can be set.
- */
- showTranslationExceptions: function ()
- {
- gSubDialog.open("chrome://browser/content/preferences/translation.xul");
- },
-
- openTranslationProviderAttribution: function ()
- {
- Components.utils.import("resource:///modules/translation/Translation.jsm");
- Translation.openProviderAttribution();
- },
-
toggleDoNotDisturbNotifications: function (event)
{
AlertsServiceDND.manualDoNotDisturb = event.target.checked;
diff --git a/application/basilisk/components/preferences/in-content/content.xul b/application/basilisk/components/preferences/in-content/content.xul
index 9434cba62..fac864411 100644
--- a/application/basilisk/components/preferences/in-content/content.xul
+++ b/application/basilisk/components/preferences/in-content/content.xul
@@ -22,11 +22,6 @@
<preference id="font.language.group"
name="font.language.group"
type="wstring"/>
-
- <!-- Languages -->
- <preference id="browser.translation.detectLanguage"
- name="browser.translation.detectLanguage"
- type="bool"/>
</preferences>
<script type="application/javascript"
@@ -191,23 +186,4 @@
label="&chooseButton.label;"
accesskey="&chooseButton.accesskey;"/>
</hbox>
-
- <hbox id="translationBox" hidden="true">
- <hbox align="center" flex="1">
- <checkbox id="translate" preference="browser.translation.detectLanguage"
- label="&translateWebPages.label;." accesskey="&translateWebPages.accesskey;"
- onsyncfrompreference="return gContentPane.updateButtons('translateButton',
- 'browser.translation.detectLanguage');"/>
- <hbox id="bingAttribution" hidden="true">
- <label>&translation.options.attribution.beforeLogo;</label>
- <separator orient="vertical" class="thin"/>
- <image id="translationAttributionImage" aria-label="Microsoft Translator"
- src="chrome://browser/content/microsoft-translator-attribution.png"/>
- <separator orient="vertical" class="thin"/>
- <label>&translation.options.attribution.afterLogo;</label>
- </hbox>
- </hbox>
- <button id="translateButton" label="&translateExceptions.label;"
- accesskey="&translateExceptions.accesskey;"/>
- </hbox>
</groupbox>
diff --git a/application/basilisk/components/preferences/in-content/sync.js b/application/basilisk/components/preferences/in-content/sync.js
index 27f7cd48c..2600677a8 100644
--- a/application/basilisk/components/preferences/in-content/sync.js
+++ b/application/basilisk/components/preferences/in-content/sync.js
@@ -306,113 +306,8 @@ var gSyncPane = {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
- // service.fxAccountsEnabled is false iff sync is already configured for
- // the legacy provider.
- if (service.fxAccountsEnabled) {
- let displayNameLabel = document.getElementById("fxaDisplayName");
- let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
- fxaEmailAddress1Label.hidden = false;
- displayNameLabel.hidden = true;
-
- let profileInfoEnabled;
- try {
- profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
- } catch (ex) {}
-
- // determine the fxa status...
- this._showLoadPage(service);
-
- fxAccounts.getSignedInUser().then(data => {
- if (!data) {
- this.page = FXA_PAGE_LOGGED_OUT;
- return false;
- }
- this.page = FXA_PAGE_LOGGED_IN;
- // We are logged in locally, but maybe we are in a state where the
- // server rejected our credentials (eg, password changed on the server)
- let fxaLoginStatus = document.getElementById("fxaLoginStatus");
- let syncReady;
- // Not Verfied implies login error state, so check that first.
- if (!data.verified) {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
- syncReady = false;
- // So we think we are logged in, so login problems are next.
- // (Although if the Sync identity manager is still initializing, we
- // ignore login errors and assume all will eventually be good.)
- // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
- // All other login failures are assumed to be transient and should go
- // away by themselves, so aren't reflected here.
- } else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
- syncReady = false;
- // Else we must be golden (or in an error state we expect to magically
- // resolve itself)
- } else {
- fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
- syncReady = true;
- }
- fxaEmailAddress1Label.textContent = data.email;
- document.getElementById("fxaEmailAddress2").textContent = data.email;
- document.getElementById("fxaEmailAddress3").textContent = data.email;
- this._populateComputerName(Weave.Service.clientsEngine.localName);
- let engines = document.getElementById("fxaSyncEngines")
- for (let checkbox of engines.querySelectorAll("checkbox")) {
- checkbox.disabled = !syncReady;
- }
- document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
-
- // Clear the profile image (if any) of the previously logged in account.
- document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
-
- // If the account is verified the next promise in the chain will
- // fetch profile data.
- return data.verified;
- }).then(isVerified => {
- if (isVerified) {
- return fxAccounts.getSignedInUserProfile();
- }
- return null;
- }).then(data => {
- let fxaLoginStatus = document.getElementById("fxaLoginStatus");
- if (data && profileInfoEnabled) {
- if (data.displayName) {
- fxaLoginStatus.setAttribute("hasName", true);
- displayNameLabel.hidden = false;
- displayNameLabel.textContent = data.displayName;
- } else {
- fxaLoginStatus.removeAttribute("hasName");
- }
- if (data.avatar) {
- let bgImage = "url(\"" + data.avatar + "\")";
- let profileImageElement = document.getElementById("fxaProfileImage");
- profileImageElement.style.listStyleImage = bgImage;
-
- let img = new Image();
- img.onerror = () => {
- // Clear the image if it has trouble loading. Since this callback is asynchronous
- // we check to make sure the image is still the same before we clear it.
- if (profileImageElement.style.listStyleImage === bgImage) {
- profileImageElement.style.removeProperty("list-style-image");
- }
- };
- img.src = data.avatar;
- }
- } else {
- fxaLoginStatus.removeAttribute("hasName");
- }
- }, err => {
- FxAccountsCommon.log.error(err);
- }).catch(err => {
- // If we get here something's really busted
- Cu.reportError(String(err));
- });
-
- // If fxAccountEnabled is false and we are in a "not configured" state,
- // then fxAccounts is probably fully disabled rather than just unconfigured,
- // so handle this case. This block can be removed once we remove support
- // for fxAccounts being disabled.
- } else if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
- Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
+ if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
+ Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
this.page = PAGE_NO_ACCOUNT;
// else: sync was previously configured for the legacy provider, so we
// make the "old" panels available.
@@ -646,6 +541,16 @@ var gSyncPane = {
});
},
+ openQuotaDialog: function () {
+ let win = Services.wm.getMostRecentWindow("Sync:ViewQuota");
+ if (win) {
+ win.focus();
+ } else {
+ window.openDialog("chrome://browser/content/sync/quota.xul", "",
+ "centerscreen,chrome,dialog,modal");
+ }
+ },
+
openAddDevice: function () {
if (!Weave.Utils.ensureMPUnlocked())
return;
diff --git a/application/basilisk/components/preferences/in-content/sync.xul b/application/basilisk/components/preferences/in-content/sync.xul
index f1aebf2aa..cf0e81ca1 100644
--- a/application/basilisk/components/preferences/in-content/sync.xul
+++ b/application/basilisk/components/preferences/in-content/sync.xul
@@ -71,6 +71,9 @@
label="&manageAccount.label;"
accesskey="&manageAccount.accesskey;">
<menupopup>
+ <menuitem id="syncViewQuota" label="&viewQuota.label;"
+ oncommand="gSyncPane.openQuotaDialog();"/>
+ <menuseparator/>
<menuitem id="syncChangePassword" label="&changePassword2.label;"/>
<menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/>
<menuseparator/>
@@ -91,11 +94,6 @@
<richlistbox id="syncEnginesList"
orient="vertical">
<richlistitem>
- <checkbox label="&engine.addons.label;"
- accesskey="&engine.addons.accesskey;"
- preference="engine.addons"/>
- </richlistitem>
- <richlistitem>
<checkbox label="&engine.bookmarks.label;"
accesskey="&engine.bookmarks.accesskey;"
preference="engine.bookmarks"/>
diff --git a/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn
index d233c7865..5b24e89df 100644
--- a/application/basilisk/components/preferences/jar.mn
+++ b/application/basilisk/components/preferences/jar.mn
@@ -31,5 +31,3 @@ browser.jar:
content/browser/preferences/sanitize.js
content/browser/preferences/selectBookmark.xul
content/browser/preferences/selectBookmark.js
- content/browser/preferences/translation.xul
- content/browser/preferences/translation.js
diff --git a/application/basilisk/components/preferences/translation.js b/application/basilisk/components/preferences/translation.js
deleted file mode 100644
index cd570db0e..000000000
--- a/application/basilisk/components/preferences/translation.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* 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";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "gLangBundle", () =>
- Services.strings.createBundle("chrome://global/locale/languageNames.properties"));
-
-const kPermissionType = "translate";
-const kLanguagesPref = "browser.translation.neverForLanguages";
-
-function Tree(aId, aData)
-{
- this._data = aData;
- this._tree = document.getElementById(aId);
- this._tree.view = this;
-}
-
-Tree.prototype = {
- get boxObject() {
- return this._tree.treeBoxObject;
- },
- get isEmpty() {
- return !this._data.length;
- },
- get hasSelection() {
- return this.selection.count > 0;
- },
- getSelectedItems: function() {
- let result = [];
-
- let rc = this.selection.getRangeCount();
- for (let i = 0; i < rc; ++i) {
- let min = {}, max = {};
- this.selection.getRangeAt(i, min, max);
- for (let j = min.value; j <= max.value; ++j)
- result.push(this._data[j]);
- }
-
- return result;
- },
-
- // nsITreeView implementation
- get rowCount() {
- return this._data.length;
- },
- getCellText: function (aRow, aColumn) {
- return this._data[aRow];
- },
- isSeparator: function(aIndex) {
- return false;
- },
- isSorted: function() {
- return false;
- },
- isContainer: function(aIndex) {
- return false;
- },
- setTree: function(aTree) {},
- getImageSrc: function(aRow, aColumn) {},
- getProgressMode: function(aRow, aColumn) {},
- getCellValue: function(aRow, aColumn) {},
- cycleHeader: function(column) {},
- getRowProperties: function(row) {
- return "";
- },
- getColumnProperties: function(column) {
- return "";
- },
- getCellProperties: function(row, column) {
- return "";
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView])
-};
-
-function Lang(aCode)
-{
- this.langCode = aCode;
- this._label = gLangBundle.GetStringFromName(aCode);
-}
-
-Lang.prototype = {
- toString: function() {
- return this._label;
- }
-}
-
-var gTranslationExceptions = {
- onLoad: function() {
- if (this._siteTree) {
- // Re-using an open dialog, clear the old observers.
- this.uninit();
- }
-
- // Load site permissions into an array.
- this._sites = [];
- let enumerator = Services.perms.enumerator;
- while (enumerator.hasMoreElements()) {
- let perm = enumerator.getNext().QueryInterface(Ci.nsIPermission);
-
- if (perm.type == kPermissionType &&
- perm.capability == Services.perms.DENY_ACTION) {
- this._sites.push(perm.principal.origin);
- }
- }
- Services.obs.addObserver(this, "perm-changed", false);
- this._sites.sort();
-
- this._siteTree = new Tree("sitesTree", this._sites);
- this.onSiteSelected();
-
- this._langs = this.getLanguageExceptions();
- Services.prefs.addObserver(kLanguagesPref, this, false);
- this._langTree = new Tree("languagesTree", this._langs);
- this.onLanguageSelected();
- },
-
- // Get the list of languages we don't translate as an array.
- getLanguageExceptions: function() {
- let langs = Services.prefs.getCharPref(kLanguagesPref);
- if (!langs)
- return [];
-
- let result = langs.split(",").map(code => new Lang(code));
- result.sort();
-
- return result;
- },
-
- observe: function(aSubject, aTopic, aData) {
- if (aTopic == "perm-changed") {
- if (aData == "cleared") {
- if (!this._sites.length)
- return;
- let removed = this._sites.splice(0, this._sites.length);
- this._siteTree.boxObject.rowCountChanged(0, - removed.length);
- }
- else {
- let perm = aSubject.QueryInterface(Ci.nsIPermission);
- if (perm.type != kPermissionType)
- return;
-
- if (aData == "added") {
- if (perm.capability != Services.perms.DENY_ACTION)
- return;
- this._sites.push(perm.principal.origin);
- this._sites.sort();
- let boxObject = this._siteTree.boxObject;
- boxObject.rowCountChanged(0, 1);
- boxObject.invalidate();
- }
- else if (aData == "deleted") {
- let index = this._sites.indexOf(perm.principal.origin);
- if (index == -1)
- return;
- this._sites.splice(index, 1);
- this._siteTree.boxObject.rowCountChanged(index, -1);
- this.onSiteSelected();
- return;
- }
- }
- this.onSiteSelected();
- }
- else if (aTopic == "nsPref:changed") {
- this._langs = this.getLanguageExceptions();
- let change = this._langs.length - this._langTree.rowCount;
- this._langTree._data = this._langs;
- let boxObject = this._langTree.boxObject;
- if (change)
- boxObject.rowCountChanged(0, change);
- boxObject.invalidate();
- this.onLanguageSelected();
- }
- },
-
- _handleButtonDisabling: function(aTree, aIdPart) {
- let empty = aTree.isEmpty;
- document.getElementById("removeAll" + aIdPart + "s").disabled = empty;
- document.getElementById("remove" + aIdPart).disabled =
- empty || !aTree.hasSelection;
- },
-
- onLanguageSelected: function() {
- this._handleButtonDisabling(this._langTree, "Language");
- },
-
- onSiteSelected: function() {
- this._handleButtonDisabling(this._siteTree, "Site");
- },
-
- onLanguageDeleted: function() {
- let langs = Services.prefs.getCharPref(kLanguagesPref);
- if (!langs)
- return;
-
- let removed = this._langTree.getSelectedItems().map(l => l.langCode);
-
- langs = langs.split(",").filter(l => removed.indexOf(l) == -1);
- Services.prefs.setCharPref(kLanguagesPref, langs.join(","));
- },
-
- onAllLanguagesDeleted: function() {
- Services.prefs.setCharPref(kLanguagesPref, "");
- },
-
- onSiteDeleted: function() {
- let removedSites = this._siteTree.getSelectedItems();
- for (let origin of removedSites) {
- let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
- Services.perms.removeFromPrincipal(principal, kPermissionType);
- }
- },
-
- onAllSitesDeleted: function() {
- if (this._siteTree.isEmpty)
- return;
-
- let removedSites = this._sites.splice(0, this._sites.length);
- this._siteTree.boxObject.rowCountChanged(0, -removedSites.length);
-
- for (let origin of removedSites) {
- let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
- Services.perms.removeFromPrincipal(principal, kPermissionType);
- }
-
- this.onSiteSelected();
- },
-
- onSiteKeyPress: function(aEvent) {
- if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE)
- this.onSiteDeleted();
- },
-
- onLanguageKeyPress: function(aEvent) {
- if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE)
- this.onLanguageDeleted();
- },
-
- onWindowKeyPress: function(aEvent) {
- if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE)
- window.close();
- },
-
- uninit: function() {
- Services.obs.removeObserver(this, "perm-changed");
- Services.prefs.removeObserver(kLanguagesPref, this);
- }
-};
diff --git a/application/basilisk/components/preferences/translation.xul b/application/basilisk/components/preferences/translation.xul
deleted file mode 100644
index b5dfd1b9b..000000000
--- a/application/basilisk/components/preferences/translation.xul
+++ /dev/null
@@ -1,88 +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/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/translation.dtd">
-
-<window id="TranslationDialog" class="windowDialog"
- windowtype="Browser:TranslationExceptions"
- title="&window.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- style="width: &window.width;;"
- onload="gTranslationExceptions.onLoad();"
- onunload="gTranslationExceptions.uninit();"
- persist="screenX screenY width height"
- onkeypress="gTranslationExceptions.onWindowKeyPress(event);">
-
- <script src="chrome://browser/content/preferences/translation.js"/>
-
- <stringbundle id="bundlePreferences"
- src="chrome://browser/locale/preferences/preferences.properties"/>
-
- <keyset>
- <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
- </keyset>
-
- <vbox class="largeDialogContainer">
- <vbox class="contentPane" flex="1">
- <label id="languagesLabel" control="permissionsTree">&noTranslationForLanguages.label;</label>
- <separator class="thin"/>
- <tree id="languagesTree" flex="1" style="height: 12em;"
- hidecolumnpicker="true"
- onkeypress="gTranslationExceptions.onLanguageKeyPress(event)"
- onselect="gTranslationExceptions.onLanguageSelected();">
- <treecols>
- <treecol id="languageCol" label="&treehead.languageName.label;" flex="1"/>
- </treecols>
- <treechildren/>
- </tree>
- </vbox>
- <hbox align="end">
- <hbox class="actionButtons" flex="1">
- <button id="removeLanguage" disabled="true"
- accesskey="&removeLanguage.accesskey;"
- icon="remove" label="&removeLanguage.label;"
- oncommand="gTranslationExceptions.onLanguageDeleted();"/>
- <button id="removeAllLanguages"
- icon="clear" label="&removeAllLanguages.label;"
- accesskey="&removeAllLanguages.accesskey;"
- oncommand="gTranslationExceptions.onAllLanguagesDeleted();"/>
- <spacer flex="1"/>
- </hbox>
- </hbox>
- <separator/>
- <vbox class="contentPane" flex="1">
- <label id="languagesLabel" control="permissionsTree">&noTranslationForSites.label;</label>
- <separator class="thin"/>
- <tree id="sitesTree" flex="1" style="height: 12em;"
- hidecolumnpicker="true"
- onkeypress="gTranslationExceptions.onSiteKeyPress(event)"
- onselect="gTranslationExceptions.onSiteSelected();">
- <treecols>
- <treecol id="siteCol" label="&treehead.siteName.label;" flex="1"/>
- </treecols>
- <treechildren/>
- </tree>
- </vbox>
- </vbox>
- <hbox align="end">
- <hbox class="actionButtons" flex="1">
- <button id="removeSite" disabled="true"
- accesskey="&removeSite.accesskey;"
- icon="remove" label="&removeSite.label;"
- oncommand="gTranslationExceptions.onSiteDeleted();"/>
- <button id="removeAllSites"
- icon="clear" label="&removeAllSites.label;"
- accesskey="&removeAllSites.accesskey;"
- oncommand="gTranslationExceptions.onAllSitesDeleted();"/>
- <spacer flex="1"/>
- <button oncommand="close();" icon="close"
- label="&button.close.label;" accesskey="&button.close.accesskey;"/>
- </hbox>
- </hbox>
-</window>
diff --git a/application/basilisk/components/sessionstore/SessionFile.jsm b/application/basilisk/components/sessionstore/SessionFile.jsm
index 80c4e7790..3c55101e4 100644
--- a/application/basilisk/components/sessionstore/SessionFile.jsm
+++ b/application/basilisk/components/sessionstore/SessionFile.jsm
@@ -43,8 +43,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
"resource://gre/modules/PromiseUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RunState",
"resource:///modules/sessionstore/RunState.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
- "resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
diff --git a/application/basilisk/components/sessionstore/SessionSaver.jsm b/application/basilisk/components/sessionstore/SessionSaver.jsm
index d672f8877..fa3a67512 100644
--- a/application/basilisk/components/sessionstore/SessionSaver.jsm
+++ b/application/basilisk/components/sessionstore/SessionSaver.jsm
@@ -13,7 +13,6 @@ const Ci = Components.interfaces;
Cu.import("resource://gre/modules/Timer.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
@@ -52,19 +51,6 @@ function notify(subject, topic) {
Services.obs.notifyObservers(subject, topic, "");
}
-// TelemetryStopwatch helper functions.
-function stopWatch(method) {
- return function (...histograms) {
- for (let hist of histograms) {
- TelemetryStopwatch[method]("FX_SESSION_RESTORE_" + hist);
- }
- };
-}
-
-var stopWatchStart = stopWatch("start");
-var stopWatchCancel = stopWatch("cancel");
-var stopWatchFinish = stopWatch("finish");
-
/**
* The external API implemented by the SessionSaver module.
*/
@@ -182,7 +168,6 @@ var SessionSaverInternal = {
return Promise.resolve();
}
- stopWatchStart("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS");
let state = SessionStore.getCurrentState(forceUpdateAllWindows);
PrivacyFilter.filterPrivateWindowsAndTabs(state);
@@ -226,7 +211,6 @@ var SessionSaverInternal = {
}
}
- stopWatchFinish("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS");
return this._writeState(state);
},
diff --git a/application/basilisk/components/sessionstore/SessionStorage.jsm b/application/basilisk/components/sessionstore/SessionStorage.jsm
index 705139ebf..7499f95e9 100644
--- a/application/basilisk/components/sessionstore/SessionStorage.jsm
+++ b/application/basilisk/components/sessionstore/SessionStorage.jsm
@@ -74,7 +74,14 @@ var SessionStorageInternal = {
// Get the origin of the current history entry
// and use that as a key for the per-principal storage data.
- let origin = principal.origin;
+ let origin;
+ try {
+ // The origin getter may throw for about:blank iframes as of bug 1340710,
+ // but we should ignore them anyway. The same goes for custom protocols.
+ origin = principal.origin;
+ } catch (e) {
+ return;
+ }
if (visitedOrigins.has(origin)) {
// Don't read a host twice.
return;
diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm
index 6b30943f3..b599bc162 100644
--- a/application/basilisk/components/sessionstore/SessionStore.jsm
+++ b/application/basilisk/components/sessionstore/SessionStore.jsm
@@ -135,7 +135,6 @@ Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this);
Cu.import("resource://gre/modules/Promise.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", this);
Cu.import("resource://gre/modules/Timer.jsm", this);
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
@@ -564,7 +563,6 @@ var SessionStoreInternal = {
* Initialize the session using the state provided by SessionStartup
*/
initSession: function () {
- TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS");
let state;
let ss = gSessionStartup;
@@ -640,7 +638,6 @@ var SessionStoreInternal = {
this._prefBranch.getBoolPref("sessionstore.resume_session_once"))
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
- TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS");
return state;
},
@@ -1247,9 +1244,7 @@ var SessionStoreInternal = {
if (initialState) {
Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, "");
}
- TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS");
this.initializeWindow(aWindow, initialState);
- TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS");
// Let everyone know we're done.
this._deferredInitialized.resolve();
@@ -2857,7 +2852,6 @@ var SessionStoreInternal = {
var activeWindow = this._getMostRecentBrowserWindow();
- TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS");
if (RunState.isRunning) {
// update the data for all windows with activities since the last save operation
this._forEachBrowserWindow(function(aWindow) {
@@ -2872,7 +2866,6 @@ var SessionStoreInternal = {
});
DirtyWindows.clear();
}
- TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS");
// An array that at the end will hold all current window data.
var total = [];
@@ -2892,9 +2885,7 @@ var SessionStoreInternal = {
nonPopupCount++;
}
- TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS");
SessionCookies.update(total);
- TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS");
// collect the data for all windows yet to be restored
for (ix in this._statesToRestore) {
@@ -3063,8 +3054,6 @@ var SessionStoreInternal = {
if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi]))
this.onLoad(aWindow);
- TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
-
// We're not returning from this before we end up calling restoreTabs
// for this window, so make sure we send the SSWindowStateBusy event.
this._setWindowStateBusy(aWindow);
@@ -3124,7 +3113,8 @@ var SessionStoreInternal = {
tabbrowser.addTab("about:blank",
{skipAnimation: true,
forceNotRemote,
- userContextId});
+ userContextId,
+ skipBackgroundNotify: true});
// If we inserted a new tab because the userContextId didn't match with the
// open tab, even though `t < openTabCount`, we need to remove that open tab
@@ -3235,8 +3225,6 @@ var SessionStoreInternal = {
// set smoothScroll back to the original value
tabstrip.smoothScroll = smoothScroll;
- TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
-
this._setWindowStateReady(aWindow);
this._sendWindowRestoredNotification(aWindow);
diff --git a/application/basilisk/components/sessionstore/TabAttributes.jsm b/application/basilisk/components/sessionstore/TabAttributes.jsm
index 8a29680f4..c8e6d9744 100644
--- a/application/basilisk/components/sessionstore/TabAttributes.jsm
+++ b/application/basilisk/components/sessionstore/TabAttributes.jsm
@@ -14,7 +14,10 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
// 'pending' is used internal by sessionstore and managed accordingly.
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
// using the gBrowser.getIcon()/setIcon() methods.
-const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal"]);
+// 'skipbackgroundnotify' is used internal by tabbrowser.xml.
+const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending",
+ "iconLoadingPrincipal",
+ "skipbackgroundnotify"]);
// A set of tab attributes to persist. We will read a given list of tab
// attributes when collecting tab data and will re-set those attributes when
diff --git a/application/basilisk/components/sessionstore/nsSessionStartup.js b/application/basilisk/components/sessionstore/nsSessionStartup.js
index 7593c48ec..9cda1552e 100644
--- a/application/basilisk/components/sessionstore/nsSessionStartup.js
+++ b/application/basilisk/components/sessionstore/nsSessionStartup.js
@@ -37,7 +37,6 @@ const Cr = Components.results;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/TelemetryStopwatch.jsm");
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
diff --git a/application/basilisk/components/translation/BingTranslator.jsm b/application/basilisk/components/translation/BingTranslator.jsm
deleted file mode 100644
index fc1cc942a..000000000
--- a/application/basilisk/components/translation/BingTranslator.jsm
+++ /dev/null
@@ -1,449 +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 = [ "BingTranslator" ];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Http.jsm");
-
-// The maximum amount of net data allowed per request on Bing's API.
-const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere
- // close to that is refused by the service.
-
-// The maximum number of chunks allowed to be translated in a single
-// request.
-const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000.
-
-// Self-imposed limit of 15 requests. This means that a page that would need
-// to be broken in more than 15 requests won't be fully translated.
-// The maximum amount of data that we will translate for a single page
-// is MAX_REQUESTS * MAX_REQUEST_DATA.
-const MAX_REQUESTS = 15;
-
-/**
- * Translates a webpage using Bing's Translation API.
- *
- * @param translationDocument The TranslationDocument object that represents
- * the webpage to be translated
- * @param sourceLanguage The source language of the document
- * @param targetLanguage The target language for the translation
- *
- * @returns {Promise} A promise that will resolve when the translation
- * task is finished.
- */
-this.BingTranslator = function(translationDocument, sourceLanguage, targetLanguage) {
- this.translationDocument = translationDocument;
- this.sourceLanguage = sourceLanguage;
- this.targetLanguage = targetLanguage;
- this._pendingRequests = 0;
- this._partialSuccess = false;
- this._serviceUnavailable = false;
- this._translatedCharacterCount = 0;
-};
-
-this.BingTranslator.prototype = {
- /**
- * Performs the translation, splitting the document into several chunks
- * respecting the data limits of the API.
- *
- * @returns {Promise} A promise that will resolve when the translation
- * task is finished.
- */
- translate: function() {
- return Task.spawn(function *() {
- let currentIndex = 0;
- this._onFinishedDeferred = Promise.defer();
-
- // Let's split the document into various requests to be sent to
- // Bing's Translation API.
- for (let requestCount = 0; requestCount < MAX_REQUESTS; requestCount++) {
- // Generating the text for each request can be expensive, so
- // let's take the opportunity of the chunkification process to
- // allow for the event loop to attend other pending events
- // before we continue.
- yield CommonUtils.laterTickResolvingPromise();
-
- // Determine the data for the next request.
- let request = this._generateNextTranslationRequest(currentIndex);
-
- // Create a real request to the server, and put it on the
- // pending requests list.
- let bingRequest = new BingRequest(request.data,
- this.sourceLanguage,
- this.targetLanguage);
- this._pendingRequests++;
- bingRequest.fireRequest().then(this._chunkCompleted.bind(this),
- this._chunkFailed.bind(this));
-
- currentIndex = request.lastIndex;
- if (request.finished) {
- break;
- }
- }
-
- return this._onFinishedDeferred.promise;
- }.bind(this));
- },
-
- /**
- * Resets the expiration time of the current token, in order to
- * force the token manager to ask for a new token during the next request.
- */
- _resetToken : function() {
- // Force the token manager to get update token
- BingTokenManager._currentExpiryTime = 0;
- },
-
- /**
- * Function called when a request sent to the server completed successfully.
- * This function handles calling the function to parse the result and the
- * function to resolve the promise returned by the public `translate()`
- * method when there's no pending request left.
- *
- * @param request The BingRequest sent to the server.
- */
- _chunkCompleted: function(bingRequest) {
- if (this._parseChunkResult(bingRequest)) {
- this._partialSuccess = true;
- // Count the number of characters successfully translated.
- this._translatedCharacterCount += bingRequest.characterCount;
- }
-
- this._checkIfFinished();
- },
-
- /**
- * Function called when a request sent to the server has failed.
- * This function handles deciding if the error is transient or means the
- * service is unavailable (zero balance on the key or request credentials are
- * not in an active state) and calling the function to resolve the promise
- * returned by the public `translate()` method when there's no pending.
- * request left.
- *
- * @param aError [optional] The XHR object of the request that failed.
- */
- _chunkFailed: function(aError) {
- if (aError instanceof Ci.nsIXMLHttpRequest &&
- [400, 401].indexOf(aError.status) != -1) {
- let body = aError.responseText;
- if (body && body.includes("TranslateApiException") &&
- (body.includes("balance") || body.includes("active state")))
- this._serviceUnavailable = true;
- }
-
- this._checkIfFinished();
- },
-
- /**
- * Function called when a request sent to the server has completed.
- * This function handles resolving the promise
- * returned by the public `translate()` method when all chunks are completed.
- */
- _checkIfFinished: function() {
- // Check if all pending requests have been
- // completed and then resolves the promise.
- // If at least one chunk was successful, the
- // promise will be resolved positively which will
- // display the "Success" state for the infobar. Otherwise,
- // the "Error" state will appear.
- if (--this._pendingRequests == 0) {
- if (this._partialSuccess) {
- this._onFinishedDeferred.resolve({
- characterCount: this._translatedCharacterCount
- });
- } else {
- let error = this._serviceUnavailable ? "unavailable" : "failure";
- this._onFinishedDeferred.reject(error);
- }
- }
- },
-
- /**
- * This function parses the result returned by Bing's Http.svc API,
- * which is a XML file that contains a number of elements. To our
- * particular interest, the only part of the response that matters
- * are the <TranslatedText> nodes, which contains the resulting
- * items that were sent to be translated.
- *
- * @param request The request sent to the server.
- * @returns boolean True if parsing of this chunk was successful.
- */
- _parseChunkResult: function(bingRequest) {
- let results;
- try {
- let doc = bingRequest.networkRequest.responseXML;
- results = doc.querySelectorAll("TranslatedText");
- } catch (e) {
- return false;
- }
-
- let len = results.length;
- if (len != bingRequest.translationData.length) {
- // This should never happen, but if the service returns a different number
- // of items (from the number of items submitted), we can't use this chunk
- // because all items would be paired incorrectly.
- return false;
- }
-
- let error = false;
- for (let i = 0; i < len; i++) {
- try {
- let result = results[i].firstChild.nodeValue;
- let root = bingRequest.translationData[i][0];
-
- if (root.isSimpleRoot) {
- // Workaround for Bing's service problem in which "&" chars in
- // plain-text TranslationItems are double-escaped.
- result = result.replace(/&amp;/g, "&");
- }
-
- root.parseResult(result);
- } catch (e) { error = true; }
- }
-
- return !error;
- },
-
- /**
- * This function will determine what is the data to be used for
- * the Nth request we are generating, based on the input params.
- *
- * @param startIndex What is the index, in the roots list, that the
- * chunk should start.
- */
- _generateNextTranslationRequest: function(startIndex) {
- let currentDataSize = 0;
- let currentChunks = 0;
- let output = [];
- let rootsList = this.translationDocument.roots;
-
- for (let i = startIndex; i < rootsList.length; i++) {
- let root = rootsList[i];
- let text = this.translationDocument.generateTextForItem(root);
- if (!text) {
- continue;
- }
-
- text = escapeXML(text);
- let newCurSize = currentDataSize + text.length;
- let newChunks = currentChunks + 1;
-
- if (newCurSize > MAX_REQUEST_DATA ||
- newChunks > MAX_REQUEST_CHUNKS) {
-
- // If we've reached the API limits, let's stop accumulating data
- // for this request and return. We return information useful for
- // the caller to pass back on the next call, so that the function
- // can keep working from where it stopped.
- return {
- data: output,
- finished: false,
- lastIndex: i
- };
- }
-
- currentDataSize = newCurSize;
- currentChunks = newChunks;
- output.push([root, text]);
- }
-
- return {
- data: output,
- finished: true,
- lastIndex: 0
- };
- }
-};
-
-/**
- * Represents a request (for 1 chunk) sent off to Bing's service.
- *
- * @params translationData The data to be used for this translation,
- * generated by the generateNextTranslationRequest...
- * function.
- * @param sourceLanguage The source language of the document.
- * @param targetLanguage The target language for the translation.
- *
- */
-function BingRequest(translationData, sourceLanguage, targetLanguage) {
- this.translationData = translationData;
- this.sourceLanguage = sourceLanguage;
- this.targetLanguage = targetLanguage;
- this.characterCount = 0;
-}
-
-BingRequest.prototype = {
- /**
- * Initiates the request
- */
- fireRequest: function() {
- return Task.spawn(function *() {
- // Prepare authentication.
- let token = yield BingTokenManager.getToken();
- let auth = "Bearer " + token;
-
- // Prepare URL.
- let url = getUrlParam("https://api.microsofttranslator.com/v2/Http.svc/TranslateArray",
- "browser.translation.bing.translateArrayURL");
-
- // Prepare request headers.
- let headers = [["Content-type", "text/xml"], ["Authorization", auth]];
-
- // Prepare the request body.
- let requestString =
- '<TranslateArrayRequest>' +
- '<AppId/>' +
- '<From>' + this.sourceLanguage + '</From>' +
- '<Options>' +
- '<ContentType xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2">text/html</ContentType>' +
- '<ReservedFlags xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2" />' +
- '</Options>' +
- '<Texts xmlns:s="http://schemas.microsoft.com/2003/10/Serialization/Arrays">';
-
- for (let [, text] of this.translationData) {
- requestString += '<s:string>' + text + '</s:string>';
- this.characterCount += text.length;
- }
-
- requestString += '</Texts>' +
- '<To>' + this.targetLanguage + '</To>' +
- '</TranslateArrayRequest>';
-
- // Set up request options.
- let deferred = Promise.defer();
- let options = {
- onLoad: (function(responseText, xhr) {
- deferred.resolve(this);
- }).bind(this),
- onError: function(e, responseText, xhr) {
- deferred.reject(xhr);
- },
- postData: requestString,
- headers: headers
- };
-
- // Fire the request.
- let request = httpRequest(url, options);
-
- // Override the response MIME type.
- request.overrideMimeType("text/xml");
- this.networkRequest = request;
- return deferred.promise;
- }.bind(this));
- }
-};
-
-/**
- * Authentication Token manager for the API
- */
-var BingTokenManager = {
- _currentToken: null,
- _currentExpiryTime: 0,
- _pendingRequest: null,
-
- /**
- * Get a valid, non-expired token to be used for the API calls.
- *
- * @returns {Promise} A promise that resolves with the token
- * string once it is obtained. The token returned
- * can be the same one used in the past if it is still
- * valid.
- */
- getToken: function() {
- if (this._pendingRequest) {
- return this._pendingRequest;
- }
-
- let remainingMs = this._currentExpiryTime - new Date();
- // Our existing token is still good for more than a minute, let's use it.
- if (remainingMs > 60 * 1000) {
- return Promise.resolve(this._currentToken);
- }
-
- return this._getNewToken();
- },
-
- /**
- * Generates a new token from the server.
- *
- * @returns {Promise} A promise that resolves with the token
- * string once it is obtained.
- */
- _getNewToken: function() {
- let url = getUrlParam("https://datamarket.accesscontrol.windows.net/v2/OAuth2-13",
- "browser.translation.bing.authURL");
- let params = [
- ["grant_type", "client_credentials"],
- ["scope", "http://api.microsofttranslator.com"],
- ["client_id",
- getUrlParam("%BING_API_CLIENTID%", "browser.translation.bing.clientIdOverride")],
- ["client_secret",
- getUrlParam("%BING_API_KEY%", "browser.translation.bing.apiKeyOverride")]
- ];
-
- let deferred = Promise.defer();
- let options = {
- onLoad: function(responseText, xhr) {
- BingTokenManager._pendingRequest = null;
- try {
- let json = JSON.parse(responseText);
-
- if (json.error) {
- deferred.reject(json.error);
- return;
- }
-
- let token = json.access_token;
- let expires_in = json.expires_in;
- BingTokenManager._currentToken = token;
- BingTokenManager._currentExpiryTime = new Date(Date.now() + expires_in * 1000);
- deferred.resolve(token);
- } catch (e) {
- deferred.reject(e);
- }
- },
- onError: function(e, responseText, xhr) {
- BingTokenManager._pendingRequest = null;
- deferred.reject(e);
- },
- postData: params
- };
-
- this._pendingRequest = deferred.promise;
- httpRequest(url, options);
-
- return deferred.promise;
- }
-};
-
-/**
- * Escape a string to be valid XML content.
- */
-function escapeXML(aStr) {
- return aStr.toString()
- .replace(/&/g, "&amp;")
- .replace(/\"/g, "&quot;")
- .replace(/\'/g, "&apos;")
- .replace(/</g, "&lt;")
- .replace(/>/g, "&gt;");
-}
-
-/**
- * Fetch an auth token (clientID or client secret), which may be overridden by
- * a pref if it's set.
- */
-function getUrlParam(paramValue, prefName) {
- if (Services.prefs.getPrefType(prefName))
- paramValue = Services.prefs.getCharPref(prefName);
- paramValue = Services.urlFormatter.formatURL(paramValue);
- return paramValue;
-}
diff --git a/application/basilisk/components/translation/Translation.jsm b/application/basilisk/components/translation/Translation.jsm
deleted file mode 100644
index 15a847c13..000000000
--- a/application/basilisk/components/translation/Translation.jsm
+++ /dev/null
@@ -1,446 +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 = [
- "Translation",
- "TranslationTelemetry",
-];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-const TRANSLATION_PREF_SHOWUI = "browser.translation.ui.show";
-const TRANSLATION_PREF_DETECT_LANG = "browser.translation.detectLanguage";
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-this.Translation = {
- STATE_OFFER: 0,
- STATE_TRANSLATING: 1,
- STATE_TRANSLATED: 2,
- STATE_ERROR: 3,
- STATE_UNAVAILABLE: 4,
-
- serviceUnavailable: false,
-
- supportedSourceLanguages: ["bg", "cs", "de", "en", "es", "fr", "ja", "ko", "nl", "no", "pl", "pt", "ru", "tr", "vi", "zh"],
- supportedTargetLanguages: ["bg", "cs", "de", "en", "es", "fr", "ja", "ko", "nl", "no", "pl", "pt", "ru", "tr", "vi", "zh"],
-
- _defaultTargetLanguage: "",
- get defaultTargetLanguage() {
- if (!this._defaultTargetLanguage) {
- this._defaultTargetLanguage = Cc["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry)
- .getSelectedLocale("global")
- .split("-")[0];
- }
- return this._defaultTargetLanguage;
- },
-
- documentStateReceived: function(aBrowser, aData) {
- if (aData.state == this.STATE_OFFER) {
- if (aData.detectedLanguage == this.defaultTargetLanguage) {
- // Detected language is the same as the user's locale.
- return;
- }
-
- if (this.supportedSourceLanguages.indexOf(aData.detectedLanguage) == -1) {
- // Detected language is not part of the supported languages.
- TranslationTelemetry.recordMissedTranslationOpportunity(aData.detectedLanguage);
- return;
- }
-
- TranslationTelemetry.recordTranslationOpportunity(aData.detectedLanguage);
- }
-
- if (!Services.prefs.getBoolPref(TRANSLATION_PREF_SHOWUI))
- return;
-
- if (!aBrowser.translationUI)
- aBrowser.translationUI = new TranslationUI(aBrowser);
- let trUI = aBrowser.translationUI;
-
- // Set all values before showing a new translation infobar.
- trUI._state = Translation.serviceUnavailable ? Translation.STATE_UNAVAILABLE
- : aData.state;
- trUI.detectedLanguage = aData.detectedLanguage;
- trUI.translatedFrom = aData.translatedFrom;
- trUI.translatedTo = aData.translatedTo;
- trUI.originalShown = aData.originalShown;
-
- trUI.showURLBarIcon();
-
- if (trUI.shouldShowInfoBar(aBrowser.currentURI))
- trUI.showTranslationInfoBar();
- },
-
- openProviderAttribution: function() {
- let attribution = this.supportedEngines[this.translationEngine];
- Cu.import("resource:///modules/RecentWindow.jsm");
- RecentWindow.getMostRecentBrowserWindow().openUILinkIn(attribution, "tab");
- },
-
- /**
- * The list of translation engines and their attributions.
- */
- supportedEngines: {
- "bing" : "http://aka.ms/MicrosoftTranslatorAttribution",
- "yandex" : "http://translate.yandex.com/"
- },
-
- /**
- * Fallback engine (currently Bing Translator) if the preferences seem
- * confusing.
- */
- get defaultEngine() {
- return this.supportedEngines.keys[0];
- },
-
- /**
- * Returns the name of the preferred translation engine.
- */
- get translationEngine() {
- let engine = Services.prefs.getCharPref("browser.translation.engine");
- return Object.keys(this.supportedEngines).indexOf(engine) == -1 ? this.defaultEngine : engine;
- },
-};
-
-/* TranslationUI objects keep the information related to translation for
- * a specific browser. This object is passed to the translation
- * infobar so that it can initialize itself. The properties exposed to
- * the infobar are:
- * - detectedLanguage, code of the language detected on the web page.
- * - state, the state in which the infobar should be displayed
- * - translatedFrom, if already translated, source language code.
- * - translatedTo, if already translated, target language code.
- * - translate, method starting the translation of the current page.
- * - showOriginalContent, method showing the original page content.
- * - showTranslatedContent, method showing the translation for an
- * already translated page whose original content is shown.
- * - originalShown, boolean indicating if the original or translated
- * version of the page is shown.
- */
-function TranslationUI(aBrowser) {
- this.browser = aBrowser;
-}
-
-TranslationUI.prototype = {
- get browser() {
- return this._browser;
- },
- set browser(aBrowser) {
- if (this._browser)
- this._browser.messageManager.removeMessageListener("Translation:Finished", this);
- aBrowser.messageManager.addMessageListener("Translation:Finished", this);
- this._browser = aBrowser;
- },
- translate: function(aFrom, aTo) {
- if (aFrom == aTo ||
- (this.state == Translation.STATE_TRANSLATED &&
- this.translatedFrom == aFrom && this.translatedTo == aTo)) {
- // Nothing to do.
- return;
- }
-
- if (this.state == Translation.STATE_OFFER) {
- if (this.detectedLanguage != aFrom)
- TranslationTelemetry.recordDetectedLanguageChange(true);
- } else {
- if (this.translatedFrom != aFrom)
- TranslationTelemetry.recordDetectedLanguageChange(false);
- if (this.translatedTo != aTo)
- TranslationTelemetry.recordTargetLanguageChange();
- }
-
- this.state = Translation.STATE_TRANSLATING;
- this.translatedFrom = aFrom;
- this.translatedTo = aTo;
-
- this.browser.messageManager.sendAsyncMessage(
- "Translation:TranslateDocument",
- { from: aFrom, to: aTo }
- );
- },
-
- showURLBarIcon: function() {
- let chromeWin = this.browser.ownerGlobal;
- let PopupNotifications = chromeWin.PopupNotifications;
- let removeId = this.originalShown ? "translated" : "translate";
- let notification =
- PopupNotifications.getNotification(removeId, this.browser);
- if (notification)
- PopupNotifications.remove(notification);
-
- let callback = (aTopic, aNewBrowser) => {
- if (aTopic == "swapping") {
- let infoBarVisible =
- this.notificationBox.getNotificationWithValue("translation");
- aNewBrowser.translationUI = this;
- this.browser = aNewBrowser;
- if (infoBarVisible)
- this.showTranslationInfoBar();
- return true;
- }
-
- if (aTopic != "showing")
- return false;
- let notification = this.notificationBox.getNotificationWithValue("translation");
- if (notification)
- notification.close();
- else
- this.showTranslationInfoBar();
- return true;
- };
-
- let addId = this.originalShown ? "translate" : "translated";
- PopupNotifications.show(this.browser, addId, null,
- addId + "-notification-icon", null, null,
- {dismissed: true, eventCallback: callback});
- },
-
- _state: 0,
- get state() {
- return this._state;
- },
- set state(val) {
- let notif = this.notificationBox.getNotificationWithValue("translation");
- if (notif)
- notif.state = val;
- this._state = val;
- },
-
- originalShown: true,
- showOriginalContent: function() {
- this.originalShown = true;
- this.showURLBarIcon();
- this.browser.messageManager.sendAsyncMessage("Translation:ShowOriginal");
- TranslationTelemetry.recordShowOriginalContent();
- },
-
- showTranslatedContent: function() {
- this.originalShown = false;
- this.showURLBarIcon();
- this.browser.messageManager.sendAsyncMessage("Translation:ShowTranslation");
- },
-
- get notificationBox() {
- return this.browser.ownerGlobal.gBrowser.getNotificationBox(this.browser);
- },
-
- showTranslationInfoBar: function() {
- let notificationBox = this.notificationBox;
- let notif = notificationBox.appendNotification("", "translation", null,
- notificationBox.PRIORITY_INFO_HIGH);
- notif.init(this);
- return notif;
- },
-
- shouldShowInfoBar: function(aURI) {
- // Never show the infobar automatically while the translation
- // service is temporarily unavailable.
- if (Translation.serviceUnavailable)
- return false;
-
- // Check if we should never show the infobar for this language.
- let neverForLangs =
- Services.prefs.getCharPref("browser.translation.neverForLanguages");
- if (neverForLangs.split(",").indexOf(this.detectedLanguage) != -1) {
- TranslationTelemetry.recordAutoRejectedTranslationOffer();
- return false;
- }
-
- // or if we should never show the infobar for this domain.
- let perms = Services.perms;
- if (perms.testExactPermission(aURI, "translate") == perms.DENY_ACTION) {
- TranslationTelemetry.recordAutoRejectedTranslationOffer();
- return false;
- }
-
- return true;
- },
-
- receiveMessage: function(msg) {
- switch (msg.name) {
- case "Translation:Finished":
- if (msg.data.success) {
- this.originalShown = false;
- this.state = Translation.STATE_TRANSLATED;
- this.showURLBarIcon();
-
- // Record the number of characters translated.
- TranslationTelemetry.recordTranslation(msg.data.from, msg.data.to,
- msg.data.characterCount);
- } else if (msg.data.unavailable) {
- Translation.serviceUnavailable = true;
- this.state = Translation.STATE_UNAVAILABLE;
- } else {
- this.state = Translation.STATE_ERROR;
- }
- break;
- }
- },
-
- infobarClosed: function() {
- if (this.state == Translation.STATE_OFFER)
- TranslationTelemetry.recordDeniedTranslationOffer();
- }
-};
-
-/**
- * Uses telemetry histograms for collecting statistics on the usage of the
- * translation component.
- *
- * NOTE: Metrics are only recorded if the user enabled the telemetry option.
- */
-this.TranslationTelemetry = {
-
- init: function () {
- // Constructing histograms.
- const plain = (id) => Services.telemetry.getHistogramById(id);
- const keyed = (id) => Services.telemetry.getKeyedHistogramById(id);
- this.HISTOGRAMS = {
- OPPORTUNITIES : () => plain("TRANSLATION_OPPORTUNITIES"),
- OPPORTUNITIES_BY_LANG : () => keyed("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"),
- PAGES : () => plain("TRANSLATED_PAGES"),
- PAGES_BY_LANG : () => keyed("TRANSLATED_PAGES_BY_LANGUAGE"),
- CHARACTERS : () => plain("TRANSLATED_CHARACTERS"),
- DENIED : () => plain("DENIED_TRANSLATION_OFFERS"),
- AUTO_REJECTED : () => plain("AUTO_REJECTED_TRANSLATION_OFFERS"),
- SHOW_ORIGINAL : () => plain("REQUESTS_OF_ORIGINAL_CONTENT"),
- TARGET_CHANGES : () => plain("CHANGES_OF_TARGET_LANGUAGE"),
- DETECTION_CHANGES : () => plain("CHANGES_OF_DETECTED_LANGUAGE"),
- SHOW_UI : () => plain("SHOULD_TRANSLATION_UI_APPEAR"),
- DETECT_LANG : () => plain("SHOULD_AUTO_DETECT_LANGUAGE"),
- };
-
- // Capturing the values of flags at the startup.
- this.recordPreferences();
- },
-
- /**
- * Record a translation opportunity in the health report.
- * @param language
- * The language of the page.
- */
- recordTranslationOpportunity: function (language) {
- return this._recordOpportunity(language, true);
- },
-
- /**
- * Record a missed translation opportunity in the health report.
- * A missed opportunity is when the language detected is not part
- * of the supported languages.
- * @param language
- * The language of the page.
- */
- recordMissedTranslationOpportunity: function (language) {
- return this._recordOpportunity(language, false);
- },
-
- /**
- * Record an automatically rejected translation offer in the health
- * report. A translation offer is automatically rejected when a user
- * has previously clicked "Never translate this language" or "Never
- * translate this site", which results in the infobar not being shown for
- * the translation opportunity.
- *
- * These translation opportunities should still be recorded in addition to
- * recording the automatic rejection of the offer.
- */
- recordAutoRejectedTranslationOffer: function () {
- if (!this._canRecord) return;
- this.HISTOGRAMS.AUTO_REJECTED().add();
- },
-
- /**
- * Record a translation in the health report.
- * @param langFrom
- * The language of the page.
- * @param langTo
- * The language translated to
- * @param numCharacters
- * The number of characters that were translated
- */
- recordTranslation: function (langFrom, langTo, numCharacters) {
- if (!this._canRecord) return;
- this.HISTOGRAMS.PAGES().add();
- this.HISTOGRAMS.PAGES_BY_LANG().add(langFrom + " -> " + langTo);
- this.HISTOGRAMS.CHARACTERS().add(numCharacters);
- },
-
- /**
- * Record a change of the detected language in the health report. This should
- * only be called when actually executing a translation, not every time the
- * user changes in the language in the UI.
- *
- * @param beforeFirstTranslation
- * A boolean indicating if we are recording a change of detected
- * language before translating the page for the first time. If we
- * have already translated the page from the detected language and
- * the user has manually adjusted the detected language false should
- * be passed.
- */
- recordDetectedLanguageChange: function (beforeFirstTranslation) {
- if (!this._canRecord) return;
- this.HISTOGRAMS.DETECTION_CHANGES().add(beforeFirstTranslation);
- },
-
- /**
- * Record a change of the target language in the health report. This should
- * only be called when actually executing a translation, not every time the
- * user changes in the language in the UI.
- */
- recordTargetLanguageChange: function () {
- if (!this._canRecord) return;
- this.HISTOGRAMS.TARGET_CHANGES().add();
- },
-
- /**
- * Record a denied translation offer.
- */
- recordDeniedTranslationOffer: function () {
- if (!this._canRecord) return;
- this.HISTOGRAMS.DENIED().add();
- },
-
- /**
- * Record a "Show Original" command use.
- */
- recordShowOriginalContent: function () {
- if (!this._canRecord) return;
- this.HISTOGRAMS.SHOW_ORIGINAL().add();
- },
-
- /**
- * Record the state of translation preferences.
- */
- recordPreferences: function () {
- if (!this._canRecord) return;
- if (Services.prefs.getBoolPref(TRANSLATION_PREF_SHOWUI)) {
- this.HISTOGRAMS.SHOW_UI().add(1);
- }
- if (Services.prefs.getBoolPref(TRANSLATION_PREF_DETECT_LANG)) {
- this.HISTOGRAMS.DETECT_LANG().add(1);
- }
- },
-
- _recordOpportunity: function(language, success) {
- if (!this._canRecord) return;
- this.HISTOGRAMS.OPPORTUNITIES().add(success);
- this.HISTOGRAMS.OPPORTUNITIES_BY_LANG().add(language, success);
- },
-
- /**
- * A shortcut for reading the telemetry preference.
- *
- */
- _canRecord: function () {
- return Services.prefs.getBoolPref("toolkit.telemetry.enabled");
- }
-};
-
-this.TranslationTelemetry.init();
diff --git a/application/basilisk/components/translation/TranslationContentHandler.jsm b/application/basilisk/components/translation/TranslationContentHandler.jsm
deleted file mode 100644
index 3b0d59ddd..000000000
--- a/application/basilisk/components/translation/TranslationContentHandler.jsm
+++ /dev/null
@@ -1,181 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [ "TranslationContentHandler" ];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
- "resource:///modules/translation/LanguageDetector.jsm");
-
-const STATE_OFFER = 0;
-const STATE_TRANSLATED = 2;
-const STATE_ERROR = 3;
-
-this.TranslationContentHandler = function(global, docShell) {
- let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebProgress);
- webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
-
- global.addEventListener("pageshow", this);
-
- global.addMessageListener("Translation:TranslateDocument", this);
- global.addMessageListener("Translation:ShowTranslation", this);
- global.addMessageListener("Translation:ShowOriginal", this);
- this.global = global;
-}
-
-TranslationContentHandler.prototype = {
- handleEvent: function(aEvent) {
- // We are only listening to pageshow events.
- let target = aEvent.target;
-
- // Only handle top-level frames.
- let win = target.defaultView;
- if (win.parent !== win)
- return;
-
- let content = this.global.content;
- if (!content.detectedLanguage)
- return;
-
- let data = {};
- let trDoc = content.translationDocument;
- if (trDoc) {
- data.state = trDoc.translationError ? STATE_ERROR : STATE_TRANSLATED;
- data.translatedFrom = trDoc.translatedFrom;
- data.translatedTo = trDoc.translatedTo;
- data.originalShown = trDoc.originalShown;
- } else {
- data.state = STATE_OFFER;
- data.originalShown = true;
- }
- data.detectedLanguage = content.detectedLanguage;
-
- this.global.sendAsyncMessage("Translation:DocumentState", data);
- },
-
- /* nsIWebProgressListener implementation */
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
- if (!aWebProgress.isTopLevel ||
- !(aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) ||
- !this.global.content)
- return;
-
- let url = aRequest.name;
- if (!url.startsWith("http://") && !url.startsWith("https://"))
- return;
-
- let content = this.global.content;
- if (content.detectedLanguage)
- return;
-
- // Grab a 60k sample of text from the page.
- let encoder = Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
- .createInstance(Ci.nsIDocumentEncoder);
- encoder.init(content.document, "text/plain", encoder.SkipInvisibleContent);
- let string = encoder.encodeToStringWithMaxLength(60 * 1024);
-
- // Language detection isn't reliable on very short strings.
- if (string.length < 100)
- return;
-
- LanguageDetector.detectLanguage(string).then(result => {
- // Bail if we're not confident.
- if (!result.confident) {
- return;
- }
-
- // The window might be gone by now.
- if (Cu.isDeadWrapper(content)) {
- return;
- }
-
- content.detectedLanguage = result.language;
-
- let data = {
- state: STATE_OFFER,
- originalShown: true,
- detectedLanguage: result.language
- };
- this.global.sendAsyncMessage("Translation:DocumentState", data);
- });
- },
-
- // Unused methods.
- onProgressChange: function() {},
- onLocationChange: function() {},
- onStatusChange: function() {},
- onSecurityChange: function() {},
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference]),
-
- receiveMessage: function(msg) {
- switch (msg.name) {
- case "Translation:TranslateDocument":
- {
- Cu.import("resource:///modules/translation/TranslationDocument.jsm");
-
- // If a TranslationDocument already exists for this document, it should
- // be used instead of creating a new one so that we can use the original
- // content of the page for the new translation instead of the newly
- // translated text.
- let translationDocument = this.global.content.translationDocument ||
- new TranslationDocument(this.global.content.document);
-
- let preferredEngine = Services.prefs.getCharPref("browser.translation.engine");
- let translator = null;
- if (preferredEngine == "yandex") {
- Cu.import("resource:///modules/translation/YandexTranslator.jsm");
- translator = new YandexTranslator(translationDocument,
- msg.data.from,
- msg.data.to);
- } else {
- Cu.import("resource:///modules/translation/BingTranslator.jsm");
- translator = new BingTranslator(translationDocument,
- msg.data.from,
- msg.data.to);
- }
-
- this.global.content.translationDocument = translationDocument;
- translationDocument.translatedFrom = msg.data.from;
- translationDocument.translatedTo = msg.data.to;
- translationDocument.translationError = false;
-
- translator.translate().then(
- result => {
- this.global.sendAsyncMessage("Translation:Finished", {
- characterCount: result.characterCount,
- from: msg.data.from,
- to: msg.data.to,
- success: true
- });
- translationDocument.showTranslation();
- },
- error => {
- translationDocument.translationError = true;
- let data = {success: false};
- if (error == "unavailable")
- data.unavailable = true;
- this.global.sendAsyncMessage("Translation:Finished", data);
- }
- );
- break;
- }
-
- case "Translation:ShowOriginal":
- this.global.content.translationDocument.showOriginal();
- break;
-
- case "Translation:ShowTranslation":
- this.global.content.translationDocument.showTranslation();
- break;
- }
- }
-};
diff --git a/application/basilisk/components/translation/TranslationDocument.jsm b/application/basilisk/components/translation/TranslationDocument.jsm
deleted file mode 100644
index 058d07a49..000000000
--- a/application/basilisk/components/translation/TranslationDocument.jsm
+++ /dev/null
@@ -1,683 +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 = [ "TranslationDocument" ];
-
-const SHOW_ELEMENT = Ci.nsIDOMNodeFilter.SHOW_ELEMENT;
-const SHOW_TEXT = Ci.nsIDOMNodeFilter.SHOW_TEXT;
-const TEXT_NODE = Ci.nsIDOMNode.TEXT_NODE;
-
-Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Task.jsm");
-
-/**
- * This class represents a document that is being translated,
- * and it is responsible for parsing the document,
- * generating the data structures translation (the list of
- * translation items and roots), and managing the original
- * and translated texts on the translation items.
- *
- * @param document The document to be translated
- */
-this.TranslationDocument = function(document) {
- this.itemsMap = new Map();
- this.roots = [];
- this._init(document);
-};
-
-this.TranslationDocument.prototype = {
- translatedFrom: "",
- translatedTo: "",
- translationError: false,
- originalShown: true,
-
- /**
- * Initializes the object and populates
- * the roots lists.
- *
- * @param document The document to be translated
- */
- _init: function(document) {
- let window = document.defaultView;
- let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
-
- // Get all the translation nodes in the document's body:
- // a translation node is a node from the document which
- // contains useful content for translation, and therefore
- // must be included in the translation process.
- let nodeList = winUtils.getTranslationNodes(document.body);
-
- let length = nodeList.length;
-
- for (let i = 0; i < length; i++) {
- let node = nodeList.item(i);
- let isRoot = nodeList.isTranslationRootAtIndex(i);
-
- // Create a TranslationItem object for this node.
- // This function will also add it to the this.roots array.
- this._createItemForNode(node, i, isRoot);
- }
-
- // At first all roots are stored in the roots list, and only after
- // the process has finished we're able to determine which roots are
- // simple, and which ones are not.
-
- // A simple root is defined by a root with no children items, which
- // basically represents an element from a page with only text content
- // inside.
-
- // This distinction is useful for optimization purposes: we treat a
- // simple root as plain-text in the translation process and with that
- // we are able to reduce their data payload sent to the translation service.
-
- for (let root of this.roots) {
- if (root.children.length == 0 &&
- root.nodeRef.childElementCount == 0) {
- root.isSimpleRoot = true;
- }
- }
- },
-
- /**
- * Creates a TranslationItem object, which should be called
- * for each node returned by getTranslationNodes.
- *
- * @param node The DOM node for this item.
- * @param id A unique, numeric id for this item.
- * @parem isRoot A boolean saying whether this item is a root.
- *
- * @returns A TranslationItem object.
- */
- _createItemForNode: function(node, id, isRoot) {
- if (this.itemsMap.has(node)) {
- return this.itemsMap.get(node);
- }
-
- let item = new TranslationItem(node, id, isRoot);
-
- if (isRoot) {
- // Root items do not have a parent item.
- this.roots.push(item);
- } else {
- let parentItem = this.itemsMap.get(node.parentNode);
- if (parentItem) {
- parentItem.children.push(item);
- }
- }
-
- this.itemsMap.set(node, item);
- return item;
- },
-
- /**
- * Generate the text string that represents a TranslationItem object.
- * Besides generating the string, it's also stored in the "original"
- * field of the TranslationItem object, which needs to be stored for
- * later to be used in the "Show Original" functionality.
- * If this function had already been called for the given item (determined
- * by the presence of the "original" array in the item), the text will
- * be regenerated from the "original" data instead of from the related
- * DOM nodes (because the nodes might contain translated data).
- *
- * @param item A TranslationItem object
- *
- * @returns A string representation of the TranslationItem.
- */
- generateTextForItem: function(item) {
- if (item.original) {
- return regenerateTextFromOriginalHelper(item);
- }
-
- if (item.isSimpleRoot) {
- let text = item.nodeRef.firstChild.nodeValue.trim();
- item.original = [text];
- return text;
- }
-
- let str = "";
- item.original = [];
- let wasLastItemPlaceholder = false;
-
- for (let child of item.nodeRef.childNodes) {
- if (child.nodeType == TEXT_NODE) {
- let x = child.nodeValue.trim();
- if (x != "") {
- item.original.push(x);
- str += x;
- wasLastItemPlaceholder = false;
- }
- continue;
- }
-
- let objInMap = this.itemsMap.get(child);
- if (objInMap && !objInMap.isRoot) {
- // If this childNode is present in the itemsMap, it means
- // it's a translation node: it has useful content for translation.
- // In this case, we need to stringify this node.
- // However, if this item is a root, we should skip it here in this
- // object's child list (and just add a placeholder for it), because
- // it will be stringfied separately for being a root.
- item.original.push(objInMap);
- str += this.generateTextForItem(objInMap);
- wasLastItemPlaceholder = false;
- } else if (!wasLastItemPlaceholder) {
- // Otherwise, if this node doesn't contain any useful content,
- // or if it is a root itself, we can replace it with a placeholder node.
- // We can't simply eliminate this node from our string representation
- // because that could change the HTML structure (e.g., it would
- // probably merge two separate text nodes).
- // It's not necessary to add more than one placeholder in sequence;
- // we can optimize them away.
- item.original.push(TranslationItem_NodePlaceholder);
- str += '<br>';
- wasLastItemPlaceholder = true;
- }
- }
-
- return generateTranslationHtmlForItem(item, str);
- },
-
- /**
- * Changes the document to display its translated
- * content.
- */
- showTranslation: function() {
- this.originalShown = false;
- this._swapDocumentContent("translation");
- },
-
- /**
- * Changes the document to display its original
- * content.
- */
- showOriginal: function() {
- this.originalShown = true;
- this._swapDocumentContent("original");
- },
-
- /**
- * Swap the document with the resulting translation,
- * or back with the original content.
- *
- * @param target A string that is either "translation"
- * or "original".
- */
- _swapDocumentContent: function(target) {
- Task.spawn(function *() {
- // Let the event loop breath on every 100 nodes
- // that are replaced.
- const YIELD_INTERVAL = 100;
- let count = YIELD_INTERVAL;
-
- for (let root of this.roots) {
- root.swapText(target);
- if (count-- == 0) {
- count = YIELD_INTERVAL;
- yield CommonUtils.laterTickResolvingPromise();
- }
- }
- }.bind(this));
- }
-};
-
-/**
- * This class represents an item for translation. It's basically our
- * wrapper class around a node returned by getTranslationNode, with
- * more data and structural information on it.
- *
- * At the end of the translation process, besides the properties below,
- * a TranslationItem will contain two other properties: one called "original"
- * and one called "translation". They are twin objects, one which reflect
- * the structure of that node in its original state, and the other in its
- * translated state.
- *
- * The "original" array is generated in the generateTextForItem function,
- * and the "translation" array is generated when the translation results
- * are parsed.
- *
- * They are both arrays, which contain a mix of strings and references to
- * child TranslationItems. The references in both arrays point to the * same *
- * TranslationItem object, but they might appear in different orders between the
- * "original" and "translation" arrays.
- *
- * An example:
- *
- * English: <div id="n1">Welcome to <b id="n2">Mozilla's</b> website</div>
- * Portuguese: <div id="n1">Bem vindo a pagina <b id="n2">da Mozilla</b></div>
- *
- * TranslationItem n1 = {
- * id: 1,
- * original: ["Welcome to", ptr to n2, "website"]
- * translation: ["Bem vindo a pagina", ptr to n2]
- * }
- *
- * TranslationItem n2 = {
- * id: 2,
- * original: ["Mozilla's"],
- * translation: ["da Mozilla"]
- * }
- */
-function TranslationItem(node, id, isRoot) {
- this.nodeRef = node;
- this.id = id;
- this.isRoot = isRoot;
- this.children = [];
-}
-
-TranslationItem.prototype = {
- isRoot: false,
- isSimpleRoot: false,
-
- toString: function() {
- let rootType = "";
- if (this.isRoot) {
- if (this.isSimpleRoot) {
- rootType = " (simple root)";
- }
- else {
- rootType = " (non simple root)";
- }
- }
- return "[object TranslationItem: <" + this.nodeRef.localName + ">"
- + rootType + "]";
- },
-
- /**
- * This function will parse the result of the translation of one translation
- * item. If this item was a simple root, all we sent was a plain-text version
- * of it, so the result is also straightforward text.
- *
- * For non-simple roots, we sent a simplified HTML representation of that
- * node, and we'll first parse that into an HTML doc and then call the
- * parseResultNode helper function to parse it.
- *
- * While parsing, the result is stored in the "translation" field of the
- * TranslationItem, which will be used to display the final translation when
- * all items are finished. It remains stored too to allow back-and-forth
- * switching between the "Show Original" and "Show Translation" functions.
- *
- * @param result A string with the textual result received from the server,
- * which can be plain-text or a serialized HTML doc.
- */
- parseResult: function(result) {
- if (this.isSimpleRoot) {
- this.translation = [result];
- return;
- }
-
- let domParser = Cc["@mozilla.org/xmlextras/domparser;1"]
- .createInstance(Ci.nsIDOMParser);
-
- let doc = domParser.parseFromString(result, "text/html");
- parseResultNode(this, doc.body.firstChild);
- },
-
- /**
- * This function finds a child TranslationItem
- * with the given id.
- * @param id The id to look for, in the format "n#"
- * @returns A TranslationItem with the given id, or null if
- * it was not found.
- */
- getChildById: function(id) {
- for (let child of this.children) {
- if (("n" + child.id) == id) {
- return child;
- }
- }
- return null;
- },
-
- /**
- * Swap the text of this TranslationItem between
- * its original and translated states.
- *
- * @param target A string that is either "translation"
- * or "original".
- */
- swapText: function(target) {
- swapTextForItem(this, target);
- }
-};
-
-/**
- * This object represents a placeholder item for translation. It's similar to
- * the TranslationItem class, but it represents nodes that have no meaningful
- * content for translation. These nodes will be replaced by "<br>" in a
- * translation request. It's necessary to keep them to use it as a mark
- * for correct positioning and spliting of text nodes.
- */
-const TranslationItem_NodePlaceholder = {
- toString: function() {
- return "[object TranslationItem_NodePlaceholder]";
- }
-};
-
-/**
- * Generate the outer HTML representation for a given item.
- *
- * @param item A TranslationItem object.
- * param content The inner content for this item.
- * @returns string The outer HTML needed for translation
- * of this item.
- */
-function generateTranslationHtmlForItem(item, content) {
- let localName = item.isRoot ? "div" : "b";
- return '<' + localName + ' id=n' + item.id + '>' +
- content +
- "</" + localName + ">";
-}
-
- /**
- * Regenerate the text string that represents a TranslationItem object,
- * with data from its "original" array. The array must have already
- * been created by TranslationDocument.generateTextForItem().
- *
- * @param item A TranslationItem object
- *
- * @returns A string representation of the TranslationItem.
- */
-function regenerateTextFromOriginalHelper(item) {
- if (item.isSimpleRoot) {
- return item.original[0];
- }
-
- let str = "";
- for (let child of item.original) {
- if (child instanceof TranslationItem) {
- str += regenerateTextFromOriginalHelper(child);
- } else if (child === TranslationItem_NodePlaceholder) {
- str += "<br>";
- } else {
- str += child;
- }
- }
-
- return generateTranslationHtmlForItem(item, str);
-}
-
-/**
- * Helper function to parse a HTML doc result.
- * How it works:
- *
- * An example result string is:
- *
- * <div id="n1">Hello <b id="n2">World</b> of Mozilla.</div>
- *
- * For an element node, we look at its id and find the corresponding
- * TranslationItem that was associated with this node, and then we
- * walk down it repeating the process.
- *
- * For text nodes we simply add it as a string.
- */
-function parseResultNode(item, node) {
- item.translation = [];
- for (let child of node.childNodes) {
- if (child.nodeType == TEXT_NODE) {
- item.translation.push(child.nodeValue);
- } else if (child.localName == "br") {
- item.translation.push(TranslationItem_NodePlaceholder);
- } else {
- let translationItemChild = item.getChildById(child.id);
-
- if (translationItemChild) {
- item.translation.push(translationItemChild);
- parseResultNode(translationItemChild, child);
- }
- }
- }
-}
-
-/**
- * Helper function to swap the text of a TranslationItem
- * between its original and translated states.
- * How it works:
- *
- * The function iterates through the target array (either the `original` or
- * `translation` array from the TranslationItem), while also keeping a pointer
- * to a current position in the child nodes from the actual DOM node that we
- * are modifying. This pointer is moved forward after each item of the array
- * is translated. If, at any given time, the pointer doesn't match the expected
- * node that was supposed to be seen, it means that the original and translated
- * contents have a different ordering, and thus we need to adjust that.
- *
- * A full example of the reordering process, swapping from Original to
- * Translation:
- *
- * Original (en): <div>I <em>miss</em> <b>you</b></div>
- *
- * Translation (fr): <div><b>Tu</b> me <em>manques</em></div>
- *
- * Step 1:
- * pointer points to firstChild of the DOM node, textnode "I "
- * first item in item.translation is [object TranslationItem <b>]
- *
- * pointer does not match the expected element, <b>. So let's move <b> to the
- * pointer position.
- *
- * Current state of the DOM:
- * <div><b>you</b>I <em>miss</em> </div>
- *
- * Step 2:
- * pointer moves forward to nextSibling, textnode "I " again.
- * second item in item.translation is the string " me "
- *
- * pointer points to a text node, and we were expecting a text node. Match!
- * just replace the text content.
- *
- * Current state of the DOM:
- * <div><b>you</b> me <em>miss</em> </div>
- *
- * Step 3:
- * pointer moves forward to nextSibling, <em>miss</em>
- * third item in item.translation is [object TranslationItem <em>]
- *
- * pointer points to the expected node. Match! Nothing to do.
- *
- * Step 4:
- * all items in this item.translation were transformed. The remaining
- * text nodes are cleared to "", and domNode.normalize() removes them.
- *
- * Current state of the DOM:
- * <div><b>you</b> me <em>miss</em></div>
- *
- * Further steps:
- * After that, the function will visit the child items (from the visitStack),
- * and the text inside the <b> and <em> nodes will be swapped as well,
- * yielding the final result:
- *
- * <div><b>Tu</b> me <em>manques</em></div>
- *
- *
- * @param item A TranslationItem object
- * @param target A string that is either "translation"
- * or "original".
- */
-function swapTextForItem(item, target) {
- // visitStack is the stack of items that we still need to visit.
- // Let's start the process by adding the root item.
- let visitStack = [ item ];
-
- while (visitStack.length > 0) {
- let curItem = visitStack.shift();
-
- let domNode = curItem.nodeRef;
- if (!domNode) {
- // Skipping this item due to a missing node.
- continue;
- }
-
- if (!curItem[target]) {
- // Translation not found for this item. This could be due to
- // an error in the server response. For example, if a translation
- // was broken in various chunks, and one of the chunks failed,
- // the items from that chunk will be missing its "translation"
- // field.
- continue;
- }
-
- domNode.normalize();
-
- // curNode points to the child nodes of the DOM node that we are
- // modifying. During most of the process, while the target array is
- // being iterated (in the for loop below), it should walk together with
- // the array and be pointing to the correct node that needs to modified.
- // If it's not pointing to it, that means some sort of node reordering
- // will be necessary to produce the correct translation.
- // Note that text nodes don't need to be reordered, as we can just replace
- // the content of one text node with another.
- //
- // curNode starts in the firstChild...
- let curNode = domNode.firstChild;
-
- // ... actually, let's make curNode start at the first useful node (either
- // a non-blank text node or something else). This is not strictly necessary,
- // as the reordering algorithm would correctly handle this case. However,
- // this better aligns the resulting translation with the DOM content of the
- // page, avoiding cases that would need to be unecessarily reordered.
- //
- // An example of how this helps:
- //
- // ---- Original: <div> <b>Hello </b> world.</div>
- // ^textnode 1 ^item 1 ^textnode 2
- //
- // - Translation: <div><b>Hallo </b> Welt.</div>
- //
- // Transformation process without this optimization:
- // 1 - start pointer at textnode 1
- // 2 - move item 1 to first position inside the <div>
- //
- // Node now looks like: <div><b>Hello </b>[ ][ world.]</div>
- // textnode 1^ ^textnode 2
- //
- // 3 - replace textnode 1 with " Welt."
- // 4 - clear remaining text nodes (in this case, textnode 2)
- //
- // Transformation process with this optimization:
- // 1 - start pointer at item 1
- // 2 - item 1 is already in position
- // 3 - replace textnode 2 with " Welt."
- //
- // which completely avoids any node reordering, and requires only one
- // text change instead of two (while also leaving the page closer to
- // its original state).
- while (curNode &&
- curNode.nodeType == TEXT_NODE &&
- curNode.nodeValue.trim() == "") {
- curNode = curNode.nextSibling;
- }
-
- // Now let's walk through all items in the `target` array of the
- // TranslationItem. This means either the TranslationItem.original or
- // TranslationItem.translation array.
- for (let targetItem of curItem[target]) {
-
- if (targetItem instanceof TranslationItem) {
- // If the array element is another TranslationItem object, let's
- // add it to the stack to be visited.
- visitStack.push(targetItem);
-
- let targetNode = targetItem.nodeRef;
-
- // If the node is not in the expected position, let's reorder
- // it into position...
- if (curNode != targetNode &&
- // ...unless the page has reparented this node under a totally
- // different node (or removed it). In this case, all bets are off
- // on being able to do anything correctly, so it's better not to
- // bring back the node to this parent.
- targetNode.parentNode == domNode) {
-
- // We don't need to null-check curNode because insertBefore(..., null)
- // does what we need in that case: reorder this node to the end
- // of child nodes.
- domNode.insertBefore(targetNode, curNode);
- curNode = targetNode;
- }
-
- // Move pointer forward. Since we do not add empty text nodes to the
- // list of translation items, we must skip them here too while
- // traversing the DOM in order to get better alignment between the
- // text nodes and the translation items.
- if (curNode) {
- curNode = getNextSiblingSkippingEmptyTextNodes(curNode);
- }
-
- } else if (targetItem === TranslationItem_NodePlaceholder) {
- // If the current item is a placeholder node, we need to move
- // our pointer "past" it, jumping from one side of a block of
- // elements + empty text nodes to the other side. Even if
- // non-placeholder elements exists inside the jumped block,
- // they will be pulled correctly later in the process when the
- // targetItem for those nodes are handled.
-
- while (curNode &&
- (curNode.nodeType != TEXT_NODE ||
- curNode.nodeValue.trim() == "")) {
- curNode = curNode.nextSibling;
- }
-
- } else {
- // Finally, if it's a text item, we just need to find the next
- // text node to use. Text nodes don't need to be reordered, so
- // the first one found can be used.
- while (curNode && curNode.nodeType != TEXT_NODE) {
- curNode = curNode.nextSibling;
- }
-
- // If none was found and we reached the end of the child nodes,
- // let's create a new one.
- if (!curNode) {
- // We don't know if the original content had a space or not,
- // so the best bet is to create the text node with " " which
- // will add one space at the beginning and one at the end.
- curNode = domNode.appendChild(domNode.ownerDocument.createTextNode(" "));
- }
-
- // A trailing and a leading space must be preserved because
- // they are meaningful in HTML.
- let preSpace = /^\s/.test(curNode.nodeValue) ? " " : "";
- let endSpace = /\s$/.test(curNode.nodeValue) ? " " : "";
-
- curNode.nodeValue = preSpace + targetItem + endSpace;
- curNode = getNextSiblingSkippingEmptyTextNodes(curNode);
- }
- }
-
- // The translated version of a node might have less text nodes than its
- // original version. If that's the case, let's clear the remaining nodes.
- if (curNode) {
- clearRemainingNonEmptyTextNodesFromElement(curNode);
- }
-
- // And remove any garbage "" nodes left after clearing.
- domNode.normalize();
- }
-}
-
-function getNextSiblingSkippingEmptyTextNodes(startSibling) {
- let item = startSibling.nextSibling;
- while (item &&
- item.nodeType == TEXT_NODE &&
- item.nodeValue.trim() == "") {
- item = item.nextSibling;
- }
- return item;
-}
-
-function clearRemainingNonEmptyTextNodesFromElement(startSibling) {
- let item = startSibling;
- while (item) {
- if (item.nodeType == TEXT_NODE &&
- item.nodeValue != "") {
- item.nodeValue = "";
- }
- item = item.nextSibling;
- }
-}
diff --git a/application/basilisk/components/translation/YandexTranslator.jsm b/application/basilisk/components/translation/YandexTranslator.jsm
deleted file mode 100644
index ab92e0962..000000000
--- a/application/basilisk/components/translation/YandexTranslator.jsm
+++ /dev/null
@@ -1,343 +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 = [ "YandexTranslator" ];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/Http.jsm");
-
-// The maximum amount of net data allowed per request on Bing's API.
-const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere
- // close to that is refused by the service.
-
-// The maximum number of chunks allowed to be translated in a single
-// request.
-const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000.
-
-// Self-imposed limit of 15 requests. This means that a page that would need
-// to be broken in more than 15 requests won't be fully translated.
-// The maximum amount of data that we will translate for a single page
-// is MAX_REQUESTS * MAX_REQUEST_DATA.
-const MAX_REQUESTS = 15;
-
-const YANDEX_RETURN_CODE_OK = 200;
-
-const YANDEX_ERR_KEY_INVALID = 401; // Invalid API key
-const YANDEX_ERR_KEY_BLOCKED = 402; // This API key has been blocked
-const YANDEX_ERR_DAILY_REQ_LIMIT_EXCEEDED = 403; // Daily limit for requests reached
-const YANDEX_ERR_DAILY_CHAR_LIMIT_EXCEEDED = 404; // Daily limit of chars reached
-const YANDEX_ERR_TEXT_TOO_LONG = 413; // The text size exceeds the maximum
-const YANDEX_ERR_UNPROCESSABLE_TEXT = 422; // The text could not be translated
-const YANDEX_ERR_LANG_NOT_SUPPORTED = 501; // The specified translation direction is not supported
-
-// Errors that should activate the service unavailable handling
-const YANDEX_PERMANENT_ERRORS = [
- YANDEX_ERR_KEY_INVALID,
- YANDEX_ERR_KEY_BLOCKED,
- YANDEX_ERR_DAILY_REQ_LIMIT_EXCEEDED,
- YANDEX_ERR_DAILY_CHAR_LIMIT_EXCEEDED,
-];
-
-/**
- * Translates a webpage using Yandex's Translation API.
- *
- * @param translationDocument The TranslationDocument object that represents
- * the webpage to be translated
- * @param sourceLanguage The source language of the document
- * @param targetLanguage The target language for the translation
- *
- * @returns {Promise} A promise that will resolve when the translation
- * task is finished.
- */
-this.YandexTranslator = function(translationDocument, sourceLanguage, targetLanguage) {
- this.translationDocument = translationDocument;
- this.sourceLanguage = sourceLanguage;
- this.targetLanguage = targetLanguage;
- this._pendingRequests = 0;
- this._partialSuccess = false;
- this._serviceUnavailable = false;
- this._translatedCharacterCount = 0;
-};
-
-this.YandexTranslator.prototype = {
- /**
- * Performs the translation, splitting the document into several chunks
- * respecting the data limits of the API.
- *
- * @returns {Promise} A promise that will resolve when the translation
- * task is finished.
- */
- translate: function() {
- return Task.spawn(function *() {
- let currentIndex = 0;
- this._onFinishedDeferred = Promise.defer();
-
- // Let's split the document into various requests to be sent to
- // Yandex's Translation API.
- for (let requestCount = 0; requestCount < MAX_REQUESTS; requestCount++) {
- // Generating the text for each request can be expensive, so
- // let's take the opportunity of the chunkification process to
- // allow for the event loop to attend other pending events
- // before we continue.
- yield CommonUtils.laterTickResolvingPromise();
-
- // Determine the data for the next request.
- let request = this._generateNextTranslationRequest(currentIndex);
-
- // Create a real request to the server, and put it on the
- // pending requests list.
- let yandexRequest = new YandexRequest(request.data,
- this.sourceLanguage,
- this.targetLanguage);
- this._pendingRequests++;
- yandexRequest.fireRequest().then(this._chunkCompleted.bind(this),
- this._chunkFailed.bind(this));
-
- currentIndex = request.lastIndex;
- if (request.finished) {
- break;
- }
- }
-
- return this._onFinishedDeferred.promise;
- }.bind(this));
- },
-
- /**
- * Function called when a request sent to the server completed successfully.
- * This function handles calling the function to parse the result and the
- * function to resolve the promise returned by the public `translate()`
- * method when there are no pending requests left.
- *
- * @param request The YandexRequest sent to the server
- */
- _chunkCompleted: function(yandexRequest) {
- if (this._parseChunkResult(yandexRequest)) {
- this._partialSuccess = true;
- // Count the number of characters successfully translated.
- this._translatedCharacterCount += yandexRequest.characterCount;
- }
-
- this._checkIfFinished();
- },
-
- /**
- * Function called when a request sent to the server has failed.
- * This function handles deciding if the error is transient or means the
- * service is unavailable (zero balance on the key or request credentials are
- * not in an active state) and calling the function to resolve the promise
- * returned by the public `translate()` method when there are no pending
- * requests left.
- *
- * @param aError [optional] The XHR object of the request that failed.
- */
- _chunkFailed: function(aError) {
- if (aError instanceof Ci.nsIXMLHttpRequest) {
- let body = aError.responseText;
- let json = { code: 0 };
- try {
- json = JSON.parse(body);
- } catch (e) {}
-
- if (json.code && YANDEX_PERMANENT_ERRORS.indexOf(json.code) != -1)
- this._serviceUnavailable = true;
- }
-
- this._checkIfFinished();
- },
-
- /**
- * Function called when a request sent to the server has completed.
- * This function handles resolving the promise
- * returned by the public `translate()` method when all chunks are completed.
- */
- _checkIfFinished: function() {
- // Check if all pending requests have been
- // completed and then resolves the promise.
- // If at least one chunk was successful, the
- // promise will be resolved positively which will
- // display the "Success" state for the infobar. Otherwise,
- // the "Error" state will appear.
- if (--this._pendingRequests == 0) {
- if (this._partialSuccess) {
- this._onFinishedDeferred.resolve({
- characterCount: this._translatedCharacterCount
- });
- } else {
- let error = this._serviceUnavailable ? "unavailable" : "failure";
- this._onFinishedDeferred.reject(error);
- }
- }
- },
-
- /**
- * This function parses the result returned by Yandex's Translation API,
- * which returns a JSON result that contains a number of elements. The
- * API is documented here:
- * http://api.yandex.com/translate/doc/dg/reference/translate.xml
- *
- * @param request The request sent to the server.
- * @returns boolean True if parsing of this chunk was successful.
- */
- _parseChunkResult: function(yandexRequest) {
- let results;
- try {
- let result = JSON.parse(yandexRequest.networkRequest.responseText);
- if (result.code != 200) {
- Services.console.logStringMessage("YandexTranslator: Result is " + result.code);
- return false;
- }
- results = result.text
- } catch (e) {
- return false;
- }
-
- let len = results.length;
- if (len != yandexRequest.translationData.length) {
- // This should never happen, but if the service returns a different number
- // of items (from the number of items submitted), we can't use this chunk
- // because all items would be paired incorrectly.
- return false;
- }
-
- let error = false;
- for (let i = 0; i < len; i++) {
- try {
- let result = results[i];
- let root = yandexRequest.translationData[i][0];
- root.parseResult(result);
- } catch (e) { error = true; }
- }
-
- return !error;
- },
-
- /**
- * This function will determine what is the data to be used for
- * the Nth request we are generating, based on the input params.
- *
- * @param startIndex What is the index, in the roots list, that the
- * chunk should start.
- */
- _generateNextTranslationRequest: function(startIndex) {
- let currentDataSize = 0;
- let currentChunks = 0;
- let output = [];
- let rootsList = this.translationDocument.roots;
-
- for (let i = startIndex; i < rootsList.length; i++) {
- let root = rootsList[i];
- let text = this.translationDocument.generateTextForItem(root);
- if (!text) {
- continue;
- }
-
- let newCurSize = currentDataSize + text.length;
- let newChunks = currentChunks + 1;
-
- if (newCurSize > MAX_REQUEST_DATA ||
- newChunks > MAX_REQUEST_CHUNKS) {
-
- // If we've reached the API limits, let's stop accumulating data
- // for this request and return. We return information useful for
- // the caller to pass back on the next call, so that the function
- // can keep working from where it stopped.
- return {
- data: output,
- finished: false,
- lastIndex: i
- };
- }
-
- currentDataSize = newCurSize;
- currentChunks = newChunks;
- output.push([root, text]);
- }
-
- return {
- data: output,
- finished: true,
- lastIndex: 0
- };
- }
-};
-
-/**
- * Represents a request (for 1 chunk) sent off to Yandex's service.
- *
- * @params translationData The data to be used for this translation,
- * generated by the generateNextTranslationRequest...
- * function.
- * @param sourceLanguage The source language of the document.
- * @param targetLanguage The target language for the translation.
- *
- */
-function YandexRequest(translationData, sourceLanguage, targetLanguage) {
- this.translationData = translationData;
- this.sourceLanguage = sourceLanguage;
- this.targetLanguage = targetLanguage;
- this.characterCount = 0;
-}
-
-YandexRequest.prototype = {
- /**
- * Initiates the request
- */
- fireRequest: function() {
- return Task.spawn(function *() {
- // Prepare URL.
- let url = getUrlParam("https://translate.yandex.net/api/v1.5/tr.json/translate",
- "browser.translation.yandex.translateURLOverride");
-
- // Prepare the request body.
- let apiKey = getUrlParam("%YANDEX_API_KEY%", "browser.translation.yandex.apiKeyOverride");
- let params = [
- ["key", apiKey],
- ["format", "html"],
- ["lang", this.sourceLanguage + "-" + this.targetLanguage],
- ];
-
- for (let [, text] of this.translationData) {
- params.push(["text", text]);
- this.characterCount += text.length;
- }
-
- // Set up request options.
- let deferred = Promise.defer();
- let options = {
- onLoad: (function(responseText, xhr) {
- deferred.resolve(this);
- }).bind(this),
- onError: function(e, responseText, xhr) {
- deferred.reject(xhr);
- },
- postData: params
- };
-
- // Fire the request.
- this.networkRequest = httpRequest(url, options);
-
- return deferred.promise;
- }.bind(this));
- }
-};
-
-/**
- * Fetch an auth token (clientID or client secret), which may be overridden by
- * a pref if it's set.
- */
-function getUrlParam(paramValue, prefName) {
- if (Services.prefs.getPrefType(prefName))
- paramValue = Services.prefs.getCharPref(prefName);
- paramValue = Services.urlFormatter.formatURL(paramValue);
- return paramValue;
-}
diff --git a/application/basilisk/components/translation/jar.mn b/application/basilisk/components/translation/jar.mn
deleted file mode 100644
index be744cb9e..000000000
--- a/application/basilisk/components/translation/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-browser.jar:
- content/browser/translation-infobar.xml
- content/browser/microsoft-translator-attribution.png
diff --git a/application/basilisk/components/translation/microsoft-translator-attribution.png b/application/basilisk/components/translation/microsoft-translator-attribution.png
deleted file mode 100644
index d9d277461..000000000
--- a/application/basilisk/components/translation/microsoft-translator-attribution.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/components/translation/moz.build b/application/basilisk/components/translation/moz.build
index ac0165230..32421e430 100644
--- a/application/basilisk/components/translation/moz.build
+++ b/application/basilisk/components/translation/moz.build
@@ -3,14 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_JS_MODULES.translation = [
- 'BingTranslator.jsm',
'cld2/cld-worker.js',
'cld2/cld-worker.js.mem',
'LanguageDetector.jsm',
- 'Translation.jsm',
- 'TranslationContentHandler.jsm',
- 'TranslationDocument.jsm',
- 'YandexTranslator.jsm'
]
-
-JAR_MANIFESTS += ['jar.mn']
diff --git a/application/basilisk/components/translation/translation-infobar.xml b/application/basilisk/components/translation/translation-infobar.xml
deleted file mode 100644
index db0695c03..000000000
--- a/application/basilisk/components/translation/translation-infobar.xml
+++ /dev/null
@@ -1,441 +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/. -->
-
-<!DOCTYPE bindings [
-<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd">
-%notificationDTD;
-<!ENTITY % translationDTD SYSTEM "chrome://browser/locale/translation.dtd" >
-%translationDTD;
-]>
-
-<bindings id="translationBindings"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl">
- <binding id="translationbar" extends="chrome://global/content/bindings/notification.xml#notification" role="xul:alert">
- <resources>
- <stylesheet src="chrome://global/skin/notification.css"/>
- </resources>
- <content>
- <xul:hbox class="notification-inner" flex="1" xbl:inherits="type">
- <xul:hbox anonid="details" align="center" flex="1">
- <xul:image class="translate-infobar-element messageImage"
- anonid="messageImage"/>
- <xul:panel anonid="welcomePanel" class="translation-welcome-panel"
- type="arrow" align="start">
- <xul:image class="translation-welcome-logo"/>
- <xul:vbox flex="1" class="translation-welcome-content">
- <xul:description class="translation-welcome-headline"
- anonid="welcomeHeadline"/>
- <xul:description class="translation-welcome-body" anonid="welcomeBody"/>
- <xul:hbox align="center">
- <xul:label anonid="learnMore" class="plain text-link"
- onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
- <xul:spacer flex="1"/>
- <xul:button class="translate-infobar-element" anonid="thanksButton"
- onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
- </xul:hbox>
- </xul:vbox>
- </xul:panel>
- <xul:deck anonid="translationStates" selectedIndex="0">
-
- <!-- offer to translate -->
- <xul:hbox class="translate-offer-box" align="center">
- <xul:label class="translate-infobar-element" value="&translation.thisPageIsIn.label;"/>
- <xul:menulist class="translate-infobar-element" anonid="detectedLanguage">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element" value="&translation.translateThisPage.label;"/>
- <xul:button class="translate-infobar-element"
- label="&translation.translate.button;"
- anonid="translate"
- oncommand="document.getBindingParent(this).translate();"/>
- <xul:button class="translate-infobar-element"
- label="&translation.notNow.button;" anonid="notNow"
- oncommand="document.getBindingParent(this).closeCommand();"/>
- </xul:hbox>
-
- <!-- translating -->
- <xul:vbox class="translating-box" pack="center">
- <xul:label class="translate-infobar-element"
- value="&translation.translatingContent.label;"/>
- </xul:vbox>
-
- <!-- translated -->
- <xul:hbox class="translated-box" align="center">
- <xul:label class="translate-infobar-element"
- value="&translation.translatedFrom.label;"/>
- <xul:menulist class="translate-infobar-element"
- anonid="fromLanguage"
- oncommand="document.getBindingParent(this).translate()">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element"
- value="&translation.translatedTo.label;"/>
- <xul:menulist class="translate-infobar-element"
- anonid="toLanguage"
- oncommand="document.getBindingParent(this).translate()">
- <xul:menupopup/>
- </xul:menulist>
- <xul:label class="translate-infobar-element"
- value="&translation.translatedToSuffix.label;"/>
- <xul:button anonid="showOriginal"
- class="translate-infobar-element"
- label="&translation.showOriginal.button;"
- oncommand="document.getBindingParent(this).showOriginal();"/>
- <xul:button anonid="showTranslation"
- class="translate-infobar-element"
- label="&translation.showTranslation.button;"
- oncommand="document.getBindingParent(this).showTranslation();"/>
- </xul:hbox>
-
- <!-- error -->
- <xul:hbox class="translation-error" align="center">
- <xul:label class="translate-infobar-element"
- value="&translation.errorTranslating.label;"/>
- <xul:button class="translate-infobar-element"
- label="&translation.tryAgain.button;"
- anonid="tryAgain"
- oncommand="document.getBindingParent(this).translate();"/>
- </xul:hbox>
-
- <!-- unavailable -->
- <xul:vbox class="translation-unavailable" pack="center">
- <xul:label class="translate-infobar-element"
- value="&translation.serviceUnavailable.label;"/>
- </xul:vbox>
-
- </xul:deck>
- <xul:spacer flex="1"/>
-
- <xul:button type="menu"
- class="translate-infobar-element options-menu-button"
- anonid="options"
- label="&translation.options.menu;">
- <xul:menupopup class="translation-menupopup cui-widget-panel cui-widget-panelview
- cui-widget-panelWithFooter PanelUI-subView"
- onpopupshowing="document.getBindingParent(this).optionsShowing();">
- <xul:menuitem anonid="neverForLanguage"
- oncommand="document.getBindingParent(this).neverForLanguage();"/>
- <xul:menuitem anonid="neverForSite"
- oncommand="document.getBindingParent(this).neverForSite();"
- label="&translation.options.neverForSite.label;"
- accesskey="&translation.options.neverForSite.accesskey;"/>
- <xul:menuseparator/>
- <xul:menuitem oncommand="openPreferences('paneContent');"
- label="&translation.options.preferences.label;"
- accesskey="&translation.options.preferences.accesskey;"/>
- <xul:menuitem class="subviewbutton panel-subview-footer"
- oncommand="document.getBindingParent(this).openProviderAttribution();">
- <xul:deck anonid="translationEngine" selectedIndex="0">
- <xul:hbox class="translation-attribution">
- <xul:label>&translation.options.attribution.beforeLogo;</xul:label>
- <xul:image src="chrome://browser/content/microsoft-translator-attribution.png"
- aria-label="Microsoft Translator"/>
- <xul:label>&translation.options.attribution.afterLogo;</xul:label>
- </xul:hbox>
- <xul:label class="translation-attribution">&translation.options.attribution.yandexTranslate;</xul:label>
- </xul:deck>
- </xul:menuitem>
- </xul:menupopup>
- </xul:button>
-
- </xul:hbox>
- <xul:toolbarbutton ondblclick="event.stopPropagation();"
- anonid="closeButton"
- class="messageCloseButton close-icon tabbable"
- xbl:inherits="hidden=hideclose"
- tooltiptext="&closeNotification.tooltip;"
- oncommand="document.getBindingParent(this).closeCommand();"/>
- </xul:hbox>
- </content>
- <implementation>
- <property name="state"
- onget="return this._getAnonElt('translationStates').selectedIndex;">
- <setter>
- <![CDATA[
- let deck = this._getAnonElt('translationStates');
-
- let activeElt = document.activeElement;
- if (activeElt && deck.contains(activeElt))
- activeElt.blur();
-
- let stateName;
- for (let name of ["OFFER", "TRANSLATING", "TRANSLATED", "ERROR"]) {
- if (Translation["STATE_" + name] == val) {
- stateName = name.toLowerCase();
- break;
- }
- }
- this.setAttribute("state", stateName);
-
- if (val == Translation.STATE_TRANSLATED)
- this._handleButtonHiding();
-
- deck.selectedIndex = val;
- ]]>
- </setter>
- </property>
-
- <method name="init">
- <parameter name="aTranslation"/>
- <body>
- <![CDATA[
- this.translation = aTranslation;
- let bundle = Cc["@mozilla.org/intl/stringbundle;1"]
- .getService(Ci.nsIStringBundleService)
- .createBundle("chrome://global/locale/languageNames.properties");
- let sortByLocalizedName = function(aList) {
- return aList.map(code => [code, bundle.GetStringFromName(code)])
- .sort((a, b) => a[1].localeCompare(b[1]));
- };
-
- // Fill the lists of supported source languages.
- let detectedLanguage = this._getAnonElt("detectedLanguage");
- let fromLanguage = this._getAnonElt("fromLanguage");
- let sourceLanguages =
- sortByLocalizedName(Translation.supportedSourceLanguages);
- for (let [code, name] of sourceLanguages) {
- detectedLanguage.appendItem(name, code);
- fromLanguage.appendItem(name, code);
- }
- detectedLanguage.value = this.translation.detectedLanguage;
-
- // translatedFrom is only set if we have already translated this page.
- if (aTranslation.translatedFrom)
- fromLanguage.value = aTranslation.translatedFrom;
-
- // Fill the list of supported target languages.
- let toLanguage = this._getAnonElt("toLanguage");
- let targetLanguages =
- sortByLocalizedName(Translation.supportedTargetLanguages);
- for (let [code, name] of targetLanguages)
- toLanguage.appendItem(name, code);
-
- if (aTranslation.translatedTo)
- toLanguage.value = aTranslation.translatedTo;
-
- if (aTranslation.state)
- this.state = aTranslation.state;
-
- // Show attribution for the preferred translator.
- let engineIndex = Object.keys(Translation.supportedEngines)
- .indexOf(Translation.translationEngine);
- if (engineIndex != -1) {
- this._getAnonElt('translationEngine').selectedIndex = engineIndex;
- }
-
- const kWelcomePref = "browser.translation.ui.welcomeMessageShown";
- if (Services.prefs.prefHasUserValue(kWelcomePref) ||
- this.translation.browser != gBrowser.selectedBrowser)
- return;
-
- this.addEventListener("transitionend", function onShown() {
- this.removeEventListener("transitionend", onShown);
-
- // These strings are hardcoded because they need to reach beta
- // without riding the trains.
- let localizedStrings = {
- en: ["Hey look! It's something new!",
- "Now the Web is even more accessible with our new in-page translation feature. Click the translate button to try it!",
- "Learn more.",
- "Thanks"],
- "es-AR": ["\xA1Mir\xE1! \xA1Hay algo nuevo!",
- "Ahora la web es a\xFAn m\xE1s accesible con nuestra nueva funcionalidad de traducci\xF3n integrada. \xA1Hac\xE9 clic en el bot\xF3n traducir para probarla!",
- "Conoc\xE9 m\xE1s.",
- "Gracias"],
- "es-ES": ["\xA1Mira! \xA1Hay algo nuevo!",
- "Con la nueva funcionalidad de traducci\xF3n integrada, ahora la Web es a\xFAn m\xE1s accesible. \xA1Pulsa el bot\xF3n Traducir y pru\xE9bala!",
- "M\xE1s informaci\xF3n.",
- "Gracias"],
- pl: ["Sp\xF3jrz tutaj! To co\u015B nowego!",
- "Sie\u0107 sta\u0142a si\u0119 w\u0142a\u015Bnie jeszcze bardziej dost\u0119pna dzi\u0119ki opcji bezpo\u015Bredniego t\u0142umaczenia stron. Kliknij przycisk t\u0142umaczenia, aby spr\xF3bowa\u0107!",
- "Dowiedz si\u0119 wi\u0119cej",
- "Dzi\u0119kuj\u0119"],
- tr: ["Bak\u0131n, burada yeni bir \u015Fey var!",
- "Yeni sayfa i\xE7i \xE7eviri \xF6zelli\u011Fimiz sayesinde Web art\u0131k \xE7ok daha anla\u015F\u0131l\u0131r olacak. Denemek i\xE7in \xC7evir d\xFC\u011Fmesine t\u0131klay\u0131n!",
- "Daha fazla bilgi al\u0131n.",
- "Te\u015Fekk\xFCrler"],
- vi: ["Nh\xECn n\xE0y! \u0110\u1ED3 m\u1EDBi!",
- "Gi\u1EDD \u0111\xE2y ch\xFAng ta c\xF3 th\u1EC3 ti\u1EBFp c\u1EADn web d\u1EC5 d\xE0ng h\u01A1n n\u1EEFa v\u1EDBi t\xEDnh n\u0103ng d\u1ECBch ngay trong trang. Hay nh\u1EA5n n\xFAt d\u1ECBch \u0111\u1EC3 th\u1EED!",
- "T\xECm hi\u1EC3u th\xEAm.",
- "C\u1EA3m \u01A1n"]
- };
-
- let locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry)
- .getSelectedLocale("browser");
- if (!(locale in localizedStrings))
- locale = "en";
- let strings = localizedStrings[locale];
-
- this._getAnonElt("welcomeHeadline").setAttribute("value", strings[0]);
- this._getAnonElt("welcomeBody").textContent = strings[1];
- this._getAnonElt("learnMore").setAttribute("value", strings[2]);
- this._getAnonElt("thanksButton").setAttribute("label", strings[3]);
-
- let panel = this._getAnonElt("welcomePanel");
- panel.openPopup(this._getAnonElt("messageImage"),
- "bottomcenter topleft");
-
- Services.prefs.setBoolPref(kWelcomePref, true);
- });
- ]]>
- </body>
- </method>
-
- <method name="_getAnonElt">
- <parameter name="aAnonId"/>
- <body>
- return document.getAnonymousElementByAttribute(this, "anonid", aAnonId);
- </body>
- </method>
-
- <method name="translate">
- <body>
- <![CDATA[
- if (this.state == Translation.STATE_OFFER) {
- this._getAnonElt("fromLanguage").value =
- this._getAnonElt("detectedLanguage").value;
- this._getAnonElt("toLanguage").value =
- Translation.defaultTargetLanguage;
- }
-
- this.translation.translate(this._getAnonElt("fromLanguage").value,
- this._getAnonElt("toLanguage").value);
- ]]>
- </body>
- </method>
-
- <!-- To be called when the infobar should be closed per user's wish (e.g.
- by clicking the notification's close button -->
- <method name="closeCommand">
- <body>
- <![CDATA[
- this.close();
- this.translation.infobarClosed();
- ]]>
- </body>
- </method>
- <method name="_handleButtonHiding">
- <body>
- <![CDATA[
- let originalShown = this.translation.originalShown;
- this._getAnonElt("showOriginal").hidden = originalShown;
- this._getAnonElt("showTranslation").hidden = !originalShown;
- ]]>
- </body>
- </method>
-
- <method name="showOriginal">
- <body>
- <![CDATA[
- this.translation.showOriginalContent();
- this._handleButtonHiding();
- ]]>
- </body>
- </method>
-
- <method name="showTranslation">
- <body>
- <![CDATA[
- this.translation.showTranslatedContent();
- this._handleButtonHiding();
- ]]>
- </body>
- </method>
-
- <method name="optionsShowing">
- <body>
- <![CDATA[
- // Get the source language name.
- let lang;
- if (this.state == Translation.STATE_OFFER)
- lang = this._getAnonElt("detectedLanguage").value;
- else {
- lang = this._getAnonElt("fromLanguage").value;
-
- // If we have never attempted to translate the page before the
- // service became unavailable, "fromLanguage" isn't set.
- if (!lang && this.state == Translation.STATE_UNAVAILABLE)
- lang = this.translation.detectedLanguage;
- }
-
- let langBundle =
- Cc["@mozilla.org/intl/stringbundle;1"]
- .getService(Ci.nsIStringBundleService)
- .createBundle("chrome://global/locale/languageNames.properties");
- let langName = langBundle.GetStringFromName(lang);
-
- // Set the label and accesskey on the menuitem.
- let bundle =
- Cc["@mozilla.org/intl/stringbundle;1"]
- .getService(Ci.nsIStringBundleService)
- .createBundle("chrome://browser/locale/translation.properties");
- let item = this._getAnonElt("neverForLanguage");
- const kStrId = "translation.options.neverForLanguage";
- item.setAttribute("label",
- bundle.formatStringFromName(kStrId + ".label",
- [langName], 1));
- item.setAttribute("accesskey",
- bundle.GetStringFromName(kStrId + ".accesskey"));
- item.langCode = lang;
-
- // We may need to disable the menuitems if they have already been used.
- // Check if translation is already disabled for this language:
- let neverForLangs =
- Services.prefs.getCharPref("browser.translation.neverForLanguages");
- item.disabled = neverForLangs.split(",").indexOf(lang) != -1;
-
- // Check if translation is disabled for the domain:
- let uri = this.translation.browser.currentURI;
- let perms = Services.perms;
- item = this._getAnonElt("neverForSite");
- item.disabled =
- perms.testExactPermission(uri, "translate") == perms.DENY_ACTION;
- ]]>
- </body>
- </method>
-
- <method name="neverForLanguage">
- <body>
- <![CDATA[
- const kPrefName = "browser.translation.neverForLanguages";
-
- let val = Services.prefs.getCharPref(kPrefName);
- if (val)
- val += ",";
- val += this._getAnonElt("neverForLanguage").langCode;
-
- Services.prefs.setCharPref(kPrefName, val);
-
- this.closeCommand();
- ]]>
- </body>
- </method>
-
- <method name="neverForSite">
- <body>
- <![CDATA[
- let uri = this.translation.browser.currentURI;
- let perms = Services.perms;
- perms.add(uri, "translate", perms.DENY_ACTION);
-
- this.closeCommand();
- ]]>
- </body>
- </method>
-
- <method name="openProviderAttribution">
- <body>
- <![CDATA[
- Translation.openProviderAttribution();
- ]]>
- </body>
- </method>
-
- </implementation>
- </binding>
-</bindings>
diff --git a/application/basilisk/confvars.sh b/application/basilisk/confvars.sh
index 48985f16a..62aa1a84f 100644
--- a/application/basilisk/confvars.sh
+++ b/application/basilisk/confvars.sh
@@ -8,7 +8,7 @@ MOZ_APP_VENDOR=Moonchild
MOZ_PHOENIX=1
MOZ_AUSTRALIS=1
MC_BASILISK=1
-MOZ_UPDATER=1
+MOZ_UPDATER=
if test "$OS_ARCH" = "WINNT" -o \
"$OS_ARCH" = "Linux"; then
@@ -45,9 +45,9 @@ MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
# This should usually be the same as the value MAR_CHANNEL_ID.
# If more than one ID is needed, then you should use a comma separated list
# of values.
-ACCEPTED_MAR_CHANNEL_IDS=basilisk-release
+ACCEPTED_MAR_CHANNEL_IDS=unofficial,unstable,release
# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
-MAR_CHANNEL_ID=basilisk-release
+MAR_CHANNEL_ID=unofficial
# Features
MOZ_PROFILE_MIGRATOR=1
@@ -61,7 +61,7 @@ MOZ_SERVICES_COMMON=1
MOZ_SERVICES_SYNC=1
MOZ_SERVICES_HEALTHREPORT=
MOZ_SAFE_BROWSING=
-
+MOZ_GAMEPAD=1
# Disable checking that add-ons are signed by the trusted root
MOZ_ADDON_SIGNING=0
MOZ_REQUIRE_SIGNING=0
diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in
index c446d3687..485bc4917 100644
--- a/application/basilisk/installer/package-manifest.in
+++ b/application/basilisk/installer/package-manifest.in
@@ -35,7 +35,9 @@
#ifdef XP_MACOSX
; Mac bundle stuff
@APPNAME@/Contents/Info.plist
+#ifdef MOZ_UPDATER
@APPNAME@/Contents/Library/LaunchServices
+#endif
@APPNAME@/Contents/PkgInfo
@RESPATH@/firefox.icns
@RESPATH@/document.icns
@@ -114,7 +116,7 @@
@BINPATH@/browser/VisualElements/VisualElements_150.png
@BINPATH@/browser/VisualElements/VisualElements_70.png
#else
-@BINPATH@/@MOZ_APP_NAME@-bin
+@RESPATH@/@MOZ_APP_NAME@-bin
@BINPATH@/@MOZ_APP_NAME@
#endif
@RESPATH@/application.ini
@@ -138,13 +140,6 @@
@RESPATH@/run-mozilla.sh
#endif
#endif
-#ifdef XP_WIN
-#ifdef _AMD64_
-@BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@
-#else
-@BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@
-#endif
-#endif
; [Components]
#ifdef MOZ_ARTIFACT_BUILDS
diff --git a/application/basilisk/installer/windows/Makefile.in b/application/basilisk/installer/windows/Makefile.in
index d5580b53d..bab6ded1a 100644
--- a/application/basilisk/installer/windows/Makefile.in
+++ b/application/basilisk/installer/windows/Makefile.in
@@ -79,10 +79,6 @@ $(CONFIG_DIR)/setup.exe::
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
- $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
- --preprocess-single-file $(topsrcdir) \
- $(PPL_LOCALE_ARGS) $(CONFIG_DIR) \
- nsisstrings.properties nsisstrings.nlf
GARBARGE_DIRS += instgen
diff --git a/application/basilisk/installer/windows/nsis/defines.nsi.in b/application/basilisk/installer/windows/nsis/defines.nsi.in
index 5ad9b7966..dbb58ca33 100644
--- a/application/basilisk/installer/windows/nsis/defines.nsi.in
+++ b/application/basilisk/installer/windows/nsis/defines.nsi.in
@@ -3,23 +3,6 @@
# 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/.
-# Defining FunnelcakeVersion will append the value of StubURLVersionAppend to
-# StubURLVersion, append the value of URLManualDownloadAppend to
-# URLManualDownload, and append the value of URLStubDownloadAppend to
-# URLStubDownload. The value of FunnelcakeVersion should not be defined when it
-# is not used and when it is defined its value should never be empty.
-# !define FunnelcakeVersion "999"
-
-!ifdef FunnelcakeVersion
-!define URLManualDownloadAppend "&f=${FunnelcakeVersion}"
-!define URLStubDownloadAppend "-f${FunnelcakeVersion}"
-!define StubURLVersionAppend "-${FunnelcakeVersion}"
-!else
-!define URLManualDownloadAppend ""
-!define URLStubDownloadAppend ""
-!define StubURLVersionAppend ""
-!endif
-
# These defines should match application.ini settings
!define AppName "Basilisk"
!define AppVersion "@APP_VERSION@"
@@ -84,13 +67,3 @@ VIAddVersionKey "FileVersion" "${AppVersion}"
VIAddVersionKey "ProductVersion" "${AppVersion}"
# Comments is not used but left below commented out for future reference
# VIAddVersionKey "Comments" "Comments"
-
-# Control positions in Dialog Units so they are placed correctly with
-# non-default DPI settings
-!define OPTIONS_ITEM_EDGE_DU 90u
-!define OPTIONS_ITEM_WIDTH_DU 356u
-!define OPTIONS_SUBITEM_EDGE_DU 119u
-!define OPTIONS_SUBITEM_WIDTH_DU 327u
-!define INSTALL_BLURB_TOP_DU 78u
-!define APPNAME_BMP_EDGE_DU 19u
-!define APPNAME_BMP_TOP_DU 12u
diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.dtd b/application/basilisk/locales/en-US/chrome/browser/browser.dtd
index f75aa46a7..d02a6eedb 100644
--- a/application/basilisk/locales/en-US/chrome/browser/browser.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/browser.dtd
@@ -116,10 +116,9 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY toggleReaderMode.key "R">
<!ENTITY fxaSignIn.label "Sign in to &syncBrand.shortName.label;">
-<!ENTITY fxaSignedIn.tooltip "Open &syncBrand.shortName.label; preferences">
<!ENTITY fxaSignInError.label "Reconnect to &syncBrand.shortName.label;">
<!ENTITY fxaUnverified.label "Verify Your Account">
-
+<!ENTITY syncSettings.label "Open &syncBrand.shortName.label; settings">
<!ENTITY fullScreenMinimize.tooltip "Minimize">
<!ENTITY fullScreenRestore.tooltip "Restore">
@@ -207,8 +206,6 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY urlbar.webRTCShareScreenNotificationAnchor.tooltip "Manage sharing your windows or screen with the site">
<!ENTITY urlbar.servicesNotificationAnchor.tooltip "Open install message panel">
-<!ENTITY urlbar.translateNotificationAnchor.tooltip "Translate this page">
-<!ENTITY urlbar.translatedNotificationAnchor.tooltip "Manage page translation">
<!ENTITY urlbar.emeNotificationAnchor.tooltip "Manage use of DRM software">
<!ENTITY urlbar.cameraBlocked.tooltip "You have blocked your camera for this website.">
@@ -351,7 +348,7 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY appMenuRemoteTabs.openprefs.label "Sync Preferences">
<!ENTITY appMenuRemoteTabs.notsignedin.label "Sign in to view a list of tabs from your other devices.">
<!ENTITY appMenuRemoteTabs.signin.label "Sign in to Sync">
-<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs Sidebar">
+<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs">
<!ENTITY customizeMenu.addToToolbar.label "Add to Toolbar">
<!ENTITY customizeMenu.addToToolbar.accesskey "A">
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
index 5d58ffa37..d1d83b3bc 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd
@@ -38,21 +38,6 @@
<!ENTITY chooseButton.label "Choose…">
<!ENTITY chooseButton.accesskey "o">
-<!ENTITY translateWebPages.label "Translate web content">
-<!ENTITY translateWebPages.accesskey "T">
-<!ENTITY translateExceptions.label "Exceptions…">
-<!ENTITY translateExceptions.accesskey "x">
-
-<!-- LOCALIZATION NOTE (translation.options.attribution.beforeLogo,
- - translation.options.attribution.afterLogo):
- - These 2 strings are displayed before and after a 'Microsoft Translator'
- - logo.
- - The translations for these strings should match the translations in
- - browser/translation.dtd
- -->
-<!ENTITY translation.options.attribution.beforeLogo "Translations by">
-<!ENTITY translation.options.attribution.afterLogo "">
-
<!ENTITY drmContent.label "DRM content">
<!ENTITY playDRMContent.label "Play DRM content">
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
index da40f40a9..84fac427d 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -21,8 +21,8 @@ acceptVeryLargeMinimumFont=Keep my changes anyway
trackingprotectionpermissionstext=You have disabled Tracking Protection on these sites.
trackingprotectionpermissionstitle=Exceptions - Tracking Protection
-cookiepermissionstext=You can specify which websites are always or never allowed to use cookies. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow.
-cookiepermissionstitle=Exceptions - Cookies
+cookiepermissionstext=You can specify which websites are always or never allowed to store cookies and site data. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow.
+cookiepermissionstitle=Exceptions - Cookies and Site Data
addonspermissionstext=You can specify which websites are allowed to install add-ons. Type the exact address of the site you want to allow and then click Allow.
addons_permissions_title=Allowed Sites - Add-ons Installation
popuppermissionstext=You can specify which websites are allowed to open pop-up windows. Type the exact address of the site you want to allow and then click Allow.
@@ -36,7 +36,7 @@ savedLoginsExceptions_desc=Logins for the following sites will not be saved:
#### Block List Manager
-blockliststext=You can choose which list Firefox will use to block Web elements that may track your browsing activity.
+blockliststext=You can choose which list the browser will use to block Web elements that may track your browsing activity.
blockliststitle=Block Lists
# LOCALIZATION NOTE (mozNameTemplate): This template constructs the name of the
# block list in the block lists dialog. It combines the list name and
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
index e6a7955fb..f743c4040 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -49,10 +49,10 @@
<!ENTITY suggestionSettings.label "Change preferences for search engine suggestions…">
<!ENTITY suggestionSettings.accesskey "g">
-<!ENTITY acceptCookies.label "Accept cookies from sites">
+<!ENTITY acceptCookies.label "Allow sites to store cookies and site data">
<!ENTITY acceptCookies.accesskey "A">
-<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies:">
+<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies and site data:">
<!ENTITY acceptThirdParty.pre.accesskey "y">
<!ENTITY acceptThirdParty.always.label "Always">
<!ENTITY acceptThirdParty.never.label "Never">
@@ -77,7 +77,7 @@
<!ENTITY historyHeader.custom.label "Use custom settings for history">
<!ENTITY historyHeader.post.label "">
-<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from websites you visit.">
+<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies and site data from websites you visit.">
<!-- LOCALIZATION NOTE (rememberActions.pre.label): include a trailing space as needed -->
<!-- LOCALIZATION NOTE (rememberActions.middle.label): include a starting and trailing space as needed -->
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd
index 78cadd74c..a5b290052 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd
@@ -16,6 +16,7 @@
<!-- Manage Account -->
<!ENTITY manageAccount.label "Manage Account">
<!ENTITY manageAccount.accesskey "n">
+<!ENTITY viewQuota.label "View Quota">
<!ENTITY changePassword2.label "Change Password…">
<!ENTITY myRecoveryKey.label "My Recovery Key">
<!ENTITY resetSync2.label "Reset Sync…">
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd
deleted file mode 100644
index fc5fb2b7b..000000000
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd
+++ /dev/null
@@ -1,24 +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/. -->
-
-<!ENTITY window.title "Exceptions - Translation">
-<!ENTITY window.width "36em">
-<!ENTITY windowClose.key "w">
-
-<!ENTITY noTranslationForLanguages.label "Translation will not be offered for the following languages:">
-<!ENTITY treehead.languageName.label "Languages">
-<!ENTITY removeLanguage.label "Remove Language">
-<!ENTITY removeLanguage.accesskey "R">
-<!ENTITY removeAllLanguages.label "Remove All Languages">
-<!ENTITY removeAllLanguages.accesskey "e">
-
-<!ENTITY noTranslationForSites.label "Translation will not be offered for the following sites:">
-<!ENTITY treehead.siteName.label "Sites">
-<!ENTITY removeSite.label "Remove Site">
-<!ENTITY removeSite.accesskey "S">
-<!ENTITY removeAllSites.label "Remove All Sites">
-<!ENTITY removeAllSites.accesskey "i">
-
-<!ENTITY button.close.label "Close">
-<!ENTITY button.close.accesskey "C">
diff --git a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd
index 0c9e9201a..71a9f68af 100644
--- a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd
@@ -3,5 +3,5 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY syncBrand.shortName.label "Sync">
-<!ENTITY syncBrand.fullName.label "Firefox Sync">
+<!ENTITY syncBrand.fullName.label "Pale Moon Sync">
<!ENTITY syncBrand.fxAccount.label "Firefox Account">
diff --git a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd
index 950a83553..2657156b7 100644
--- a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd
@@ -16,7 +16,7 @@
<!-- New Account AND Existing Account -->
<!ENTITY server.label "Server">
-<!ENTITY serverType.default.label "Default: Mozilla &syncBrand.fullName.label; server">
+<!ENTITY serverType.default.label "Default: &syncBrand.fullName.label; server">
<!ENTITY serverType.custom2.label "Use a custom server…">
<!ENTITY signIn.account2.label "Account">
<!ENTITY signIn.account2.accesskey "A">
diff --git a/application/basilisk/locales/en-US/chrome/browser/translation.dtd b/application/basilisk/locales/en-US/chrome/browser/translation.dtd
deleted file mode 100644
index ca8bb9d51..000000000
--- a/application/basilisk/locales/en-US/chrome/browser/translation.dtd
+++ /dev/null
@@ -1,75 +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/. -->
-
-<!-- LOCALIZATION NOTE (translation.thisPageIsIn.label,
- - translation.translateThisPage.label):
- - These 2 strings are used to construct a sentence that contains a dropdown
- - showing the detected language of the current web page.
- - In en-US it looks like this:
- - This page is in [detected language] Translate this page?
- - "detected language" here is a language name coming from the
- - global/languageNames.properties file; for some locales it may not be in
- - the correct grammar case to keep the same structure of the original
- - sentence. -->
-<!ENTITY translation.thisPageIsIn.label "This page is in">
-<!ENTITY translation.translateThisPage.label "Translate this page?">
-<!ENTITY translation.translate.button "Translate">
-<!ENTITY translation.notNow.button "Not Now">
-
-<!ENTITY translation.translatingContent.label "Translating page content…">
-
-<!-- LOCALIZATION NOTE (translation.translatedFrom.label,
- - translation.translatedTo.label,
- - translation.translatedToSuffix.label):
- - These 3 strings are used to construct a sentence that contains 2 dropdowns
- - showing the source and target language of a translated web page.
- - In en-US it looks like this:
- - This page has been translated from [from language] to [to language]
- - "from language" and "to language" here are language names coming from the
- - global/languageNames.properties file; for some locales they may not be in
- - the correct grammar case to keep the same structure of the original
- - sentence.
- -
- - translation.translatedToSuffix.label (empty in en-US) is for locales that
- - need to display some text after the second drop down for the sentence to
- - be grammatically correct. -->
-<!ENTITY translation.translatedFrom.label "This page has been translated from">
-<!ENTITY translation.translatedTo.label "to">
-<!ENTITY translation.translatedToSuffix.label "">
-
-<!ENTITY translation.showOriginal.button "Show Original">
-<!ENTITY translation.showTranslation.button "Show Translation">
-
-<!ENTITY translation.errorTranslating.label "There has been an error translating this page.">
-<!ENTITY translation.tryAgain.button "Try Again">
-
-<!ENTITY translation.serviceUnavailable.label "Translation is not available at the moment. Please try again later.">
-
-<!ENTITY translation.options.menu "Options">
-<!-- LOCALIZATION NOTE (translation.options.neverForSite.accesskey,
- - translation.options.preferences.accesskey):
- - The accesskey values used here should not clash with the value used for
- - translation.options.neverForLanguage.accesskey in translation.properties
- -->
-<!ENTITY translation.options.neverForSite.label "Never translate this site">
-<!ENTITY translation.options.neverForSite.accesskey "e">
-<!ENTITY translation.options.preferences.label "Translation preferences">
-<!ENTITY translation.options.preferences.accesskey "T">
-
-<!-- LOCALIZATION NOTE (translation.options.attribution.beforeLogo,
- - translation.options.attribution.afterLogo):
- - These 2 strings are displayed before and after a 'Microsoft Translator'
- - logo.
- -->
-<!ENTITY translation.options.attribution.beforeLogo "Translations by">
-<!ENTITY translation.options.attribution.afterLogo "">
-
-<!-- LOCALIZATION NOTE (translation.options.attribution.poweredByYandex,
- translation.options.attribution.beforeLogo,
- - translation.options.attribution.afterLogo):
- - translation.options.attribution.poweredByYandex is displayed instead of
- - the other two strings when yandex translation engine is preferred by the
- - user.
- -->
-<!ENTITY translation.options.attribution.yandexTranslate "Powered by Yandex.Translate">
diff --git a/application/basilisk/locales/en-US/chrome/browser/translation.properties b/application/basilisk/locales/en-US/chrome/browser/translation.properties
deleted file mode 100644
index e62edbd0a..000000000
--- a/application/basilisk/locales/en-US/chrome/browser/translation.properties
+++ /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/.
-
-# LOCALIZATION NOTE (translation.options.neverForLanguage.label):
-# %S is a language name coming from the global/languageNames.properties file.
-translation.options.neverForLanguage.label=Never translate %S
-
-# LOCALIZATION NOTE (translation.options.neverForLanguage.accesskey):
-# The accesskey value used here should not clash with the values used for
-# translation.options.*.accesskey in translation.dtd
-translation.options.neverForLanguage.accesskey=N
diff --git a/application/basilisk/locales/en-US/installer/nsisstrings.properties b/application/basilisk/locales/en-US/installer/nsisstrings.properties
deleted file mode 100644
index 389405696..000000000
--- a/application/basilisk/locales/en-US/installer/nsisstrings.properties
+++ /dev/null
@@ -1,67 +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/.
-
-# LOCALIZATION NOTE:
-
-# This file must be saved as UTF8
-
-# Accesskeys are defined by prefixing the letter that is to be used for the
-# accesskey with an ampersand (e.g. &).
-
-# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a
-# custom string and always use the same one as used by the en-US files.
-# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands
-# for double ampersand) and prevents the letter following the ampersand from
-# being used as an accesskey.
-
-# You can use \n to create a newline in the string but only when the string
-# from en-US contains a \n.
-
-WIN_CAPTION=$BrandShortName Setup
-
-INTRO_BLURB1=Thanks for choosing $BrandFullName, the browser that chooses you above everything else.
-INSTALL_BLURB1=You're about to enjoy the very latest in speed, flexibility and security so you're always in control.
-INSTALL_BLURB2=That's because $BrandShortName is made by a non-profit to make browsing and the Web better for you.
-INSTALL_BLURB3=You're also joining a global community of users, contributors and developers working to make the best browser in the world.
-
-WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. Please click the OK button for additional information.
-WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
-WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support. Please click the OK button for additional information.
-WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory.
-WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location.
-WARN_ROOT_INSTALL=Unable to install to the root of your disk.\n\nClick OK to select a different location.
-WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed.
-
-ERROR_DOWNLOAD=Your download was interrupted.\n\nPlease click the OK button to continue.
-
-INSTALL_BUTTON=&Install
-UPGRADE_BUTTON=&Upgrade
-CANCEL_BUTTON=Cancel
-OPTIONS_BUTTON=&Options
-
-MAKE_DEFAULT=&Make $BrandShortName my default browser
-CREATE_SHORTCUTS=Create Shortcuts for $BrandShortName:
-ADD_SC_TASKBAR=On my &Task bar
-ADD_SC_QUICKLAUNCHBAR=On my &Quick Launch bar
-ADD_CheckboxShortcutInStartMenu=In my &Start Menu Programs Folder
-ADD_CheckboxShortcutOnDesktop=On my &Desktop
-SPACE_REQUIRED=Space Required:
-SPACE_AVAILABLE=Space Available:
-ONE_MOMENT_INSTALL=One moment, $BrandShortName will launch as soon as the install is complete…
-ONE_MOMENT_UPGRADE=One moment, $BrandShortName will launch as soon as the upgrade is complete…
-INSTALL_MAINT_SERVICE=&Install the $BrandShortName background update service
-SEND_PING=S&end information about this installation to Mozilla
-BROWSE_BUTTON=B&rowse…
-DEST_FOLDER=Destination Folder
-
-DOWNLOADING_LABEL=Downloading $BrandShortName…
-INSTALLING_LABEL=Installing $BrandShortName…
-UPGRADING_LABEL=Upgrading $BrandShortName…
-
-SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in.
-
-BYTE=B
-KILO=K
-MEGA=M
-GIGA=G
diff --git a/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn
index 9a847c7ed..5c5a72a1f 100644
--- a/application/basilisk/locales/jar.mn
+++ b/application/basilisk/locales/jar.mn
@@ -42,8 +42,6 @@
locale/browser/shellservice.properties (%chrome/browser/shellservice.properties)
locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties)
locale/browser/taskbar.properties (%chrome/browser/taskbar.properties)
- locale/browser/translation.dtd (%chrome/browser/translation.dtd)
- locale/browser/translation.properties (%chrome/browser/translation.properties)
locale/browser/webrtcIndicator.properties (%chrome/browser/webrtcIndicator.properties)
locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd)
locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties)
@@ -88,7 +86,6 @@
locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd)
locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd)
locale/browser/preferences/search.dtd (%chrome/browser/preferences/search.dtd)
- locale/browser/preferences/translation.dtd (%chrome/browser/preferences/translation.dtd)
locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd)
locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd)
locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties)
diff --git a/application/basilisk/themes/linux/browser.css b/application/basilisk/themes/linux/browser.css
index f9bd0bbd0..fbc5b651b 100644
--- a/application/basilisk/themes/linux/browser.css
+++ b/application/basilisk/themes/linux/browser.css
@@ -840,80 +840,6 @@ menuitem.bookmark-item {
outline: 1px dotted -moz-DialogText;
}
-/* Translation infobar */
-
-%include ../shared/translation/infobar.inc.css
-
-notification[value="translation"] {
- min-height: 40px;
-}
-
-notification[value="translation"],
-notification[value="translation"] button,
-notification[value="translation"] menulist {
- min-height: 30px;
- color: #5A5959;
-}
-
-notification[value="translation"] {
- background-color: #F2F1F0;
-}
-
-notification[value="translation"] button,
-notification[value="translation"] menulist {
- padding-inline-end: 1ch;
-}
-
-notification[value="translation"] menulist {
- border: 1px solid #C1C1C1;
- background-color: #FFF;
-}
-
-notification[value="translation"] button {
- border: 1px solid #C1C1C1;
- background-color: #F2F1F0;
-}
-
-notification[value="translation"] button,
-notification[value="translation"] menulist,
-notification[value="translation"] menulist > .menulist-label-box {
- margin-inline-start: 1ch;
- margin-inline-end: 1ch;
-}
-
-notification[value="translation"] button:hover,
-notification[value="translation"] button:active,
-notification[value="translation"] menulist:hover,
-notification[value="translation"] menulist:active {
- background-color: #E2E1E0;
-}
-
-notification[value="translation"] button[anonid="translate"] {
- color: #FFF;
- background-image: linear-gradient(#9FB938, #8DA726);
- box-shadow: none;
- border: 1px solid #829C1C;
-}
-
-notification[value="translation"] button[anonid="translate"]:hover,
-notification[value="translation"] button[anonid="translate"]:active {
- background-image: linear-gradient(#8DA726, #8DA726);
-}
-
-notification[value="translation"] button > .button-box,
-notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker {
- padding: 0;
- margin-inline-start: 3ch;
-}
-
-notification[value="translation"] button:not([type="menu"]) > .button-box {
- margin-inline-end: 3ch;
-}
-
-notification[value="translation"] menulist > .menulist-dropmarker {
- display: block;
-}
-
/* AutoComplete */
%include ../shared/autocomplete.inc.css
diff --git a/application/basilisk/themes/linux/preferences/preferences.css b/application/basilisk/themes/linux/preferences/preferences.css
index 45e2dc23d..5c1b102fa 100644
--- a/application/basilisk/themes/linux/preferences/preferences.css
+++ b/application/basilisk/themes/linux/preferences/preferences.css
@@ -20,12 +20,6 @@
font-weight: bold;
}
-/* Content Pane */
-#translationAttributionImage {
- width: 70px;
- cursor: pointer;
-}
-
/* Modeless Window Dialogs */
.windowDialog,
.windowDialog prefpane {
diff --git a/application/basilisk/themes/osx/browser.css b/application/basilisk/themes/osx/browser.css
index 808bb20b1..70f1f6162 100644
--- a/application/basilisk/themes/osx/browser.css
+++ b/application/basilisk/themes/osx/browser.css
@@ -2920,139 +2920,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
0 0 3px 2px -moz-mac-focusring;
}
-/* Translation */
-
-%include ../shared/translation/infobar.inc.css
-
-notification[value="translation"] {
- color: #484848;
- background-color: #EFEFEF;
- background-image: none;
- border-top: none;
- border-bottom: 1px solid #c4c4c4;
- padding-top: 1px;
- padding-bottom: 1px;
- min-height: 35px;
-}
-
-.translate-infobar-element {
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-button.translate-infobar-element {
- background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1)) repeat scroll 0% 0% padding-box transparent;
- color: #333333;
- border: 1px solid;
- border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2);
- box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.5) inset, 0px 1px 0px rgba(255, 255, 255, 0.2);
- transition-property: background-color, border-color, box-shadow;
- transition-duration: 150ms;
- min-height: 22px;
- min-width: 0;
- padding: 0 0.8em !important;
- margin-left: 0.25em;
- margin-right: 0.25em;
-}
-
-button.translate-infobar-element .button-text {
- margin-left: 0 !important;
- margin-right: 0 !important;
-}
-
-label.translate-infobar-element {
- padding-top: 2px;
-}
-
-button.translate-infobar-element:hover {
- background: #f0f0f0;
- box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset, 0 0 0 1px hsla(0,0%,100%,.05) inset, 0 1px 0 hsla(210,54%,20%,.01), 0 0 4px hsla(206,100%,20%,.1);
-}
-
-button.translate-infobar-element:active {
- box-shadow: 0 1px 1px hsla(211,79%,6%,.1) inset, 0 0 1px hsla(211,79%,6%,.2) inset;
- transition-duration: 0ms;
-}
-
-button.translate-infobar-element[anonid="translate"] {
- color: #ffffff;
- background: linear-gradient(#4cb1ff, #1793e5);
- box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, 0 0 0 1px hsla(0,0%,100%,.1) inset, 0 1px 0 hsla(210,54%,20%,.03);
- border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
- padding: 0 1.1em !important;;
-}
-
-button.translate-infobar-element[anonid="translate"]:hover {
- background-image: linear-gradient(#66bdff, #0d9eff);
- box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, 0 0 0 1px hsla(0,0%,100%,.1) inset, 0 1px 0 hsla(210,54%,20%,.03), 0 0 4px hsla(206,100%,20%,.2);
-}
-
-button.translate-infobar-element.options-menu-button {
- padding-inline-start: 0.5em !important;
- padding-inline-end: 0em !important;
-}
-
-button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker {
- display: -moz-box;
- list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png");
- padding: 0 !important;
- margin: 0 !important;
-}
-
-@media (min-resolution: 2dppx) {
- button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker {
- list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png");
- }
-
- button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker > .dropmarker-icon {
- width: 8px;
- }
-}
-
-menulist.translate-infobar-element {
- text-shadow: 0 1px 1px #FEFFFE;
- border: 1px solid;
- border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2);
- box-shadow: 0 1px 1px 0 #FFFFFF, inset 0 2px 2px 0 #FFFFFF;
- background-color: #F1F1F1;
- background-image: linear-gradient(#FFFFFF, rgba(255,255,255,0.1));
- color: #333333;
- padding: 0;
- min-height: 22px !important;
-}
-
-menulist.translate-infobar-element > .menulist-label-box {
- padding-top: 1px;
- padding-inline-start: 0.3em;
- margin-top: 0;
- margin-bottom: 0;
-}
-
-menulist.translate-infobar-element:hover {
- background: #f0f0f0;
- box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset, 0 0 0 1px hsla(0,0%,100%,.05) inset, 0 1px 0 hsla(210,54%,20%,.01), 0 0 4px hsla(206,100%,20%,.1);
-}
-
-menulist.translate-infobar-element[open="true"] {
- background-image: linear-gradient(rgba(255,255,255,0.1),
- rgba(255,255,255,0.6));
-}
-
-menulist.translate-infobar-element > .menulist-dropmarker {
- display: -moz-box;
- list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png");
-}
-
-@media (min-resolution: 2dppx) {
- menulist.translate-infobar-element > .menulist-dropmarker {
- list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png");
- }
-
- menulist.translate-infobar-element > .menulist-dropmarker > .dropmarker-icon {
- width: 8px;
- }
-}
-
.popup-notification-body[popupid="addon-progress"],
.popup-notification-body[popupid="addon-install-confirmation"] {
width: 28em;
diff --git a/application/basilisk/themes/osx/preferences/preferences.css b/application/basilisk/themes/osx/preferences/preferences.css
index 4f17ec58d..a8dcadc55 100644
--- a/application/basilisk/themes/osx/preferences/preferences.css
+++ b/application/basilisk/themes/osx/preferences/preferences.css
@@ -49,11 +49,6 @@ caption {
border-bottom: 1px solid #ccc;
}
-#translationAttributionImage {
- width: 70px;
- cursor: pointer;
-}
-
#browserUseCurrent,
#browserUseBookmark,
#browserUseBlank {
diff --git a/application/basilisk/themes/shared/jar.inc.mn b/application/basilisk/themes/shared/jar.inc.mn
index 588cf5364..361edd311 100644
--- a/application/basilisk/themes/shared/jar.inc.mn
+++ b/application/basilisk/themes/shared/jar.inc.mn
@@ -108,10 +108,6 @@
skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png)
skin/classic/browser/theme-switcher-icon@2x.png (../shared/theme-switcher-icon@2x.png)
skin/classic/browser/toolbarbutton-dropdown-arrow.png (../shared/toolbarbutton-dropdown-arrow.png)
- skin/classic/browser/translating-16.png (../shared/translation/translating-16.png)
- skin/classic/browser/translating-16@2x.png (../shared/translation/translating-16@2x.png)
- skin/classic/browser/translation-16.png (../shared/translation/translation-16.png)
- skin/classic/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png)
skin/classic/browser/undoCloseTab.png (../shared/undoCloseTab.png)
skin/classic/browser/undoCloseTab@2x.png (../shared/undoCloseTab@2x.png)
skin/classic/browser/update-badge.svg (../shared/update-badge.svg)
diff --git a/application/basilisk/themes/shared/notification-icons.inc.css b/application/basilisk/themes/shared/notification-icons.inc.css
index f641e72c1..99451ba98 100644
--- a/application/basilisk/themes/shared/notification-icons.inc.css
+++ b/application/basilisk/themes/shared/notification-icons.inc.css
@@ -266,27 +266,3 @@ html|*#webRTC-previewVideo {
opacity: 1;
}
}
-
-/* TRANSLATION */
-
-.translation-icon {
- list-style-image: url(chrome://browser/skin/translation-16.png);
- -moz-image-region: rect(0px, 16px, 16px, 0px);
-}
-
-.translation-icon.in-use {
- -moz-image-region: rect(0px, 32px, 16px, 16px);
-}
-
-%ifdef XP_MACOSX
-@media (min-resolution: 1.1dppx) {
- .translation-icon {
- list-style-image: url(chrome://browser/skin/translation-16@2x.png);
- -moz-image-region: rect(0px, 32px, 32px, 0px);
- }
-
- .translation-icon.in-use {
- -moz-image-region: rect(0px, 64px, 32px, 32px);
- }
-}
-%endif
diff --git a/application/basilisk/themes/shared/translation/infobar.inc.css b/application/basilisk/themes/shared/translation/infobar.inc.css
deleted file mode 100644
index 50d1acc01..000000000
--- a/application/basilisk/themes/shared/translation/infobar.inc.css
+++ /dev/null
@@ -1,95 +0,0 @@
-%if 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/. */
-%endif
-notification[value="translation"] .messageImage {
- list-style-image: url(chrome://browser/skin/translation-16.png);
- -moz-image-region: rect(0, 32px, 16px, 16px);
-}
-
-@media (min-resolution: 1.25dppx) {
- notification[value="translation"] .messageImage {
- list-style-image: url(chrome://browser/skin/translation-16@2x.png);
- -moz-image-region: rect(0, 64px, 32px, 32px);
- }
-}
-
-notification[value="translation"][state="translating"] .messageImage {
- list-style-image: url(chrome://browser/skin/translating-16.png);
- -moz-image-region: auto;
-}
-
-@media (min-resolution: 1.25dppx) {
- notification[value="translation"][state="translating"] .messageImage {
- list-style-image: url(chrome://browser/skin/translating-16@2x.png);
- }
-}
-
-notification[value="translation"] hbox[anonid="details"] {
- overflow: hidden;
-}
-
-notification[value="translation"] button,
-notification[value="translation"] menulist {
- -moz-appearance: none;
- border-width: 1px;
- -moz-border-top-colors: none;
- -moz-border-right-colors: none;
- -moz-border-bottom-colors: none;
- -moz-border-left-colors: none;
- border-radius: 2px;
- min-width: 0;
- box-shadow: 0 1px rgba(255, 255, 255, 0.5), 0 1px rgba(255, 255, 255, 0.5) inset;
-}
-
-notification[value="translation"] menulist > .menulist-dropmarker {
- -moz-appearance: toolbarbutton-dropdown;
- border: none;
- background-color: transparent;
- margin: auto;
- padding: 5px 0;
-}
-
-.translation-menupopup arrowscrollbox {
- padding-bottom: 0;
-}
-
-.translation-attribution {
- cursor: pointer;
- -moz-box-align: end;
- font-size: small;
-}
-
-.translation-attribution > label {
- margin-bottom: 0;
-}
-
-.translation-attribution > image {
- width: 70px;
-}
-
-.translation-welcome-panel {
- width: 305px;
-}
-
-.translation-welcome-logo {
- height: 32px;
- width: 32px;
- list-style-image: url(chrome://browser/skin/translation-16@2x.png);
- -moz-image-region: rect(0, 64px, 32px, 32px);
-}
-
-.translation-welcome-content {
- margin-inline-start: 16px;
-}
-
-.translation-welcome-headline {
- font-size: larger;
- font-weight: bold;
-}
-
-.translation-welcome-body {
- padding: 1em 0;
- margin: 0 0;
-}
diff --git a/application/basilisk/themes/shared/translation/translating-16.png b/application/basilisk/themes/shared/translation/translating-16.png
deleted file mode 100644
index 71ca37c22..000000000
--- a/application/basilisk/themes/shared/translation/translating-16.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/themes/shared/translation/translating-16@2x.png b/application/basilisk/themes/shared/translation/translating-16@2x.png
deleted file mode 100644
index ab6184047..000000000
--- a/application/basilisk/themes/shared/translation/translating-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/themes/shared/translation/translation-16.png b/application/basilisk/themes/shared/translation/translation-16.png
deleted file mode 100644
index 4b42dedcf..000000000
--- a/application/basilisk/themes/shared/translation/translation-16.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/themes/shared/translation/translation-16@2x.png b/application/basilisk/themes/shared/translation/translation-16@2x.png
deleted file mode 100644
index 2105a3e4a..000000000
--- a/application/basilisk/themes/shared/translation/translation-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/themes/windows/browser.css b/application/basilisk/themes/windows/browser.css
index 2ed3e7e6a..334265e60 100644
--- a/application/basilisk/themes/windows/browser.css
+++ b/application/basilisk/themes/windows/browser.css
@@ -2113,87 +2113,6 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
outline: 1px dotted -moz-DialogText;
}
-/* Translation infobar */
-
-%include ../shared/translation/infobar.inc.css
-
-notification[value="translation"] {
- min-height: 40px;
-}
-
-@media (-moz-windows-default-theme) {
- notification[value="translation"],
- notification[value="translation"] button,
- notification[value="translation"] menulist {
- min-height: 30px;
- color: #545454;
- }
-
- notification[value="translation"] {
- background-color: #EEE;
- }
-
- notification[value="translation"] button,
- notification[value="translation"] menulist {
- padding-inline-end: 1ch;
- }
-
- notification[value="translation"] menulist {
- border: 1px solid #C1C1C1;
- background-color: #FFF;
- }
-
- notification[value="translation"] button {
- border: 1px solid #C1C1C1;
- background-color: #FBFBFB;
- }
-
- notification[value="translation"] button,
- notification[value="translation"] menulist,
- notification[value="translation"] menulist > .menulist-label-box {
- margin-inline-start: 1ch;
- margin-inline-end: 1ch;
- }
-
- notification[value="translation"] button:hover,
- notification[value="translation"] button:active,
- notification[value="translation"] menulist:hover,
- notification[value="translation"] menulist:active {
- background-color: #EBEBEB;
- }
-
- notification[value="translation"] button[anonid="translate"] {
- color: #FFF;
- background-color: #0095DD;
- box-shadow: none;
- border: 1px solid #006B9D;
- }
-
- notification[value="translation"] button[anonid="translate"]:hover,
- notification[value="translation"] button[anonid="translate"]:active {
- background-color: #008ACB;
- }
-
- notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker,
- notification[value="translation"] menulist > .menulist-dropmarker {
- list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png");
- }
-
- notification[value="translation"] button > .button-box,
- notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker {
- padding: 0;
- margin-inline-start: 3ch;
- }
-
- notification[value="translation"] button:not([type="menu"]) > .button-box {
- margin-inline-end: 3ch;
- }
-}
-
-.translation-menupopup {
- -moz-appearance: none;
-}
-
/* Bookmarks roots menu-items */
#subscribeToPageMenuitem:not([disabled]),
#subscribeToPageMenupopup {
diff --git a/application/basilisk/themes/windows/preferences/preferences.css b/application/basilisk/themes/windows/preferences/preferences.css
index bd1ec3083..c6c063b53 100644
--- a/application/basilisk/themes/windows/preferences/preferences.css
+++ b/application/basilisk/themes/windows/preferences/preferences.css
@@ -15,13 +15,6 @@
#isNotDefaultLabel {
font-weight: bold;
}
-
-/* Content Pane */
-#translationAttributionImage {
- width: 70px;
- cursor: pointer;
-}
-
/* Modeless Window Dialogs */
.windowDialog,
.windowDialog prefpane {