diff --git a/.eslintignore b/.eslintignore
index a676a160e1c7..3c8a9c3b2323 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -117,20 +117,9 @@ devtools/server/tests/browser/**
devtools/server/tests/mochitest/**
devtools/server/tests/unit/**
devtools/shared/apps/**
-devtools/shared/client/**
-devtools/shared/discovery/**
devtools/shared/gcli/**
!devtools/shared/gcli/templater.js
devtools/shared/heapsnapshot/**
-devtools/shared/layout/**
-devtools/shared/performance/**
-!devtools/shared/platform/**
-devtools/shared/qrcode/**
-devtools/shared/security/**
-devtools/shared/shims/**
-devtools/shared/tests/**
-!devtools/shared/tests/unit/test_csslexer.js
-devtools/shared/touch/**
devtools/shared/transport/**
!devtools/shared/transport/transport.js
!devtools/shared/transport/websocket-transport.js
diff --git a/accessible/base/TextAttrs.cpp b/accessible/base/TextAttrs.cpp
index 0f9e4f6feac5..cb66d1380b9c 100644
--- a/accessible/base/TextAttrs.cpp
+++ b/accessible/base/TextAttrs.cpp
@@ -374,10 +374,9 @@ bool
TextAttrsMgr::BGColorTextAttr::
GetColor(nsIFrame* aFrame, nscolor* aColor)
{
- const nsStyleBackground* styleBackground = aFrame->StyleBackground();
-
- if (NS_GET_A(styleBackground->mBackgroundColor) > 0) {
- *aColor = styleBackground->mBackgroundColor;
+ nscolor backgroundColor = aFrame->StyleBackground()->BackgroundColor(aFrame);
+ if (NS_GET_A(backgroundColor) > 0) {
+ *aColor = backgroundColor;
return true;
}
diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp
index b0cdc0932dbb..c87e7bee2120 100644
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -1075,7 +1075,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
if (child->Role() == roles::ROW) {
prevRowColor = rowColor;
nsIFrame* rowFrame = child->GetFrame();
- rowColor = rowFrame->StyleBackground()->mBackgroundColor;
+ rowColor = rowFrame->StyleBackground()->BackgroundColor(rowFrame);
if (childIdx > 0 && prevRowColor != rowColor)
RETURN_LAYOUT_ANSWER(false, "2 styles of row background color, non-bordered");
diff --git a/accessible/windows/ia2/ia2AccessibleComponent.cpp b/accessible/windows/ia2/ia2AccessibleComponent.cpp
index f32c09d1e413..7ae62f381cd8 100644
--- a/accessible/windows/ia2/ia2AccessibleComponent.cpp
+++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp
@@ -117,8 +117,9 @@ ia2AccessibleComponent::get_background(IA2Color* aBackground)
return CO_E_OBJNOTCONNECTED;
nsIFrame* frame = acc->GetFrame();
- if (frame)
- *aBackground = frame->StyleBackground()->mBackgroundColor;
+ if (frame) {
+ *aBackground = frame->StyleBackground()->BackgroundColor(frame);
+ }
return S_OK;
diff --git a/addon-sdk/source/test/addons/embedded-webextension/main.js b/addon-sdk/source/test/addons/embedded-webextension/main.js
index 4e51c2f9bb09..11249c50476a 100644
--- a/addon-sdk/source/test/addons/embedded-webextension/main.js
+++ b/addon-sdk/source/test/addons/embedded-webextension/main.js
@@ -135,7 +135,7 @@ exports.testEmbeddedWebExtensionContentScript = function* (assert, done) {
browser.runtime.onConnect.addListener(portListener);
});
- let url = "data:text/html;charset=utf-8,
Test Page
";
+ let url = "http://example.org/";
var openedTab;
tabs.once('open', function onOpen(tab) {
diff --git a/addon-sdk/source/test/test-dev-panel.js b/addon-sdk/source/test/test-dev-panel.js
index fb786b04304b..e1a3cf2b77b6 100644
--- a/addon-sdk/source/test/test-dev-panel.js
+++ b/addon-sdk/source/test/test-dev-panel.js
@@ -27,11 +27,13 @@ const test = function(unit) {
return function*(assert) {
assert.isRendered = (panel, toolbox) => {
const doc = toolbox.doc;
- assert.ok(doc.querySelector("[value='" + panel.label + "']"),
- "panel.label is found in the developer toolbox DOM");
- assert.ok(doc.querySelector("[tooltiptext='" + panel.tooltip + "']"),
- "panel.tooltip is found in the developer toolbox DOM");
-
+ assert.ok(Array.from(doc.querySelectorAll(".devtools-tab"))
+ .find(el => el.textContent === panel.label),
+ "panel.label is found in the developer toolbox DOM " + panel.label);
+ if (panel.tooltip) {
+ assert.ok(doc.querySelector("[title='" + panel.tooltip + "']"),
+ `panel.tooltip is found in the developer toolbox DOM "${panel.tooltip}"`);
+ }
assert.ok(doc.querySelector("#toolbox-panel-" + panel.id),
"toolbar panel with a matching id is present");
};
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index eb1e38d858aa..3e199c84a8a4 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1221,7 +1221,8 @@ pref("security.mixed_content.block_active_content", true);
// Show degraded UI for http pages with password fields.
pref("security.insecure_password.ui.enabled", true);
-pref("security.insecure_field_warning.contextual.enabled", false);
+// Show in-content login form warning UI for insecure login fields
+pref("security.insecure_field_warning.contextual.enabled", true);
// 1 = allow MITM for certificate pinning checks.
pref("security.cert_pinning.enforcement_level", 1);
diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js
index f78d2366f689..06fe9e18ce3b 100644
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -168,7 +168,7 @@ appUpdater.prototype =
* @param aChildID
* The id of the deck's child to select, e.g. "apply".
*/
- selectPanel: function(aChildID) {
+ selectPanel(aChildID) {
let panel = document.getElementById(aChildID);
let button = panel.querySelector("button");
@@ -191,7 +191,7 @@ appUpdater.prototype =
/**
* Check for updates
*/
- checkForUpdates: function() {
+ checkForUpdates() {
// Clear prefs that could prevent a user from discovering available updates.
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_CANCELATIONS_OSX)) {
Services.prefs.clearUserPref(PREF_APP_UPDATE_CANCELATIONS_OSX);
@@ -209,7 +209,7 @@ appUpdater.prototype =
* Handles oncommand for the "Restart to Update" button
* which is presented after the download has been downloaded.
*/
- buttonRestartAfterDownload: function() {
+ buttonRestartAfterDownload() {
if (!this.isPending && !this.isApplied) {
return;
}
@@ -249,7 +249,7 @@ appUpdater.prototype =
/**
* See nsIUpdateService.idl
*/
- onCheckComplete: function(aRequest, aUpdates, aUpdateCount) {
+ onCheckComplete(aRequest, aUpdates, aUpdateCount) {
gAppUpdater.isChecking = false;
gAppUpdater.update = gAppUpdater.aus.
selectUpdate(aUpdates, aUpdates.length);
@@ -281,7 +281,7 @@ appUpdater.prototype =
/**
* See nsIUpdateService.idl
*/
- onError: function(aRequest, aUpdate) {
+ onError(aRequest, aUpdate) {
// Errors in the update check are treated as no updates found. If the
// update check fails repeatedly without a success the user will be
// notified with the normal app update user interface so this is safe.
@@ -292,7 +292,7 @@ appUpdater.prototype =
/**
* See nsISupports.idl
*/
- QueryInterface: function(aIID) {
+ QueryInterface(aIID) {
if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
!aIID.equals(Components.interfaces.nsISupports))
throw Components.results.NS_ERROR_NO_INTERFACE;
@@ -303,7 +303,7 @@ appUpdater.prototype =
/**
* Starts the download of an update mar.
*/
- startDownload: function() {
+ startDownload() {
if (!this.update)
this.update = this.um.activeUpdate;
this.update.QueryInterface(Components.interfaces.nsIWritablePropertyBag);
@@ -322,7 +322,7 @@ appUpdater.prototype =
/**
* Switches to the UI responsible for tracking the download.
*/
- setupDownloadingUI: function() {
+ setupDownloadingUI() {
this.downloadStatus = document.getElementById("downloadStatus");
this.downloadStatus.value =
DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size);
@@ -330,7 +330,7 @@ appUpdater.prototype =
this.aus.addDownloadListener(this);
},
- removeDownloadListener: function() {
+ removeDownloadListener() {
if (this.aus) {
this.aus.removeDownloadListener(this);
}
@@ -339,13 +339,13 @@ appUpdater.prototype =
/**
* See nsIRequestObserver.idl
*/
- onStartRequest: function(aRequest, aContext) {
+ onStartRequest(aRequest, aContext) {
},
/**
* See nsIRequestObserver.idl
*/
- onStopRequest: function(aRequest, aContext, aStatusCode) {
+ onStopRequest(aRequest, aContext, aStatusCode) {
switch (aStatusCode) {
case Components.results.NS_ERROR_UNEXPECTED:
if (this.update.selectedPatch.state == "download-failed" &&
@@ -404,13 +404,13 @@ appUpdater.prototype =
/**
* See nsIProgressEventSink.idl
*/
- onStatus: function(aRequest, aContext, aStatus, aStatusArg) {
+ onStatus(aRequest, aContext, aStatus, aStatusArg) {
},
/**
* See nsIProgressEventSink.idl
*/
- onProgress: function(aRequest, aContext, aProgress, aProgressMax) {
+ onProgress(aRequest, aContext, aProgress, aProgressMax) {
this.downloadStatus.value =
DownloadUtils.getTransferTotal(aProgress, aProgressMax);
},
@@ -418,7 +418,7 @@ appUpdater.prototype =
/**
* See nsISupports.idl
*/
- QueryInterface: function(aIID) {
+ QueryInterface(aIID) {
if (!aIID.equals(Components.interfaces.nsIProgressEventSink) &&
!aIID.equals(Components.interfaces.nsIRequestObserver) &&
!aIID.equals(Components.interfaces.nsISupports))
diff --git a/browser/base/content/aboutaccounts/aboutaccounts.js b/browser/base/content/aboutaccounts/aboutaccounts.js
index bb9d00b1627d..f1660ca4149a 100644
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -101,7 +101,7 @@ function updateDisplayedEmail(user) {
var wrapper = {
iframe: null,
- init: function(url, urlParams) {
+ init(url, urlParams) {
// If a master-password is enabled, we want to encourage the user to
// unlock it. Things still work if not, but the user will probably need
// to re-auth next startup (in which case we will get here again and
@@ -130,7 +130,7 @@ var wrapper = {
webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null);
},
- retry: function() {
+ retry() {
let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
},
@@ -140,7 +140,7 @@ var wrapper = {
Ci.nsISupportsWeakReference,
Ci.nsISupports]),
- onStateChange: function(aWebProgress, aRequest, aState, aStatus) {
+ onStateChange(aWebProgress, aRequest, aState, aStatus) {
let failure = false;
// Captive portals sometimes redirect users
@@ -164,19 +164,19 @@ var wrapper = {
}
},
- onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
+ onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
if (aRequest && aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
aRequest.cancel(Components.results.NS_BINDING_ABORTED);
setErrorPage("networkError");
}
},
- onProgressChange: function() {},
- onStatusChange: function() {},
- onSecurityChange: function() {},
+ onProgressChange() {},
+ onStatusChange() {},
+ onSecurityChange() {},
},
- handleEvent: function(evt) {
+ handleEvent(evt) {
switch (evt.type) {
case "load":
this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this);
@@ -194,7 +194,7 @@ var wrapper = {
*
* @param accountData the user's account data and credentials
*/
- onLogin: function(accountData) {
+ onLogin(accountData) {
log("Received: 'login'. Data:" + JSON.stringify(accountData));
if (accountData.customizeSync) {
@@ -251,16 +251,16 @@ var wrapper = {
);
},
- onCanLinkAccount: function(accountData) {
+ onCanLinkAccount(accountData) {
// We need to confirm a relink - see shouldAllowRelink for more
let ok = shouldAllowRelink(accountData.email);
- this.injectData("message", { status: "can_link_account", data: { ok: ok } });
+ this.injectData("message", { status: "can_link_account", data: { ok } });
},
/**
* onSignOut handler erases the current user's session from the fxaccounts service
*/
- onSignOut: function() {
+ onSignOut() {
log("Received: 'sign_out'.");
fxAccounts.signOut().then(
@@ -269,7 +269,7 @@ var wrapper = {
);
},
- handleRemoteCommand: function(evt) {
+ handleRemoteCommand(evt) {
log('command: ' + evt.detail.command);
let data = evt.detail.data;
@@ -289,11 +289,11 @@ var wrapper = {
}
},
- injectData: function(type, content) {
+ injectData(type, content) {
return fxAccounts.promiseAccountsSignUpURI().then(authUrl => {
let data = {
- type: type,
- content: content
+ type,
+ content
};
this.iframe.contentWindow.postMessage(data, authUrl);
})
diff --git a/browser/base/content/abouthealthreport/abouthealth.js b/browser/base/content/abouthealthreport/abouthealth.js
index a21248f62d48..ae59e238eb0a 100644
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -15,28 +15,28 @@ const PREF_UNIFIED = "toolkit.telemetry.unified";
const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
var healthReportWrapper = {
- init: function() {
+ init() {
let iframe = document.getElementById("remote-report");
iframe.addEventListener("load", healthReportWrapper.initRemotePage, false);
iframe.src = this._getReportURI().spec;
prefs.observe("uploadEnabled", this.updatePrefState, healthReportWrapper);
},
- uninit: function() {
+ uninit() {
prefs.ignore("uploadEnabled", this.updatePrefState, healthReportWrapper);
},
- _getReportURI: function() {
+ _getReportURI() {
let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
return Services.io.newURI(url, null, null);
},
- setDataSubmission: function(enabled) {
+ setDataSubmission(enabled) {
MozSelfSupport.healthReportDataSubmissionEnabled = enabled;
this.updatePrefState();
},
- updatePrefState: function() {
+ updatePrefState() {
try {
let prefsObj = {
enabled: MozSelfSupport.healthReportDataSubmissionEnabled,
@@ -48,7 +48,7 @@ var healthReportWrapper = {
}
},
- sendTelemetryPingList: function() {
+ sendTelemetryPingList() {
console.log("AboutHealthReport: Collecting Telemetry ping list.");
MozSelfSupport.getTelemetryPingList().then((list) => {
console.log("AboutHealthReport: Sending Telemetry ping list.");
@@ -58,7 +58,7 @@ var healthReportWrapper = {
});
},
- sendTelemetryPingData: function(pingId) {
+ sendTelemetryPingData(pingId) {
console.log("AboutHealthReport: Collecting Telemetry ping data.");
MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
console.log("AboutHealthReport: Sending Telemetry ping data.");
@@ -75,7 +75,7 @@ var healthReportWrapper = {
});
},
- sendCurrentEnvironment: function() {
+ sendCurrentEnvironment() {
console.log("AboutHealthReport: Sending Telemetry environment data.");
MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
this.injectData("telemetry-current-environment-data", environment);
@@ -84,7 +84,7 @@ var healthReportWrapper = {
});
},
- sendCurrentPingData: function() {
+ sendCurrentPingData() {
console.log("AboutHealthReport: Sending current Telemetry ping data.");
MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
this.injectData("telemetry-current-ping-data", ping);
@@ -93,7 +93,7 @@ var healthReportWrapper = {
});
},
- injectData: function(type, content) {
+ injectData(type, content) {
let report = this._getReportURI();
// file URIs can't be used for targetOrigin, so we use "*" for this special case
@@ -101,15 +101,15 @@ var healthReportWrapper = {
let reportUrl = report.scheme == "file" ? "*" : report.spec;
let data = {
- type: type,
- content: content
+ type,
+ content
}
let iframe = document.getElementById("remote-report");
iframe.contentWindow.postMessage(data, reportUrl);
},
- handleRemoteCommand: function(evt) {
+ handleRemoteCommand(evt) {
// Do an origin check to harden against the frame content being loaded from unexpected locations.
let allowedPrincipal = Services.scriptSecurityManager.getCodebasePrincipal(this._getReportURI());
let targetPrincipal = evt.target.nodePrincipal;
@@ -147,7 +147,7 @@ var healthReportWrapper = {
}
},
- initRemotePage: function() {
+ initRemotePage() {
let iframe = document.getElementById("remote-report").contentDocument;
iframe.addEventListener("RemoteHealthReportCommand",
function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
@@ -160,18 +160,18 @@ var healthReportWrapper = {
ERROR_PAYLOAD_FAILED: 2,
ERROR_PREFS_FAILED: 3,
- reportFailure: function(error) {
+ reportFailure(error) {
let details = {
errorType: error,
}
healthReportWrapper.injectData("error", details);
},
- handleInitFailure: function() {
+ handleInitFailure() {
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_INIT_FAILED);
},
- handlePayloadFailure: function() {
+ handlePayloadFailure() {
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PAYLOAD_FAILED);
},
}
diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js
index 498d9bd2ed31..54dd71b96493 100644
--- a/browser/base/content/abouthome/aboutHome.js
+++ b/browser/base/content/abouthome/aboutHome.js
@@ -186,18 +186,18 @@ function ensureSnippetsMapThen(aCallback)
// The cache has been filled up, create the snippets map.
gSnippetsMap = Object.freeze({
get: (aKey) => cache.get(aKey),
- set: function(aKey, aValue) {
+ set(aKey, aValue) {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey);
return cache.set(aKey, aValue);
},
has: (aKey) => cache.has(aKey),
- delete: function(aKey) {
+ delete(aKey) {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey);
return cache.delete(aKey);
},
- clear: function() {
+ clear() {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).clear();
return cache.clear();
diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js
index 1b52cde94901..8957c36c69e0 100644
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -30,7 +30,7 @@ function removeNotificationOnEnd(notification, installs) {
}
const gXPInstallObserver = {
- _findChildShell: function(aDocShell, aSoughtShell)
+ _findChildShell(aDocShell, aSoughtShell)
{
if (aDocShell == aSoughtShell)
return aDocShell;
@@ -45,7 +45,7 @@ const gXPInstallObserver = {
return null;
},
- _getBrowser: function(aDocShell)
+ _getBrowser(aDocShell)
{
for (let browser of gBrowser.browsers) {
if (this._findChildShell(browser.docShell, aDocShell))
@@ -56,7 +56,7 @@ const gXPInstallObserver = {
pendingInstalls: new WeakMap(),
- showInstallConfirmation: function(browser, installInfo, height = undefined) {
+ showInstallConfirmation(browser, installInfo, height = undefined) {
// If the confirmation notification is already open cache the installInfo
// and the new confirmation will be shown later
if (PopupNotifications.getNotification("addon-install-confirmation", browser)) {
@@ -217,7 +217,7 @@ const gXPInstallObserver = {
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
},
- observe: function(aSubject, aTopic, aData)
+ observe(aSubject, aTopic, aData)
{
var brandBundle = document.getElementById("bundle_brand");
var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
@@ -282,7 +282,7 @@ const gXPInstallObserver = {
action = {
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
- callback: function() {
+ callback() {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED_CLICK_THROUGH);
installInfo.install();
}
@@ -433,7 +433,7 @@ const gXPInstallObserver = {
action = {
label: gNavigatorBundle.getString("addonInstallRestartButton"),
accessKey: gNavigatorBundle.getString("addonInstallRestartButton.accesskey"),
- callback: function() {
+ callback() {
BrowserUtils.restartApplication();
}
};
@@ -472,14 +472,14 @@ const gXPInstallObserver = {
};
var LightWeightThemeWebInstaller = {
- init: function() {
+ init() {
let mm = window.messageManager;
mm.addMessageListener("LightWeightThemeWebInstaller:Install", this);
mm.addMessageListener("LightWeightThemeWebInstaller:Preview", this);
mm.addMessageListener("LightWeightThemeWebInstaller:ResetPreview", this);
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
// ignore requests from background tabs
if (message.target != gBrowser.selectedBrowser) {
return;
@@ -503,7 +503,7 @@ var LightWeightThemeWebInstaller = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "TabSelect": {
this._resetPreview();
@@ -519,7 +519,7 @@ var LightWeightThemeWebInstaller = {
return this._manager = temp.LightweightThemeManager;
},
- _installRequest: function(dataString, baseURI) {
+ _installRequest(dataString, baseURI) {
let data = this._manager.parseTheme(dataString, baseURI);
if (!data) {
@@ -560,7 +560,7 @@ var LightWeightThemeWebInstaller = {
let buttons = [{
label: allowButtonText,
accessKey: allowButtonAccesskey,
- callback: function() {
+ callback() {
LightWeightThemeWebInstaller._install(data, notify);
}
}];
@@ -575,11 +575,11 @@ var LightWeightThemeWebInstaller = {
notificationBar.persistence = 1;
},
- _install: function(newLWTheme, notify) {
+ _install(newLWTheme, notify) {
let previousLWTheme = this._manager.currentTheme;
let listener = {
- onEnabling: function(aAddon, aRequiresRestart) {
+ onEnabling(aAddon, aRequiresRestart) {
if (!aRequiresRestart) {
return;
}
@@ -590,7 +590,7 @@ var LightWeightThemeWebInstaller = {
let action = {
label: gNavigatorBundle.getString("lwthemeNeedsRestart.button"),
accessKey: gNavigatorBundle.getString("lwthemeNeedsRestart.accesskey"),
- callback: function() {
+ callback() {
BrowserUtils.restartApplication();
}
};
@@ -604,7 +604,7 @@ var LightWeightThemeWebInstaller = {
action, null, options);
},
- onEnabled: function(aAddon) {
+ onEnabled(aAddon) {
if (notify) {
LightWeightThemeWebInstaller._postInstallNotification(newLWTheme, previousLWTheme);
}
@@ -616,7 +616,7 @@ var LightWeightThemeWebInstaller = {
AddonManager.removeAddonListener(listener);
},
- _postInstallNotification: function(newTheme, previousTheme) {
+ _postInstallNotification(newTheme, previousTheme) {
function text(id) {
return gNavigatorBundle.getString("lwthemePostInstallNotification." + id);
}
@@ -624,14 +624,14 @@ var LightWeightThemeWebInstaller = {
let buttons = [{
label: text("undoButton"),
accessKey: text("undoButton.accesskey"),
- callback: function() {
+ callback() {
LightWeightThemeWebInstaller._manager.forgetUsedTheme(newTheme.id);
LightWeightThemeWebInstaller._manager.currentTheme = previousTheme;
}
}, {
label: text("manageButton"),
accessKey: text("manageButton.accesskey"),
- callback: function() {
+ callback() {
BrowserOpenAddonsMgr("addons://list/theme");
}
}];
@@ -648,7 +648,7 @@ var LightWeightThemeWebInstaller = {
notificationBar.timeout = Date.now() + 20000; // 20 seconds
},
- _removePreviousNotifications: function() {
+ _removePreviousNotifications() {
let box = gBrowser.getNotificationBox();
["lwtheme-install-request",
@@ -659,7 +659,7 @@ var LightWeightThemeWebInstaller = {
});
},
- _preview: function(dataString, baseURI) {
+ _preview(dataString, baseURI) {
if (!this._isAllowed(baseURI))
return;
@@ -672,14 +672,14 @@ var LightWeightThemeWebInstaller = {
this._manager.previewTheme(data);
},
- _resetPreview: function(baseURI) {
+ _resetPreview(baseURI) {
if (baseURI && !this._isAllowed(baseURI))
return;
gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
this._manager.resetPreview();
},
- _isAllowed: function(srcURIString) {
+ _isAllowed(srcURIString) {
let uri;
try {
uri = makeURI(srcURIString);
@@ -704,7 +704,7 @@ var LightWeightThemeWebInstaller = {
var LightweightThemeListener = {
_modifiedStyles: [],
- init: function() {
+ init() {
XPCOMUtils.defineLazyGetter(this, "styleSheet", function() {
for (let i = document.styleSheets.length - 1; i >= 0; i--) {
let sheet = document.styleSheets[i];
@@ -720,7 +720,7 @@ var LightweightThemeListener = {
this.updateStyleSheet(document.documentElement.style.backgroundImage);
},
- uninit: function() {
+ uninit() {
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
Services.obs.removeObserver(this, "lightweight-theme-optimized");
},
@@ -731,13 +731,13 @@ var LightweightThemeListener = {
*
* @param headerImage - a string containing a CSS image for the lightweight theme header.
*/
- updateStyleSheet: function(headerImage) {
+ updateStyleSheet(headerImage) {
if (!this.styleSheet)
return;
this.substituteRules(this.styleSheet.cssRules, headerImage);
},
- substituteRules: function(ruleList, headerImage, existingStyleRulesModified = 0) {
+ substituteRules(ruleList, headerImage, existingStyleRulesModified = 0) {
let styleRulesModified = 0;
for (let i = 0; i < ruleList.length; i++) {
let rule = ruleList[i];
@@ -761,7 +761,7 @@ var LightweightThemeListener = {
},
// nsIObserver
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
if ((aTopic != "lightweight-theme-styling-update" && aTopic != "lightweight-theme-optimized") ||
!this.styleSheet)
return;
diff --git a/browser/base/content/browser-ctrlTab.js b/browser/base/content/browser-ctrlTab.js
index 7cafd8541948..88cff082b1e2 100644
--- a/browser/base/content/browser-ctrlTab.js
+++ b/browser/base/content/browser-ctrlTab.js
@@ -96,7 +96,7 @@ var tabPreviews = {
};
var tabPreviewPanelHelper = {
- opening: function(host) {
+ opening(host) {
host.panel.hidden = false;
var handler = this._generateHandler(host);
@@ -105,7 +105,7 @@ var tabPreviewPanelHelper = {
host._prevFocus = document.commandDispatcher.focusedElement;
},
- _generateHandler: function(host) {
+ _generateHandler(host) {
var self = this;
return function(event) {
if (event.target == host.panel) {
@@ -114,11 +114,11 @@ var tabPreviewPanelHelper = {
}
};
},
- _popupshown: function(host) {
+ _popupshown(host) {
if ("setupGUI" in host)
host.setupGUI();
},
- _popuphiding: function(host) {
+ _popuphiding(host) {
if ("suspendGUI" in host)
host.suspendGUI();
@@ -219,7 +219,7 @@ var ctrlTab = {
else
this.uninit();
},
- observe: function(aSubject, aTopic, aPrefName) {
+ observe(aSubject, aTopic, aPrefName) {
this.readPref();
},
@@ -507,7 +507,7 @@ var ctrlTab = {
}
},
- filterForThumbnailExpiration: function(aCallback) {
+ filterForThumbnailExpiration(aCallback) {
// Save a few more thumbnails than we actually display, so that when tabs
// are closed, the previews we add instead still get thumbnails.
const extraThumbnails = 3;
@@ -521,7 +521,7 @@ var ctrlTab = {
aCallback(urls);
},
- _initRecentlyUsedTabs: function() {
+ _initRecentlyUsedTabs() {
this._recentlyUsedTabs =
Array.filter(gBrowser.tabs, tab => !tab.closing)
.sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js
index d5d51b8931a3..672d25ec6caa 100644
--- a/browser/base/content/browser-customization.js
+++ b/browser/base/content/browser-customization.js
@@ -9,7 +9,7 @@
* events.
*/
var CustomizationHandler = {
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "customizationstarting":
this._customizationStarting();
@@ -23,11 +23,11 @@ var CustomizationHandler = {
}
},
- isCustomizing: function() {
+ isCustomizing() {
return document.documentElement.hasAttribute("customizing");
},
- _customizationStarting: function() {
+ _customizationStarting() {
// Disable the toolbar context menu items
let menubar = document.getElementById("main-menubar");
for (let childNode of menubar.childNodes)
@@ -51,11 +51,11 @@ var CustomizationHandler = {
}
},
- _customizationChange: function() {
+ _customizationChange() {
PlacesToolbarHelper.customizeChange();
},
- _customizationEnding: function(aDetails) {
+ _customizationEnding(aDetails) {
// Update global UI elements that may have been added or removed
if (aDetails.changed) {
gURLBar = document.getElementById("urlbar");
diff --git a/browser/base/content/browser-data-submission-info-bar.js b/browser/base/content/browser-data-submission-info-bar.js
index 0d2c7aabfc10..456f91b48ee0 100644
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -27,7 +27,7 @@ var gDataNotificationInfoBar = {
return this._log = Log.repository.getLoggerWithMessagePrefix(LOGGER_NAME, LOGGER_PREFIX);
},
- init: function() {
+ init() {
window.addEventListener("unload", () => {
for (let o of this._OBSERVERS) {
Services.obs.removeObserver(this, o);
@@ -39,11 +39,11 @@ var gDataNotificationInfoBar = {
}
},
- _getDataReportingNotification: function(name = this._DATA_REPORTING_NOTIFICATION) {
+ _getDataReportingNotification(name = this._DATA_REPORTING_NOTIFICATION) {
return this._notificationBox.getNotificationWithValue(name);
},
- _displayDataPolicyInfoBar: function(request) {
+ _displayDataPolicyInfoBar(request) {
if (this._getDataReportingNotification()) {
return;
}
@@ -88,7 +88,7 @@ var gDataNotificationInfoBar = {
request.onUserNotifyComplete();
},
- _clearPolicyNotification: function() {
+ _clearPolicyNotification() {
let notification = this._getDataReportingNotification();
if (notification) {
this._log.debug("Closing notification.");
@@ -96,7 +96,7 @@ var gDataNotificationInfoBar = {
}
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
switch (topic) {
case "datareporting:notify-data-policy:request":
let request = subject.wrappedJSObject.object;
diff --git a/browser/base/content/browser-devedition.js b/browser/base/content/browser-devedition.js
index 8c1fe88a5b0e..aa4da1d5ba0e 100644
--- a/browser/base/content/browser-devedition.js
+++ b/browser/base/content/browser-devedition.js
@@ -21,7 +21,7 @@ var DevEdition = {
return theme && theme.id == "firefox-devedition@mozilla.org";
},
- init: function() {
+ init() {
this.initialized = true;
Services.prefs.addObserver(this._devtoolsThemePrefName, this, false);
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
@@ -33,7 +33,7 @@ var DevEdition = {
}
},
- createStyleSheet: function() {
+ createStyleSheet() {
let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`;
this.styleSheet = document.createProcessingInstruction(
"xml-stylesheet", styleSheetAttr);
@@ -42,7 +42,7 @@ var DevEdition = {
this.styleSheet.sheet.disabled = true;
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
if (topic == "lightweight-theme-styling-update") {
let newTheme = JSON.parse(data);
if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") {
@@ -59,7 +59,7 @@ var DevEdition = {
}
},
- _inferBrightness: function() {
+ _inferBrightness() {
ToolbarIconColor.inferFromText();
// Get an inverted full screen button if the dark theme is applied.
if (this.isStyleSheetEnabled &&
@@ -78,7 +78,7 @@ var DevEdition = {
}
},
- _updateDevtoolsThemeAttribute: function() {
+ _updateDevtoolsThemeAttribute() {
// Set an attribute on root element to make it possible
// to change colors based on the selected devtools theme.
let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName);
@@ -90,14 +90,14 @@ var DevEdition = {
this._inferBrightness();
},
- handleEvent: function(e) {
+ handleEvent(e) {
if (e.type === "load") {
this.styleSheet.removeEventListener("load", this);
this.refreshBrowserDisplay();
}
},
- refreshBrowserDisplay: function() {
+ refreshBrowserDisplay() {
// Don't touch things on the browser if gBrowserInit.onLoad hasn't
// yet fired.
if (this.initialized) {
@@ -106,7 +106,7 @@ var DevEdition = {
}
},
- _toggleStyleSheet: function(deveditionThemeEnabled) {
+ _toggleStyleSheet(deveditionThemeEnabled) {
let wasEnabled = this.isStyleSheetEnabled;
if (deveditionThemeEnabled && !wasEnabled) {
// The stylesheet may not have been created yet if it wasn't
@@ -122,7 +122,7 @@ var DevEdition = {
}
},
- uninit: function() {
+ uninit() {
Services.prefs.removeObserver(this._devtoolsThemePrefName, this);
Services.obs.removeObserver(this, "lightweight-theme-styling-update", false);
Services.obs.removeObserver(this, "lightweight-theme-window-updated", false);
diff --git a/browser/base/content/browser-fullScreenAndPointerLock.js b/browser/base/content/browser-fullScreenAndPointerLock.js
index 678500e7ab32..4e8539056735 100644
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
@@ -8,19 +8,19 @@ var PointerlockFsWarning = {
_element: null,
_origin: null,
- init: function() {
+ init() {
this.Timeout.prototype = {
- start: function() {
+ start() {
this.cancel();
this._id = setTimeout(() => this._handle(), this._delay);
},
- cancel: function() {
+ cancel() {
if (this._id) {
clearTimeout(this._id);
this._id = 0;
}
},
- _handle: function() {
+ _handle() {
this._id = 0;
this._func();
},
@@ -30,6 +30,13 @@ var PointerlockFsWarning = {
};
},
+ /* eslint-disable object-shorthand */
+ /* The object-shorthand rule must be disabled for this constructor
+ * because the ES6 method syntax causes "this.Timeout is not a
+ * constructor" exception. Further, using the {ignoreConstructors: true}
+ * option causes "TypeError: Cannot read property 'charAt' of undefined"
+ * in eslint.
+ */
/**
* Timeout object for managing timeout request. If it is started when
* the previous call hasn't finished, it would automatically cancelled
@@ -40,15 +47,16 @@ var PointerlockFsWarning = {
this._func = func;
this._delay = delay;
},
+ /* eslint-enable object-shorthand */
- showPointerLock: function(aOrigin) {
+ showPointerLock(aOrigin) {
if (!document.fullscreen) {
let timeout = gPrefService.getIntPref("pointer-lock-api.warning.timeout");
this.show(aOrigin, "pointerlock-warning", timeout, 0);
}
},
- showFullScreen: function(aOrigin) {
+ showFullScreen(aOrigin) {
let timeout = gPrefService.getIntPref("full-screen-api.warning.timeout");
let delay = gPrefService.getIntPref("full-screen-api.warning.delay");
this.show(aOrigin, "fullscreen-warning", timeout, delay);
@@ -56,7 +64,7 @@ var PointerlockFsWarning = {
// Shows a warning that the site has entered fullscreen or
// pointer lock for a short duration.
- show: function(aOrigin, elementId, timeout, delay) {
+ show(aOrigin, elementId, timeout, delay) {
if (!this._element) {
this._element = document.getElementById(elementId);
@@ -111,7 +119,7 @@ var PointerlockFsWarning = {
this._timeoutHide.start();
},
- close: function() {
+ close() {
if (!this._element) {
return;
}
@@ -180,7 +188,7 @@ var PointerlockFsWarning = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "mousemove": {
let state = this._state;
@@ -226,12 +234,12 @@ var PointerlockFsWarning = {
var PointerLock = {
- init: function() {
+ init() {
window.messageManager.addMessageListener("PointerLock:Entered", this);
window.messageManager.addMessageListener("PointerLock:Exited", this);
},
- receiveMessage: function(aMessage) {
+ receiveMessage(aMessage) {
switch (aMessage.name) {
case "PointerLock:Entered": {
PointerlockFsWarning.showPointerLock(aMessage.data.originNoSuffix);
@@ -253,7 +261,7 @@ var FullScreen = {
"DOMFullscreen:Painted",
],
- init: function() {
+ init() {
// called when we go into full screen, even if initiated by a web page script
window.addEventListener("fullscreen", this, true);
window.addEventListener("MozDOMFullscreen:Entered", this,
@@ -270,14 +278,14 @@ var FullScreen = {
this.toggle();
},
- uninit: function() {
+ uninit() {
for (let type of this._MESSAGES) {
window.messageManager.removeMessageListener(type, this);
}
this.cleanup();
},
- toggle: function() {
+ toggle() {
var enterFS = window.fullScreen;
// Toggle the View:FullScreen command, which controls elements like the
@@ -342,11 +350,11 @@ var FullScreen = {
}
},
- exitDomFullScreen : function() {
+ exitDomFullScreen() {
document.exitFullscreen();
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "fullscreen":
this.toggle();
@@ -377,7 +385,7 @@ var FullScreen = {
}
},
- receiveMessage: function(aMessage) {
+ receiveMessage(aMessage) {
let browser = aMessage.target;
switch (aMessage.name) {
case "DOMFullscreen:Request": {
@@ -403,7 +411,7 @@ var FullScreen = {
}
},
- enterDomFullscreen : function(aBrowser) {
+ enterDomFullscreen(aBrowser) {
if (!document.fullscreenElement) {
return;
@@ -456,7 +464,7 @@ var FullScreen = {
window.addEventListener("activate", this);
},
- cleanup: function() {
+ cleanup() {
if (!window.fullScreen) {
MousePosTracker.removeListener(this);
document.removeEventListener("keypress", this._keyToggleCallback, false);
@@ -465,7 +473,7 @@ var FullScreen = {
}
},
- cleanupDomFullscreen: function() {
+ cleanupDomFullscreen() {
window.messageManager
.broadcastAsyncMessage("DOMFullscreen:CleanUp");
@@ -478,7 +486,7 @@ var FullScreen = {
document.documentElement.removeAttribute("inDOMFullscreen");
},
- _isRemoteBrowser: function(aBrowser) {
+ _isRemoteBrowser(aBrowser) {
return gMultiProcessBrowser && aBrowser.getAttribute("remote") == "true";
},
@@ -487,21 +495,21 @@ var FullScreen = {
.getInterface(Ci.nsIDOMWindowUtils);
},
- getMouseTargetRect: function()
+ getMouseTargetRect()
{
return this._mouseTargetRect;
},
// Event callbacks
- _expandCallback: function()
+ _expandCallback()
{
FullScreen.showNavToolbox();
},
- onMouseEnter: function()
+ onMouseEnter()
{
FullScreen.hideNavToolbox();
},
- _keyToggleCallback: function(aEvent)
+ _keyToggleCallback(aEvent)
{
// if we can use the keyboard (eg Ctrl+L or Ctrl+E) to open the toolbars, we
// should provide a way to collapse them too.
@@ -516,7 +524,7 @@ var FullScreen = {
// Checks whether we are allowed to collapse the chrome
_isPopupOpen: false,
_isChromeCollapsed: false,
- _safeToCollapse: function() {
+ _safeToCollapse() {
if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
return false;
@@ -538,7 +546,7 @@ var FullScreen = {
return true;
},
- _setPopupOpen: function(aEvent)
+ _setPopupOpen(aEvent)
{
// Popups should only veto chrome collapsing if they were opened when the chrome was not collapsed.
// Otherwise, they would not affect chrome and the user would expect the chrome to go away.
@@ -556,18 +564,18 @@ var FullScreen = {
},
// Autohide helpers for the context menu item
- getAutohide: function(aItem)
+ getAutohide(aItem)
{
aItem.setAttribute("checked", gPrefService.getBoolPref("browser.fullscreen.autohide"));
},
- setAutohide: function()
+ setAutohide()
{
gPrefService.setBoolPref("browser.fullscreen.autohide", !gPrefService.getBoolPref("browser.fullscreen.autohide"));
// Try again to hide toolbar when we change the pref.
FullScreen.hideNavToolbox(true);
},
- showNavToolbox: function(trackMouse = true) {
+ showNavToolbox(trackMouse = true) {
this._fullScrToggler.hidden = true;
gNavToolbox.removeAttribute("fullscreenShouldAnimate");
gNavToolbox.style.marginTop = "";
@@ -591,7 +599,7 @@ var FullScreen = {
this._isChromeCollapsed = false;
},
- hideNavToolbox: function(aAnimate = false) {
+ hideNavToolbox(aAnimate = false) {
if (this._isChromeCollapsed || !this._safeToCollapse())
return;
@@ -615,7 +623,7 @@ var FullScreen = {
MousePosTracker.removeListener(this);
},
- _updateToolbars: function(aEnterFS) {
+ _updateToolbars(aEnterFS) {
for (let el of document.querySelectorAll("toolbar[fullscreentoolbar=true]")) {
if (aEnterFS) {
// Give the main nav bar and the tab bar the fullscreen context menu,
diff --git a/browser/base/content/browser-fullZoom.js b/browser/base/content/browser-fullZoom.js
index 2e963cfa6f9d..6f3f0271b08e 100644
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -89,7 +89,7 @@ var FullZoom = {
// nsIObserver
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
switch (aData) {
@@ -154,7 +154,7 @@ var FullZoom = {
let hasPref = false;
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
- handleResult: function() { hasPref = true; },
+ handleResult() { hasPref = true; },
handleCompletion: function() {
if (!hasPref && token.isCurrent)
this._applyPrefToZoom(undefined, browser);
@@ -223,7 +223,7 @@ var FullZoom = {
let value = undefined;
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
- handleResult: function(resultPref) { value = resultPref.value; },
+ handleResult(resultPref) { value = resultPref.value; },
handleCompletion: function() {
if (!token.isCurrent) {
this._notifyOnLocationChange(browser);
@@ -269,7 +269,7 @@ var FullZoom = {
* Sets the zoom level for the given browser to the given floating
* point value, where 1 is the default zoom level.
*/
- setZoom: function(value, browser = gBrowser.selectedBrowser) {
+ setZoom(value, browser = gBrowser.selectedBrowser) {
ZoomManager.setZoomForBrowser(browser, value);
this._ignorePendingZoomAccesses(browser);
this._applyZoomToPref(browser);
@@ -487,7 +487,7 @@ var FullZoom = {
}
let value = undefined;
this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
- handleResult: function(pref) { value = pref.value; },
+ handleResult(pref) { value = pref.value; },
handleCompletion: (reason) => {
this._globalValue = this._ensureValid(value);
resolve(this._globalValue);
diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js
index d841dc142e7c..951f35b9cbd0 100644
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -88,7 +88,7 @@ var gFxAccounts = {
.sort((a, b) => a.name.localeCompare(b.name));
},
- init: function() {
+ init() {
// Bail out if we're already initialized and for pop-up windows.
if (this._initialized || !window.toolbar.visible) {
return;
@@ -107,7 +107,7 @@ var gFxAccounts = {
this.updateUI();
},
- uninit: function() {
+ uninit() {
if (!this._initialized) {
return;
}
@@ -119,7 +119,7 @@ var gFxAccounts = {
this._initialized = false;
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
switch (topic) {
case "fxa-migration:state-changed":
this.onMigrationStateChanged(data, subject);
@@ -133,7 +133,7 @@ var gFxAccounts = {
}
},
- onMigrationStateChanged: function() {
+ onMigrationStateChanged() {
// Since we nuked most of the migration code, this notification will fire
// once after legacy Sync has been disconnected (and should never fire
// again)
@@ -175,12 +175,12 @@ var gFxAccounts = {
this.updateAppMenuItem();
},
- handleEvent: function(event) {
+ handleEvent(event) {
this._inCustomizationMode = event.type == "customizationstarting";
this.updateAppMenuItem();
},
- updateUI: function() {
+ updateUI() {
// It's possible someone signed in to FxA after seeing our notification
// about "Legacy Sync migration" (which now is actually "Legacy Sync
// auto-disconnect") so kill that notification if it still exists.
@@ -194,7 +194,7 @@ var gFxAccounts = {
},
// Note that updateAppMenuItem() returns a Promise that's only used by tests.
- updateAppMenuItem: function() {
+ updateAppMenuItem() {
let profileInfoEnabled = false;
try {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
@@ -320,7 +320,7 @@ var gFxAccounts = {
});
},
- onMenuPanelCommand: function() {
+ onMenuPanelCommand() {
switch (this.panelUIFooter.getAttribute("fxastatus")) {
case "signedin":
@@ -341,11 +341,11 @@ var gFxAccounts = {
PanelUI.hide();
},
- openPreferences: function() {
+ openPreferences() {
openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } });
},
- openAccountsPage: function(action, urlParams = {}) {
+ openAccountsPage(action, urlParams = {}) {
let params = new URLSearchParams();
if (action) {
params.set("action", action);
@@ -361,15 +361,15 @@ var gFxAccounts = {
});
},
- openSignInAgainPage: function(entryPoint) {
+ openSignInAgainPage(entryPoint) {
this.openAccountsPage("reauth", { entrypoint: entryPoint });
},
- sendTabToDevice: function(url, clientId, title) {
+ sendTabToDevice(url, clientId, title) {
Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
},
- populateSendTabToDevicesMenu: function(devicesPopup, url, title) {
+ populateSendTabToDevicesMenu(devicesPopup, url, title) {
// remove existing menu items
while (devicesPopup.hasChildNodes()) {
devicesPopup.removeChild(devicesPopup.firstChild);
@@ -410,7 +410,7 @@ var gFxAccounts = {
devicesPopup.appendChild(fragment);
},
- updateTabContextMenu: function(aPopupMenu) {
+ updateTabContextMenu(aPopupMenu) {
if (!this.sendTabToDeviceEnabled) {
return;
}
@@ -420,7 +420,7 @@ var gFxAccounts = {
.forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
},
- initPageContextMenu: function(contextMenu) {
+ initPageContextMenu(contextMenu) {
if (!this.sendTabToDeviceEnabled) {
return;
}
diff --git a/browser/base/content/browser-gestureSupport.js b/browser/base/content/browser-gestureSupport.js
index 7c60a05675b0..c281ebf54e19 100644
--- a/browser/base/content/browser-gestureSupport.js
+++ b/browser/base/content/browser-gestureSupport.js
@@ -351,7 +351,7 @@ var gGestureSupport = {
* @param aEvent
* The continual motion update event to handle
*/
- _doUpdate: function(aEvent) {},
+ _doUpdate(aEvent) {},
/**
* Handle gesture end events. This function will be set by _setupSwipe.
@@ -359,7 +359,7 @@ var gGestureSupport = {
* @param aEvent
* The gesture end event to handle
*/
- _doEnd: function(aEvent) {},
+ _doEnd(aEvent) {},
/**
* Convert the swipe gesture into a browser action based on the direction.
@@ -444,7 +444,7 @@ var gGestureSupport = {
* @param aEvent
* The MozRotateGestureUpdate event triggering this call
*/
- rotate: function(aEvent) {
+ rotate(aEvent) {
if (!(content.document instanceof ImageDocument))
return;
@@ -463,7 +463,7 @@ var gGestureSupport = {
/**
* Perform a rotation end for ImageDocuments
*/
- rotateEnd: function() {
+ rotateEnd() {
if (!(content.document instanceof ImageDocument))
return;
@@ -531,7 +531,7 @@ var gGestureSupport = {
* When the location/tab changes, need to reload the current rotation for the
* image
*/
- restoreRotationState: function() {
+ restoreRotationState() {
// Bug 863514 - Make gesture support work in electrolysis
if (gMultiProcessBrowser)
return;
@@ -560,7 +560,7 @@ var gGestureSupport = {
/**
* Removes the transition rule by removing the completeRotation class
*/
- _clearCompleteRotation: function() {
+ _clearCompleteRotation() {
let contentElement = content.document &&
content.document instanceof ImageDocument &&
content.document.body &&
@@ -731,7 +731,7 @@ var gHistorySwipeAnimation = {
}
},
- _getCurrentHistoryIndex: function() {
+ _getCurrentHistoryIndex() {
return SessionStore.getSessionHistory(gBrowser.selectedTab).index;
},
diff --git a/browser/base/content/browser-media.js b/browser/base/content/browser-media.js
index 7d10635df286..9e0498b9259c 100644
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -12,7 +12,7 @@ var gEMEHandler = {
}
return emeUIEnabled;
},
- ensureEMEEnabled: function(browser, keySystem) {
+ ensureEMEEnabled(browser, keySystem) {
Services.prefs.setBoolPref("media.eme.enabled", true);
if (keySystem) {
if (keySystem.startsWith("com.adobe") &&
@@ -27,7 +27,7 @@ var gEMEHandler = {
}
browser.reload();
},
- isKeySystemVisible: function(keySystem) {
+ isKeySystemVisible(keySystem) {
if (!keySystem) {
return false;
}
@@ -41,13 +41,13 @@ var gEMEHandler = {
}
return true;
},
- getLearnMoreLink: function(msgId) {
+ getLearnMoreLink(msgId) {
let text = gNavigatorBundle.getString("emeNotifications." + msgId + ".learnMoreLabel");
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
return "";
},
- receiveMessage: function({target: browser, data: data}) {
+ receiveMessage({target: browser, data: data}) {
let parsedData;
try {
parsedData = JSON.parse(data);
@@ -102,7 +102,7 @@ var gEMEHandler = {
this.showNotificationBar(browser, notificationId, keySystem, params, buttonCallback);
},
- showNotificationBar: function(browser, notificationId, keySystem, labelParams, callback) {
+ showNotificationBar(browser, notificationId, keySystem, labelParams, callback) {
let box = gBrowser.getNotificationBox(browser);
if (box.getNotificationWithValue(notificationId)) {
return;
@@ -122,7 +122,7 @@ var gEMEHandler = {
buttons.push({
label: gNavigatorBundle.getString(btnLabelId),
accessKey: gNavigatorBundle.getString(btnAccessKeyId),
- callback: callback
+ callback
});
}
@@ -139,7 +139,7 @@ var gEMEHandler = {
box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
buttons);
},
- showPopupNotificationForSuccess: function(browser, keySystem) {
+ showPopupNotificationForSuccess(browser, keySystem) {
// We're playing EME content! Remove any "we can't play because..." messages.
var box = gBrowser.getNotificationBox(browser);
["drmContentDisabled",
@@ -174,7 +174,7 @@ var gEMEHandler = {
let mainAction = {
label: gNavigatorBundle.getString(btnLabelId),
accessKey: gNavigatorBundle.getString(btnAccessKeyId),
- callback: function() { openPreferences("paneContent"); },
+ callback() { openPreferences("paneContent"); },
dismiss: true
};
let options = {
diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js
index 08e326b7e0fe..960065dd0192 100644
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -9,7 +9,7 @@ var StarUI = {
_isNewBookmark: false,
_autoCloseTimer: 0,
- _element: function(aID) {
+ _element(aID) {
return document.getElementById(aID);
},
@@ -633,10 +633,10 @@ var PlacesCommandHook = {
PlacesUIUtils.showBookmarkDialog({ action: "add"
, type: "livemark"
- , feedURI: feedURI
+ , feedURI
, siteURI: gBrowser.currentURI
- , title: title
- , description: description
+ , title
+ , description
, defaultInsertionPoint: toolbarIP
, hiddenRows: [ "feedLocation"
, "siteLocation"
@@ -1143,7 +1143,7 @@ var PlacesToolbarHelper = {
return !area || CustomizableUI.TYPE_MENU_PANEL == areaType;
},
- onPlaceholderCommand: function() {
+ onPlaceholderCommand() {
let widgetGroup = CustomizableUI.getWidget("personal-bookmarks");
let widget = widgetGroup.forWindow(window);
if (widget.overflowed ||
@@ -1152,7 +1152,7 @@ var PlacesToolbarHelper = {
}
},
- _getParentToolbar: function(element) {
+ _getParentToolbar(element) {
while (element) {
if (element.localName == "toolbar") {
return element;
@@ -1162,7 +1162,7 @@ var PlacesToolbarHelper = {
return null;
},
- onWidgetUnderflow: function(aNode, aContainer) {
+ onWidgetUnderflow(aNode, aContainer) {
// The view gets broken by being removed and reinserted by the overflowable
// toolbar, so we have to force an uninit and reinit.
let win = aNode.ownerGlobal;
@@ -1171,7 +1171,7 @@ var PlacesToolbarHelper = {
}
},
- onWidgetAdded: function(aWidgetId, aArea, aPosition) {
+ onWidgetAdded(aWidgetId, aArea, aPosition) {
if (aWidgetId == "personal-bookmarks" && !this._isCustomizing) {
// It's possible (with the "Add to Menu", "Add to Toolbar" context
// options) that the Places Toolbar Items have been moved without
@@ -1182,7 +1182,7 @@ var PlacesToolbarHelper = {
}
},
- _resetView: function() {
+ _resetView() {
if (this._viewElt) {
// It's possible that the placesView might not exist, and we need to
// do a full init. This could happen if the Bookmarks Toolbar Items are
@@ -1274,7 +1274,7 @@ var BookmarkingUI = {
this._getFormattedTooltip("starButtonOff.tooltip2");
},
- _getFormattedTooltip: function(strId) {
+ _getFormattedTooltip(strId) {
let args = [];
let shortcut = document.getElementById(this.BOOKMARK_BUTTON_SHORTCUT);
if (shortcut)
@@ -1287,7 +1287,7 @@ var BookmarkingUI = {
* When in the panel, we don't update the button's icon.
*/
_currentAreaType: null,
- _shouldUpdateStarState: function() {
+ _shouldUpdateStarState() {
return this._currentAreaType == CustomizableUI.TYPE_TOOLBAR;
},
@@ -1349,7 +1349,7 @@ var BookmarkingUI = {
}
},
- attachPlacesView: function(event, node) {
+ attachPlacesView(event, node) {
// If the view is already there, bail out early.
if (node.parentNode._placesView)
return;
@@ -1577,7 +1577,7 @@ var BookmarkingUI = {
}
},
- init: function() {
+ init() {
CustomizableUI.addListener(this);
this._updateCustomizationState();
},
@@ -1757,7 +1757,7 @@ var BookmarkingUI = {
}, 1000);
},
- _showSubview: function() {
+ _showSubview() {
let view = document.getElementById("PanelUI-bookmarks");
view.addEventListener("ViewShowing", this);
view.addEventListener("ViewHiding", this);
@@ -1902,11 +1902,11 @@ var BookmarkingUI = {
}
},
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onBeforeItemRemoved: function() {},
- onItemVisited: function() {},
- onItemMoved: function() {},
+ onBeginUpdateBatch() {},
+ onEndUpdateBatch() {},
+ onBeforeItemRemoved() {},
+ onItemVisited() {},
+ onItemMoved() {},
// CustomizableUI events:
_starButtonLabel: null,
@@ -1920,7 +1920,7 @@ var BookmarkingUI = {
return this._starButtonOverflowedStarredLabel =
gNavigatorBundle.getString("starButtonOverflowedStarred.label");
},
- onWidgetOverflow: function(aNode, aContainer) {
+ onWidgetOverflow(aNode, aContainer) {
let win = aNode.ownerGlobal;
if (aNode.id != this.BOOKMARK_BUTTON_ID || win != window)
return;
@@ -1936,7 +1936,7 @@ var BookmarkingUI = {
}
},
- onWidgetUnderflow: function(aNode, aContainer) {
+ onWidgetUnderflow(aNode, aContainer) {
let win = aNode.ownerGlobal;
if (aNode.id != this.BOOKMARK_BUTTON_ID || win != window)
return;
diff --git a/browser/base/content/browser-plugins.js b/browser/base/content/browser-plugins.js
index fb68d262c65e..ddfe7ff7a519 100644
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -17,7 +17,7 @@ var gPluginHandler = {
"PluginContent:LinkClickCallback",
],
- init: function() {
+ init() {
const mm = window.messageManager;
for (let msg of this.MESSAGES) {
mm.addMessageListener(msg, this);
@@ -25,7 +25,7 @@ var gPluginHandler = {
window.addEventListener("unload", this);
},
- uninit: function() {
+ uninit() {
const mm = window.messageManager;
for (let msg of this.MESSAGES) {
mm.removeMessageListener(msg, this);
@@ -33,13 +33,13 @@ var gPluginHandler = {
window.removeEventListener("unload", this);
},
- handleEvent: function(event) {
+ handleEvent(event) {
if (event.type == "unload") {
this.uninit();
}
},
- receiveMessage: function(msg) {
+ receiveMessage(msg) {
switch (msg.name) {
case "PluginContent:ShowClickToPlayNotification":
this.showClickToPlayNotification(msg.target, msg.data.plugins, msg.data.showNow,
@@ -83,13 +83,13 @@ var gPluginHandler = {
},
// Callback for user clicking on a disabled plugin
- managePlugins: function() {
+ managePlugins() {
BrowserOpenAddonsMgr("addons://list/plugin");
},
// Callback for user clicking on the link in a click-to-play plugin
// (where the plugin has an update)
- openPluginUpdatePage: function(pluginTag) {
+ openPluginUpdatePage(pluginTag) {
let url = Services.blocklist.getPluginInfoURL(pluginTag);
if (!url) {
url = Services.blocklist.getPluginBlocklistURL(pluginTag);
@@ -106,12 +106,12 @@ var gPluginHandler = {
},
// Callback for user clicking a "reload page" link
- reloadPage: function(browser) {
+ reloadPage(browser) {
browser.reload();
},
// Callback for user clicking the help icon
- openHelpPage: function() {
+ openHelpPage() {
openHelpLink("plugin-crashed", false);
},
@@ -139,7 +139,7 @@ var gPluginHandler = {
* and activate plugins if necessary.
* aNewState should be either "allownow" "allowalways" or "block"
*/
- _updatePluginPermission: function(aNotification, aPluginInfo, aNewState) {
+ _updatePluginPermission(aNotification, aPluginInfo, aNewState) {
let permission;
let expireType;
let expireTime;
@@ -208,7 +208,7 @@ var gPluginHandler = {
});
},
- showClickToPlayNotification: function(browser, plugins, showNow,
+ showClickToPlayNotification(browser, plugins, showNow,
principal, location) {
// It is possible that we've received a message from the frame script to show
// a click to play notification for a principal that no longer matches the one
@@ -281,8 +281,8 @@ var gPluginHandler = {
persistent: showNow,
eventCallback: this._clickToPlayNotificationEventCallback,
primaryPlugin: primaryPluginPermission,
- pluginData: pluginData,
- principal: principal,
+ pluginData,
+ principal,
};
PopupNotifications.show(browser, "click-to-play-plugins",
"", "plugins-notification-icon",
@@ -290,20 +290,20 @@ var gPluginHandler = {
browser.messageManager.sendAsyncMessage("BrowserPlugins:NotificationShown");
},
- removeNotification: function(browser, name) {
+ removeNotification(browser, name) {
let notification = PopupNotifications.getNotification(name, browser);
if (notification)
PopupNotifications.remove(notification);
},
- hideNotificationBar: function(browser, name) {
+ hideNotificationBar(browser, name) {
let notificationBox = gBrowser.getNotificationBox(browser);
let notification = notificationBox.getNotificationWithValue(name);
if (notification)
notificationBox.removeNotification(notification, true);
},
- updateHiddenPluginUI: function(browser, haveInsecure, actions,
+ updateHiddenPluginUI(browser, haveInsecure, actions,
principal, location) {
let origin = principal.originNoSuffix;
@@ -391,7 +391,7 @@ var gPluginHandler = {
{
label: gNavigatorBundle.getString("pluginContinueBlocking.label"),
accessKey: gNavigatorBundle.getString("pluginContinueBlocking.accesskey"),
- callback: function() {
+ callback() {
Services.telemetry.getHistogramById("PLUGINS_INFOBAR_BLOCK").
add(true);
@@ -403,7 +403,7 @@ var gPluginHandler = {
{
label: gNavigatorBundle.getString("pluginActivateTrigger.label"),
accessKey: gNavigatorBundle.getString("pluginActivateTrigger.accesskey"),
- callback: function() {
+ callback() {
Services.telemetry.getHistogramById("PLUGINS_INFOBAR_ALLOW").
add(true);
@@ -437,14 +437,14 @@ var gPluginHandler = {
}
},
- contextMenuCommand: function(browser, plugin, command) {
+ contextMenuCommand(browser, plugin, command) {
browser.messageManager.sendAsyncMessage("BrowserPlugins:ContextMenuCommand",
- { command: command }, { plugin: plugin });
+ { command }, { plugin });
},
// Crashed-plugin observer. Notified once per plugin crash, before events
// are dispatched to individual plugin instances.
- NPAPIPluginCrashed : function(subject, topic, data) {
+ NPAPIPluginCrashed(subject, topic, data) {
let propertyBag = subject;
if (!(propertyBag instanceof Ci.nsIPropertyBag2) ||
!(propertyBag instanceof Ci.nsIWritablePropertyBag2) ||
@@ -493,7 +493,7 @@ var gPluginHandler = {
* For a GMP, this is the pluginID. For NPAPI plugins (where "pluginID"
* means something different), this is the runID.
*/
- showPluginCrashedNotification: function(browser, messageString, pluginID) {
+ showPluginCrashedNotification(browser, messageString, pluginID) {
// If there's already an existing notification bar, don't do anything.
let notificationBox = gBrowser.getNotificationBox(browser);
let notification = notificationBox.getNotificationWithValue("plugin-crashed");
@@ -511,7 +511,7 @@ var gPluginHandler = {
label: reloadLabel,
accessKey: reloadKey,
popup: null,
- callback: function() { browser.reload(); },
+ callback() { browser.reload(); },
}];
if (AppConstants.MOZ_CRASHREPORTER &&
diff --git a/browser/base/content/browser-refreshblocker.js b/browser/base/content/browser-refreshblocker.js
index 50ea992c4006..2c6f2da97930 100644
--- a/browser/base/content/browser-refreshblocker.js
+++ b/browser/base/content/browser-refreshblocker.js
@@ -17,7 +17,7 @@ var RefreshBlocker = {
gBrowser.removeEventListener("RefreshBlocked", this);
},
- handleEvent: function(event) {
+ handleEvent(event) {
if (event.type == "RefreshBlocked") {
this.block(event.originalTarget, event.detail);
}
@@ -68,7 +68,7 @@ var RefreshBlocker = {
let buttons = [{
label: refreshButtonText,
accessKey: refreshButtonAccesskey,
- callback: function() {
+ callback() {
if (browser.messageManager) {
browser.messageManager.sendAsyncMessage("RefreshBlocker:Refresh", data);
}
diff --git a/browser/base/content/browser-safebrowsing.js b/browser/base/content/browser-safebrowsing.js
index 430d84f132bd..b8b5976e39e4 100644
--- a/browser/base/content/browser-safebrowsing.js
+++ b/browser/base/content/browser-safebrowsing.js
@@ -4,7 +4,7 @@
var gSafeBrowsing = {
- setReportPhishingMenu: function() {
+ setReportPhishingMenu() {
// In order to detect whether or not we're at the phishing warning
// page, we have to check the documentURI instead of the currentURI.
// This is because when the DocShell loads an error page, the
@@ -42,7 +42,7 @@ var gSafeBrowsing = {
* @param name String One of "Phish", "Error", "Malware" or "MalwareError"
* @return String the report phishing URL.
*/
- getReportURL: function(name) {
+ getReportURL(name) {
return SafeBrowsing.getReportURL(name, gBrowser.currentURI);
}
}
diff --git a/browser/base/content/browser-sidebar.js b/browser/base/content/browser-sidebar.js
index 5893e6015bb9..76128ecd8b2b 100644
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/base/content/browser-sidebar.js
@@ -258,7 +258,7 @@ var SidebarUI = {
let selBrowser = gBrowser.selectedBrowser;
selBrowser.messageManager.sendAsyncMessage("Sidebar:VisibilityChange",
- {commandID: commandID, isOpen: true}
+ {commandID, isOpen: true}
);
BrowserUITelemetry.countSidebarEvent(commandID, "show");
});
@@ -296,7 +296,7 @@ var SidebarUI = {
let selBrowser = gBrowser.selectedBrowser;
selBrowser.focus();
selBrowser.messageManager.sendAsyncMessage("Sidebar:VisibilityChange",
- {commandID: commandID, isOpen: false}
+ {commandID, isOpen: false}
);
BrowserUITelemetry.countSidebarEvent(commandID, "hide");
},
diff --git a/browser/base/content/browser-syncui.js b/browser/base/content/browser-syncui.js
index 299b1743d065..6d219570f840 100644
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -39,7 +39,7 @@ var gSyncUI = {
_syncStartTime: 0,
_syncAnimationTimer: 0,
- init: function() {
+ init() {
Cu.import("resource://services-common/stringbundle.js");
// Proceed to set up the UI if Sync has already started up.
@@ -137,7 +137,7 @@ var gSyncUI = {
// Note that we don't show login errors in a notification bar here, but do
// still need to track a login-failed state so the "Tools" menu updates
// with the correct state.
- _loginFailed: function() {
+ _loginFailed() {
// If Sync isn't already ready, we don't want to force it to initialize
// by referencing Weave.Status - and it isn't going to be accurate before
// Sync is ready anyway.
@@ -242,7 +242,7 @@ var gSyncUI = {
this.updateUI();
},
- _getAppName: function() {
+ _getAppName() {
let brand = new StringBundle("chrome://branding/locale/brand.properties");
return brand.get("brandShortName");
},
@@ -304,7 +304,7 @@ var gSyncUI = {
},
// Open the legacy-sync device pairing UI. Note used for FxA Sync.
- openAddDevice: function() {
+ openAddDevice() {
if (!Weave.Utils.ensureMPUnlocked())
return;
@@ -316,11 +316,11 @@ var gSyncUI = {
"syncAddDevice", "centerscreen,chrome,resizable=no");
},
- openPrefs: function(entryPoint) {
+ openPrefs(entryPoint) {
openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
},
- openSignInAgainPage: function(entryPoint = "syncbutton") {
+ openSignInAgainPage(entryPoint = "syncbutton") {
gFxAccounts.openSignInAgainPage(entryPoint);
},
@@ -423,7 +423,7 @@ var gSyncUI = {
}
}),
- formatLastSyncDate: function(date) {
+ formatLastSyncDate(date) {
let dateFormat;
let sixDaysAgo = (() => {
let tempDate = new Date();
@@ -441,7 +441,7 @@ var gSyncUI = {
return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1);
},
- onClientsSynced: function() {
+ onClientsSynced() {
let broadcaster = document.getElementById("sync-syncnow-state");
if (broadcaster) {
if (Weave.Service.clientsEngine.stats.numClients > 1) {
diff --git a/browser/base/content/browser-tabsintitlebar-stub.js b/browser/base/content/browser-tabsintitlebar-stub.js
index f6b91506b8a1..41325ec1bb32 100644
--- a/browser/base/content/browser-tabsintitlebar-stub.js
+++ b/browser/base/content/browser-tabsintitlebar-stub.js
@@ -7,9 +7,9 @@
// don't have CAN_DRAW_IN_TITLEBAR defined.
var TabsInTitlebar = {
- init: function() {},
- uninit: function() {},
- allowedBy: function(condition, allow) {},
+ init() {},
+ uninit() {},
+ allowedBy(condition, allow) {},
updateAppearance: function updateAppearance(aForce) {},
get enabled() {
return document.documentElement.getAttribute("tabsintitlebar") == "true";
diff --git a/browser/base/content/browser-tabsintitlebar.js b/browser/base/content/browser-tabsintitlebar.js
index ab882c8948c9..1a8065179597 100644
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -7,7 +7,7 @@
// this one on platforms which don't have CAN_DRAW_IN_TITLEBAR defined.
var TabsInTitlebar = {
- init: function() {
+ init() {
if (this._initialized) {
return;
}
@@ -49,7 +49,7 @@ var TabsInTitlebar = {
}
},
- allowedBy: function(condition, allow) {
+ allowedBy(condition, allow) {
if (allow) {
if (condition in this._disallowed) {
delete this._disallowed[condition];
@@ -69,18 +69,18 @@ var TabsInTitlebar = {
return document.documentElement.getAttribute("tabsintitlebar") == "true";
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
if (topic == "nsPref:changed")
this._readPref();
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (aEvent.type == "resolutionchange" && aEvent.target == window) {
this._update(true);
}
},
- _onMenuMutate: function(aMutations) {
+ _onMenuMutate(aMutations) {
for (let mutation of aMutations) {
if (mutation.attributeName == "inactive" ||
mutation.attributeName == "autohide") {
@@ -96,12 +96,12 @@ var TabsInTitlebar = {
_prefName: "browser.tabs.drawInTitlebar",
_lastSizeMode: null,
- _readPref: function() {
+ _readPref() {
this.allowedBy("pref",
Services.prefs.getBoolPref(this._prefName));
},
- _update: function(aForce = false) {
+ _update(aForce = false) {
let $ = id => document.getElementById(id);
let rect = ele => ele.getBoundingClientRect();
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
@@ -253,12 +253,12 @@ var TabsInTitlebar = {
}
},
- _sizePlaceholder: function(type, width) {
+ _sizePlaceholder(type, width) {
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
function(node) { node.width = width; });
},
- uninit: function() {
+ uninit() {
this._initialized = false;
removeEventListener("resolutionchange", this);
Services.prefs.removeObserver(this._prefName, this);
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 045a48f7af68..3d2eb02ac1d2 100755
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -170,10 +170,10 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function() {
Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
let AeroPeek = Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", {}).AeroPeek;
return {
- onOpenWindow: function() {
+ onOpenWindow() {
AeroPeek.onOpenWindow(window);
},
- onCloseWindow: function() {
+ onCloseWindow() {
AeroPeek.onCloseWindow(window);
}
};
@@ -408,7 +408,7 @@ const gClickAndHoldListenersOnElement = {
};
const gSessionHistoryObserver = {
- observe: function(subject, topic, data)
+ observe(subject, topic, data)
{
if (topic != "browser:purge-session-history")
return;
@@ -459,7 +459,7 @@ function findChildShell(aDocument, aDocShell, aSoughtURI) {
var gPopupBlockerObserver = {
_reportButton: null,
- onReportButtonMousedown: function(aEvent)
+ onReportButtonMousedown(aEvent)
{
// If this method is called on the same event tick as the popup gets
// hidden, do nothing to avoid re-opening the popup.
@@ -470,7 +470,7 @@ var gPopupBlockerObserver = {
.openPopup(this._reportButton, "after_end", 0, 2, false, false, aEvent);
},
- handleEvent: function(aEvent)
+ handleEvent(aEvent)
{
if (aEvent.originalTarget != gBrowser.selectedBrowser)
return;
@@ -541,7 +541,7 @@ var gPopupBlockerObserver = {
}
},
- toggleAllowPopupsForSite: function(aEvent)
+ toggleAllowPopupsForSite(aEvent)
{
var pm = Services.perms;
var shouldBlock = aEvent.target.getAttribute("block") == "true";
@@ -554,7 +554,7 @@ var gPopupBlockerObserver = {
gBrowser.getNotificationBox().removeCurrentNotification();
},
- fillPopupList: function(aEvent)
+ fillPopupList(aEvent)
{
// XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites
// we should really walk the blockedPopups and create a list of "allow for "
@@ -657,7 +657,7 @@ var gPopupBlockerObserver = {
}, null);
},
- onPopupHiding: function(aEvent) {
+ onPopupHiding(aEvent) {
if (aEvent.target.anchorNode.id == "page-report-button")
aEvent.target.anchorNode.removeAttribute("open");
@@ -672,7 +672,7 @@ var gPopupBlockerObserver = {
}
},
- showBlockedPopup: function(aEvent)
+ showBlockedPopup(aEvent)
{
var target = aEvent.target;
var popupReportIndex = target.getAttribute("popupReportIndex");
@@ -680,7 +680,7 @@ var gPopupBlockerObserver = {
browser.unblockPopup(popupReportIndex);
},
- showAllBlockedPopups: function(aBrowser)
+ showAllBlockedPopups(aBrowser)
{
aBrowser.retrieveListOfBlockedPopups().then(popups => {
for (let i = 0; i < popups.length; i++) {
@@ -690,7 +690,7 @@ var gPopupBlockerObserver = {
}, null);
},
- editPopupSettings: function()
+ editPopupSettings()
{
let prefillValue = "";
try {
@@ -729,7 +729,7 @@ var gPopupBlockerObserver = {
"_blank", "resizable,dialog=no,centerscreen", params);
},
- dontShowMessage: function()
+ dontShowMessage()
{
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
@@ -824,7 +824,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
{
label: yesMessage,
accessKey: gNavigatorBundle.getString("keywordURIFixup.goTo.accesskey"),
- callback: function() {
+ callback() {
// Do not set this preference while in private browsing.
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
let pref = "browser.fixup.domainwhitelist." + asciiHost;
@@ -836,7 +836,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
{
label: gNavigatorBundle.getString("keywordURIFixup.dismiss"),
accessKey: gNavigatorBundle.getString("keywordURIFixup.dismiss.accesskey"),
- callback: function() {
+ callback() {
let notification = notificationBox.getNotificationWithValue("keyword-uri-fixup");
notificationBox.removeNotification(notification, true);
}
@@ -896,11 +896,11 @@ function _loadURIWithFlags(browser, uri, params) {
}
let loadParams = {
- uri: uri,
- flags: flags,
+ uri,
+ flags,
referrer: referrer ? referrer.spec : null,
- referrerPolicy: referrerPolicy,
- postData: postData
+ referrerPolicy,
+ postData
}
if (params.userContextId) {
@@ -1001,7 +1001,7 @@ addEventListener("DOMContentLoaded", function onDCL() {
var gBrowserInit = {
delayedStartupFinished: false,
- onLoad: function() {
+ onLoad() {
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver, false);
Services.obs.addObserver(gPluginHandler.NPAPIPluginCrashed, "plugin-crashed", false);
@@ -1104,12 +1104,12 @@ var gBrowserInit = {
this._loadHandled = true;
},
- _cancelDelayedStartup: function() {
+ _cancelDelayedStartup() {
window.removeEventListener("MozAfterPaint", this._boundDelayedStartup);
this._boundDelayedStartup = null;
},
- _delayedStartup: function() {
+ _delayedStartup() {
let tmp = {};
Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", tmp);
let TelemetryTimestamps = tmp.TelemetryTimestamps;
@@ -1470,7 +1470,7 @@ var gBrowserInit = {
},
// Returns the URI(s) to load at startup.
- _getUriToLoad: function() {
+ _getUriToLoad() {
// window.arguments[0]: URI to load (string), or an nsIArray of
// nsISupportsStrings to load, or a xul:tab of
// a tabbrowser, which will be replaced by this
@@ -1494,7 +1494,7 @@ var gBrowserInit = {
return uri;
},
- onUnload: function() {
+ onUnload() {
// In certain scenarios it's possible for unload to be fired before onload,
// (e.g. if the window is being closed after browser.js loads but before the
// load completes). In that case, there's nothing to do here.
@@ -2054,7 +2054,7 @@ var gLastOpenDirectory = {
gPrefService.setComplexValue("browser.open.lastDir", Ci.nsILocalFile,
this._lastDir);
},
- reset: function() {
+ reset() {
this._lastDir = null;
}
};
@@ -2111,10 +2111,10 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
try {
openLinkIn(uri, "current",
{ referrerURI: referrer,
- referrerPolicy: referrerPolicy,
- postData: postData,
- allowThirdPartyFixup: allowThirdPartyFixup,
- userContextId: userContextId,
+ referrerPolicy,
+ postData,
+ allowThirdPartyFixup,
+ userContextId,
originPrincipal,
forceAboutBlankViewerInCurrent,
});
@@ -2367,7 +2367,7 @@ function BrowserViewSourceOfDocument(aArgsOrDocument) {
*/
function BrowserViewSource(browser) {
BrowserViewSourceOfDocument({
- browser: browser,
+ browser,
outerWindowID: browser.outerWindowID,
URL: browser.currentURI.spec,
});
@@ -2616,21 +2616,21 @@ var gMenuButtonBadgeManager = {
downloadBadge: null,
appUpdateBadge: null,
- init: function() {
+ init() {
PanelUI.panel.addEventListener("popupshowing", this, true);
},
- uninit: function() {
+ uninit() {
PanelUI.panel.removeEventListener("popupshowing", this, true);
},
- handleEvent: function(e) {
+ handleEvent(e) {
if (e.type === "popupshowing") {
this.clearBadges();
}
},
- _showBadge: function() {
+ _showBadge() {
let badgeToShow = this.downloadBadge || this.appUpdateBadge || this.fxaBadge;
if (badgeToShow) {
@@ -2640,7 +2640,7 @@ var gMenuButtonBadgeManager = {
}
},
- _changeBadge: function(badgeId, badgeStatus = null) {
+ _changeBadge(badgeId, badgeStatus = null) {
if (badgeId == this.BADGEID_APPUPDATE) {
this.appUpdateBadge = badgeStatus;
} else if (badgeId == this.BADGEID_DOWNLOAD) {
@@ -2653,7 +2653,7 @@ var gMenuButtonBadgeManager = {
this._showBadge();
},
- addBadge: function(badgeId, badgeStatus) {
+ addBadge(badgeId, badgeStatus) {
if (!badgeStatus) {
Cu.reportError("badgeStatus must be defined");
return;
@@ -2661,11 +2661,11 @@ var gMenuButtonBadgeManager = {
this._changeBadge(badgeId, badgeStatus);
},
- removeBadge: function(badgeId) {
+ removeBadge(badgeId) {
this._changeBadge(badgeId);
},
- clearBadges: function() {
+ clearBadges() {
this.appUpdateBadge = null;
this.downloadBadge = null;
this.fxaBadge = null;
@@ -2680,7 +2680,7 @@ var gMenuButtonUpdateBadge = {
timer: null,
cancelObserverRegistered: false,
- init: function() {
+ init() {
try {
this.enabled = Services.prefs.getBoolPref("app.update.badge");
} catch (e) {}
@@ -2695,7 +2695,7 @@ var gMenuButtonUpdateBadge = {
}
},
- uninit: function() {
+ uninit() {
if (this.timer)
this.timer.cancel();
if (this.enabled) {
@@ -2709,7 +2709,7 @@ var gMenuButtonUpdateBadge = {
}
},
- onMenuPanelCommand: function(event) {
+ onMenuPanelCommand(event) {
if (event.originalTarget.getAttribute("update-status") === "succeeded") {
// restart the app
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
@@ -2726,7 +2726,7 @@ var gMenuButtonUpdateBadge = {
}
},
- observe: function(subject, topic, status) {
+ observe(subject, topic, status) {
if (topic == "update-canceled") {
this.reset();
return;
@@ -2746,7 +2746,7 @@ var gMenuButtonUpdateBadge = {
// The timer callback will call uninit() when it completes.
},
- notify: function() {
+ notify() {
// If the update is successfully applied, or if the updater has fallen back
// to non-staged updates, add a badge to the hamburger menu to indicate an
// update will be applied once the browser restarts.
@@ -2754,7 +2754,7 @@ var gMenuButtonUpdateBadge = {
this.displayBadge(true);
},
- displayBadge: function(succeeded) {
+ displayBadge(succeeded) {
let status = succeeded ? "succeeded" : "failed";
let badgeStatus = "update-" + status;
gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, badgeStatus);
@@ -2780,7 +2780,7 @@ var gMenuButtonUpdateBadge = {
updateButton.hidden = false;
},
- reset: function() {
+ reset() {
gMenuButtonBadgeManager.removeBadge(
gMenuButtonBadgeManager.BADGEID_APPUPDATE);
let updateButton = document.getElementById("PanelUI-update-status");
@@ -2808,7 +2808,7 @@ const PREF_SSL_IMPACT = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
* us via async messaging.
*/
var BrowserOnClick = {
- init: function() {
+ init() {
let mm = window.messageManager;
mm.addMessageListener("Browser:CertExceptionError", this);
mm.addMessageListener("Browser:OpenCaptivePortalPage", this);
@@ -2825,7 +2825,7 @@ var BrowserOnClick = {
Services.obs.addObserver(this, "captive-portal-login-success", false);
},
- uninit: function() {
+ uninit() {
let mm = window.messageManager;
mm.removeMessageListener("Browser:CertExceptionError", this);
mm.removeMessageListener("Browser:SiteBlockedError", this);
@@ -2841,7 +2841,7 @@ var BrowserOnClick = {
Services.obs.removeObserver(this, "captive-portal-login-success");
},
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "captive-portal-login-abort":
case "captive-portal-login-success":
@@ -2852,7 +2852,7 @@ var BrowserOnClick = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
if (!event.isTrusted || // Don't trust synthetic events
event.button == 2) {
return;
@@ -2870,7 +2870,7 @@ var BrowserOnClick = {
}
},
- receiveMessage: function(msg) {
+ receiveMessage(msg) {
switch (msg.name) {
case "Browser:CertExceptionError":
this.onCertError(msg.target, msg.data.elementId,
@@ -2928,7 +2928,7 @@ var BrowserOnClick = {
}
},
- onSSLErrorReport: function(browser, uri, securityInfo) {
+ onSSLErrorReport(browser, uri, securityInfo) {
if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) {
Cu.reportError("User requested certificate error report sending, but certificate error reporting is disabled");
return;
@@ -2945,7 +2945,7 @@ var BrowserOnClick = {
uri.host, uri.port);
},
- onCertError: function(browser, elementId, isTopFrame, location, securityInfoAsString) {
+ onCertError(browser, elementId, isTopFrame, location, securityInfoAsString) {
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
let securityInfo;
@@ -2959,7 +2959,7 @@ var BrowserOnClick = {
let sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider)
.SSLStatus;
let params = { exceptionAdded : false,
- sslStatus : sslStatus };
+ sslStatus };
try {
switch (Services.prefs.getIntPref("browser.ssl_override_behavior")) {
@@ -3014,7 +3014,7 @@ var BrowserOnClick = {
}
},
- onOpenCaptivePortalPage: function() {
+ onOpenCaptivePortalPage() {
// Open a new tab with the canonical URL that we use to check for a captive portal.
// It will be redirected to the login page.
let canonicalURL = Services.prefs.getCharPref("captivedetect.canonicalURL");
@@ -3036,7 +3036,7 @@ var BrowserOnClick = {
Services.obs.addObserver(tabCloser, "captive-portal-login-success", false);
},
- onAboutBlocked: function(elementId, reason, isTopFrame, location) {
+ onAboutBlocked(elementId, reason, isTopFrame, location) {
// Depending on what page we are displaying here (malware/phishing/unwanted)
// use the right strings and links for each.
let bucketName = "";
@@ -3091,7 +3091,7 @@ var BrowserOnClick = {
* the next page also in the parent) and instructs the browser to open the url
* in the current tab which will make it update the remoteness of the tab.
*/
- onE10sAboutNewTab: function(event, ownerDoc) {
+ onE10sAboutNewTab(event, ownerDoc) {
let isTopFrame = (ownerDoc.defaultView.parent === ownerDoc.defaultView);
if (!isTopFrame) {
return;
@@ -3107,7 +3107,7 @@ var BrowserOnClick = {
}
},
- ignoreWarningButton: function(reason) {
+ ignoreWarningButton(reason) {
// Allow users to override and continue through to the site,
// but add a notify bar as a reminder, so that they don't lose
// track after, e.g., tab switching.
@@ -3122,7 +3122,7 @@ var BrowserOnClick = {
let buttons = [{
label: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.accessKey"),
- callback: function() { getMeOutOfHere(); }
+ callback() { getMeOutOfHere(); }
}];
let title;
@@ -3131,7 +3131,7 @@ var BrowserOnClick = {
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"),
- callback: function() {
+ callback() {
openUILinkIn(gSafeBrowsing.getReportURL('MalwareMistake'), 'tab');
}
};
@@ -3140,7 +3140,7 @@ var BrowserOnClick = {
buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"),
- callback: function() {
+ callback() {
openUILinkIn(gSafeBrowsing.getReportURL('PhishMistake'), 'tab');
}
};
@@ -3374,7 +3374,7 @@ var PrintPreviewListener = {
_tabBeforePrintPreview: null,
_simplifyPageTab: null,
- getPrintPreviewBrowser: function() {
+ getPrintPreviewBrowser() {
if (!this._printPreviewTab) {
let browser = gBrowser.selectedTab.linkedBrowser;
let preferredRemoteType = browser.remoteType;
@@ -3387,23 +3387,23 @@ var PrintPreviewListener = {
}
return gBrowser.getBrowserForTab(this._printPreviewTab);
},
- createSimplifiedBrowser: function() {
+ createSimplifiedBrowser() {
this._simplifyPageTab = gBrowser.loadOneTab("about:blank",
{ inBackground: true });
return this.getSimplifiedSourceBrowser();
},
- getSourceBrowser: function() {
+ getSourceBrowser() {
return this._tabBeforePrintPreview ?
this._tabBeforePrintPreview.linkedBrowser : gBrowser.selectedBrowser;
},
- getSimplifiedSourceBrowser: function() {
+ getSimplifiedSourceBrowser() {
return this._simplifyPageTab ?
gBrowser.getBrowserForTab(this._simplifyPageTab) : null;
},
- getNavToolbox: function() {
+ getNavToolbox() {
return gNavToolbox;
},
- onEnter: function() {
+ onEnter() {
// We might have accidentally switched tabs since the user invoked print
// preview
if (gBrowser.selectedTab != this._printPreviewTab) {
@@ -3412,7 +3412,7 @@ var PrintPreviewListener = {
gInPrintPreviewMode = true;
this._toggleAffectedChrome();
},
- onExit: function() {
+ onExit() {
gBrowser.selectedTab = this._tabBeforePrintPreview;
this._tabBeforePrintPreview = null;
gInPrintPreviewMode = false;
@@ -3425,7 +3425,7 @@ var PrintPreviewListener = {
gBrowser.deactivatePrintPreviewBrowsers();
this._printPreviewTab = null;
},
- _toggleAffectedChrome: function() {
+ _toggleAffectedChrome() {
gNavToolbox.collapsed = gInPrintPreviewMode;
if (gInPrintPreviewMode)
@@ -3435,7 +3435,7 @@ var PrintPreviewListener = {
TabsInTitlebar.allowedBy("print-preview", !gInPrintPreviewMode);
},
- _hideChrome: function() {
+ _hideChrome() {
this._chromeState = {};
this._chromeState.sidebarOpen = SidebarUI.isOpen;
@@ -3463,7 +3463,7 @@ var PrintPreviewListener = {
syncNotifications.notificationsHidden = true;
}
},
- _showChrome: function() {
+ _showChrome() {
if (this._chromeState.notificationsOpen)
gBrowser.getNotificationBox().notificationsHidden = false;
@@ -3499,20 +3499,20 @@ function FillInHTMLTooltip(tipElement)
var browserDragAndDrop = {
canDropLink: aEvent => Services.droppedLinkHandler.canDropLink(aEvent, true),
- dragOver: function(aEvent)
+ dragOver(aEvent)
{
if (this.canDropLink(aEvent)) {
aEvent.preventDefault();
}
},
- dropLinks: function(aEvent, aDisallowInherit) {
+ dropLinks(aEvent, aDisallowInherit) {
return Services.droppedLinkHandler.dropLinks(aEvent, aDisallowInherit);
}
};
var homeButtonObserver = {
- onDrop: function(aEvent)
+ onDrop(aEvent)
{
// disallow setting home pages that inherit the principal
let links = browserDragAndDrop.dropLinks(aEvent, true);
@@ -3521,7 +3521,7 @@ var homeButtonObserver = {
}
},
- onDragOver: function(aEvent)
+ onDragOver(aEvent)
{
if (gPrefService.prefIsLocked("browser.startup.homepage")) {
return;
@@ -3529,7 +3529,7 @@ var homeButtonObserver = {
browserDragAndDrop.dragOver(aEvent);
aEvent.dropEffect = "link";
},
- onDragExit: function(aEvent)
+ onDragExit(aEvent)
{
}
}
@@ -3596,14 +3596,14 @@ var newWindowButtonObserver = {
}
const DOMLinkHandler = {
- init: function() {
+ init() {
let mm = window.messageManager;
mm.addMessageListener("Link:AddFeed", this);
mm.addMessageListener("Link:SetIcon", this);
mm.addMessageListener("Link:AddSearch", this);
},
- receiveMessage: function(aMsg) {
+ receiveMessage(aMsg) {
switch (aMsg.name) {
case "Link:AddFeed":
let link = {type: aMsg.data.type, href: aMsg.data.href, title: aMsg.data.title};
@@ -3620,7 +3620,7 @@ const DOMLinkHandler = {
}
},
- setIcon: function(aBrowser, aURL, aLoadingPrincipal) {
+ setIcon(aBrowser, aURL, aLoadingPrincipal) {
if (gBrowser.isFailedIcon(aURL))
return false;
@@ -3632,7 +3632,7 @@ const DOMLinkHandler = {
return true;
},
- addSearch: function(aBrowser, aEngine, aURL) {
+ addSearch(aBrowser, aEngine, aURL) {
let tab = gBrowser.getTabForBrowser(aBrowser);
if (!tab)
return;
@@ -3642,7 +3642,7 @@ const DOMLinkHandler = {
}
const BrowserSearch = {
- addEngine: function(browser, engine, uri) {
+ addEngine(browser, engine, uri) {
// Check to see whether we've already added an engine with this title
if (browser.engines) {
if (browser.engines.some(e => e.title == engine.title))
@@ -3678,7 +3678,7 @@ const BrowserSearch = {
* available when a page is loaded or the user switches tabs to a page that
* has search engines.
*/
- updateOpenSearchBadge: function() {
+ updateOpenSearchBadge() {
var searchBar = this.searchBar;
if (!searchBar)
return;
@@ -3770,7 +3770,7 @@ const BrowserSearch = {
* @return engine The search engine used to perform a search, or null if no
* search was performed.
*/
- _loadSearch: function(searchText, useNewTab, purpose) {
+ _loadSearch(searchText, useNewTab, purpose) {
let engine;
// If the search bar is visible, use the current engine, otherwise, fall
@@ -3794,7 +3794,7 @@ const BrowserSearch = {
openLinkIn(submission.uri.spec,
useNewTab ? "tab" : "current",
{ postData: submission.postData,
- inBackground: inBackground,
+ inBackground,
relatedToCurrent: true });
return engine;
@@ -3820,14 +3820,14 @@ const BrowserSearch = {
* This should only be called from the context menu. See
* BrowserSearch.loadSearch for the preferred API.
*/
- loadSearchFromContext: function(terms) {
+ loadSearchFromContext(terms) {
let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
if (engine) {
BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
}
},
- pasteAndSearch: function(event) {
+ pasteAndSearch(event) {
BrowserSearch.searchBar.select();
goDoCommand("cmd_paste");
BrowserSearch.searchBar.handleSearchCommand(event);
@@ -3850,7 +3850,7 @@ const BrowserSearch = {
openUILinkIn(this.searchEnginesURL, where);
},
- _getSearchEngineId: function(engine) {
+ _getSearchEngineId(engine) {
if (engine && engine.identifier) {
return engine.identifier;
}
@@ -3879,7 +3879,7 @@ const BrowserSearch = {
* indicates where the item was in the suggestion list and how the user
* selected it: {selection: {index: The selected index, kind: "key" or "mouse"}}
*/
- recordSearchInTelemetry: function(engine, source, details = {}) {
+ recordSearchInTelemetry(engine, source, details = {}) {
BrowserUITelemetry.countSearchEvent(source, null, details.selection);
try {
BrowserUsageTelemetry.recordSearch(engine, source, details);
@@ -3903,7 +3903,7 @@ const BrowserSearch = {
* @param where
* (string) Where was the search link opened (e.g. new tab, current tab, ..).
*/
- recordOneoffSearchInTelemetry: function(engine, source, type, where) {
+ recordOneoffSearchInTelemetry(engine, source, type, where) {
let id = this._getSearchEngineId(engine) + "." + source;
BrowserUITelemetry.countOneoffSearchEvent(id, type, where);
try {
@@ -4295,7 +4295,7 @@ var XULBrowserWindow = {
// Left here for add-on compatibility, see bug 752434
inContentWhitelist: [],
- QueryInterface: function(aIID) {
+ QueryInterface(aIID) {
if (aIID.equals(Ci.nsIWebProgressListener) ||
aIID.equals(Ci.nsIWebProgressListener2) ||
aIID.equals(Ci.nsISupportsWeakReference) ||
@@ -4325,34 +4325,34 @@ var XULBrowserWindow = {
return this.canViewSource = document.getElementById("canViewSource");
},
- init: function() {
+ init() {
// Initialize the security button's state and tooltip text.
var securityUI = gBrowser.securityUI;
this.onSecurityChange(null, null, securityUI.state, true);
},
- setJSStatus: function() {
+ setJSStatus() {
// unsupported
},
- forceInitialBrowserRemote: function(aRemoteType) {
+ forceInitialBrowserRemote(aRemoteType) {
let initBrowser =
document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
gBrowser.updateBrowserRemoteness(initBrowser, true, { remoteType: aRemoteType });
},
- forceInitialBrowserNonRemote: function(aOpener) {
+ forceInitialBrowserNonRemote(aOpener) {
let initBrowser =
document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
gBrowser.updateBrowserRemoteness(initBrowser, false, { opener: aOpener });
},
- setDefaultStatus: function(status) {
+ setDefaultStatus(status) {
this.defaultStatus = status;
this.updateStatusField();
},
- setOverLink: function(url, anchorElt) {
+ setOverLink(url, anchorElt) {
// Encode bidirectional formatting characters.
// (RFC 3987 sections 3.2 and 4.1 paragraph 6)
url = url.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
@@ -4365,7 +4365,7 @@ var XULBrowserWindow = {
LinkTargetDisplay.update();
},
- showTooltip: function(x, y, tooltip, direction) {
+ showTooltip(x, y, tooltip, direction) {
if (Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).
getCurrentSession()) {
return;
@@ -4381,16 +4381,16 @@ var XULBrowserWindow = {
elt.openPopupAtScreen(anchor.boxObject.screenX + x, anchor.boxObject.screenY + y, false, null);
},
- hideTooltip: function() {
+ hideTooltip() {
let elt = document.getElementById("remoteBrowserTooltip");
elt.hidePopup();
},
- getTabCount: function() {
+ getTabCount() {
return gBrowser.tabs.length;
},
- updateStatusField: function() {
+ updateStatusField() {
var text, type, types = ["overLink"];
if (this._busyUI)
types.push("status");
@@ -4414,14 +4414,14 @@ var XULBrowserWindow = {
},
// Called before links are navigated to to allow us to retarget them if needed.
- onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
+ onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
let target = BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
SocialUI.closeSocialPanelForLinkTraversal(target, linkNode);
return target;
},
// Check whether this URI should load in the current process
- shouldLoadURI: function(aDocShell, aURI, aReferrer) {
+ shouldLoadURI(aDocShell, aURI, aReferrer) {
if (!gMultiProcessBrowser)
return true;
@@ -4442,13 +4442,13 @@ var XULBrowserWindow = {
return true;
},
- onProgressChange: function(aWebProgress, aRequest,
+ onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress) {
// Do nothing.
},
- onProgressChange64: function(aWebProgress, aRequest,
+ onProgressChange64(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress) {
return this.onProgressChange(aWebProgress, aRequest,
@@ -4457,7 +4457,7 @@ var XULBrowserWindow = {
},
// This function fires only for the currently selected tab.
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
+ onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
const nsIWebProgressListener = Ci.nsIWebProgressListener;
const nsIChannel = Ci.nsIChannel;
@@ -4541,7 +4541,7 @@ var XULBrowserWindow = {
}
},
- onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
+ onLocationChange(aWebProgress, aRequest, aLocationURI, aFlags) {
var location = aLocationURI ? aLocationURI.spec : "";
// If displayed, hide the form validation popup.
@@ -4685,15 +4685,15 @@ var XULBrowserWindow = {
}
},
- asyncUpdateUI: function() {
+ asyncUpdateUI() {
FeedHandler.updateFeeds();
BrowserSearch.updateOpenSearchBadge();
},
// Left here for add-on compatibility, see bug 752434
- hideChromeForLocation: function() {},
+ hideChromeForLocation() {},
- onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
+ onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {
this.status = aMessage;
this.updateStatusField();
},
@@ -4708,7 +4708,7 @@ var XULBrowserWindow = {
// 3. Called directly during this object's initializations.
// aRequest will be null always in case 2 and 3, and sometimes in case 1 (for
// instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed).
- onSecurityChange: function(aWebProgress, aRequest, aState, aIsSimulated) {
+ onSecurityChange(aWebProgress, aRequest, aState, aIsSimulated) {
// Don't need to do anything if the data we use to update the UI hasn't
// changed
let uri = gBrowser.currentURI;
@@ -4780,7 +4780,7 @@ var LinkTargetDisplay = {
return XULBrowserWindow.statusTextField.label != "";
},
- update: function() {
+ update() {
clearTimeout(this._timer);
window.removeEventListener("mousemove", this, true);
@@ -4801,7 +4801,7 @@ var LinkTargetDisplay = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "mousemove":
// Restart the delay since the mouse was moved
@@ -4811,14 +4811,14 @@ var LinkTargetDisplay = {
}
},
- _showDelayed: function() {
+ _showDelayed() {
this._timer = setTimeout(function(self) {
XULBrowserWindow.updateStatusField();
window.removeEventListener("mousemove", self, true);
}, this.DELAY_SHOW, this);
},
- _hide: function() {
+ _hide() {
clearTimeout(this._timer);
XULBrowserWindow.updateStatusField();
@@ -4826,7 +4826,7 @@ var LinkTargetDisplay = {
};
var CombinedStopReload = {
- init: function() {
+ init() {
if (this._initialized)
return;
@@ -4843,7 +4843,7 @@ var CombinedStopReload = {
this.stop = stop;
},
- uninit: function() {
+ uninit() {
if (!this._initialized)
return;
@@ -4854,14 +4854,14 @@ var CombinedStopReload = {
this.stop = null;
},
- handleEvent: function(event) {
+ handleEvent(event) {
// the only event we listen to is "click" on the stop button
if (event.button == 0 &&
!this.stop.disabled)
this._stopClicked = true;
},
- switchToStop: function() {
+ switchToStop() {
if (!this._initialized)
return;
@@ -4869,7 +4869,7 @@ var CombinedStopReload = {
this.reload.setAttribute("displaystop", "true");
},
- switchToReload: function(aDelay) {
+ switchToReload(aDelay) {
if (!this._initialized)
return;
@@ -4896,7 +4896,7 @@ var CombinedStopReload = {
}, 650, this);
},
- _cancelTransition: function() {
+ _cancelTransition() {
if (this._timer) {
clearTimeout(this._timer);
this._timer = 0;
@@ -4909,7 +4909,7 @@ var TabsProgressListener = {
// we won't see STATE_START events for pre-rendered tabs.
_startedLoadTimer: new WeakSet(),
- onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+ onStateChange(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) {
@@ -4963,7 +4963,7 @@ var TabsProgressListener = {
}
},
- onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
+ onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI,
aFlags) {
// Filter out location changes caused by anchor navigation
// or history.push/pop/replaceState.
@@ -5001,7 +5001,7 @@ function nsBrowserAccess() { }
nsBrowserAccess.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]),
- _openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
+ _openURIInNewTab(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
aIsExternal, aForceNotRemote = false,
aUserContextId = Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
aOpener = null) {
@@ -5045,7 +5045,7 @@ nsBrowserAccess.prototype = {
return browser;
},
- openURI: function(aURI, aOpener, aWhere, aFlags) {
+ openURI(aURI, aOpener, aWhere, aFlags) {
// This function should only ever be called if we're opening a URI
// from a non-remote browser window (via nsContentTreeOwner).
if (aOpener && Cu.isCrossProcessWrapper(aOpener)) {
@@ -5126,7 +5126,7 @@ nsBrowserAccess.prototype = {
gBrowser.loadURIWithFlags(aURI.spec, {
flags: loadflags,
referrerURI: referrer,
- referrerPolicy: referrerPolicy,
+ referrerPolicy,
});
}
if (!gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground"))
@@ -5160,7 +5160,7 @@ nsBrowserAccess.prototype = {
return null;
},
- isTabContentWindow: function(aWindow) {
+ isTabContentWindow(aWindow) {
return gBrowser.browsers.some(browser => browser.contentWindow == aWindow);
},
@@ -5376,7 +5376,7 @@ function displaySecurityInfo()
var gHomeButton = {
prefDomain: "browser.startup.homepage",
- observe: function(aSubject, aTopic, aPrefName)
+ observe(aSubject, aTopic, aPrefName)
{
if (aTopic != "nsPref:changed" || aPrefName != this.prefDomain)
return;
@@ -5384,7 +5384,7 @@ var gHomeButton = {
this.updateTooltip();
},
- updateTooltip: function(homeButton)
+ updateTooltip(homeButton)
{
if (!homeButton)
homeButton = document.getElementById("home-button");
@@ -5398,7 +5398,7 @@ var gHomeButton = {
}
},
- getHomePage: function()
+ getHomePage()
{
var url;
try {
@@ -5703,8 +5703,8 @@ function handleLinkClick(event, href, linkNode) {
let params = {
charset: doc.characterSet,
allowMixedContent: persistAllowMixedContentInChildTab,
- referrerURI: referrerURI,
- referrerPolicy: referrerPolicy,
+ referrerURI,
+ referrerPolicy,
noReferrer: BrowserUtils.linkHasNoReferrer(linkNode),
originPrincipal: doc.nodePrincipal,
};
@@ -5884,7 +5884,7 @@ var gPageStyleMenu = {
//
_pageStyleSheets: new WeakMap(),
- init: function() {
+ init() {
let mm = window.messageManager;
mm.addMessageListener("PageStyle:StyleSheets", (msg) => {
this._pageStyleSheets.set(msg.target.permanentKey, msg.data);
@@ -5904,7 +5904,7 @@ var gPageStyleMenu = {
* See the documentation for gPageStyleMenu for a description
* of the Object structure.
*/
- getBrowserStyleSheets: function(browser) {
+ getBrowserStyleSheets(browser) {
if (!browser) {
browser = gBrowser.selectedBrowser;
}
@@ -5916,7 +5916,7 @@ var gPageStyleMenu = {
return data.filteredStyleSheets;
},
- _getStyleSheetInfo: function(browser) {
+ _getStyleSheetInfo(browser) {
let data = this._pageStyleSheets.get(browser.permanentKey);
if (!data) {
return {
@@ -5929,7 +5929,7 @@ var gPageStyleMenu = {
return data;
},
- fillPopup: function(menuPopup) {
+ fillPopup(menuPopup) {
let styleSheetInfo = this._getStyleSheetInfo(gBrowser.selectedBrowser);
var noStyle = menuPopup.firstChild;
var persistentOnly = noStyle.nextSibling;
@@ -5973,12 +5973,12 @@ var gPageStyleMenu = {
sep.hidden = (noStyle.hidden && persistentOnly.hidden) || !haveAltSheets;
},
- switchStyleSheet: function(title) {
+ switchStyleSheet(title) {
let mm = gBrowser.selectedBrowser.messageManager;
- mm.sendAsyncMessage("PageStyle:Switch", {title: title});
+ mm.sendAsyncMessage("PageStyle:Switch", {title});
},
- disableStyle: function() {
+ disableStyle() {
let mm = gBrowser.selectedBrowser.messageManager;
mm.sendAsyncMessage("PageStyle:Disable");
},
@@ -5999,7 +5999,7 @@ function setStyleDisabled(disabled) {
var LanguageDetectionListener = {
- init: function() {
+ init() {
window.messageManager.addMessageListener("Translation:DocumentState", msg => {
Translation.documentStateReceived(msg.target, msg.data);
});
@@ -6011,7 +6011,7 @@ var BrowserOffline = {
_inited: false,
// BrowserOffline Public Methods
- init: function()
+ init()
{
if (!this._uiElement)
this._uiElement = document.getElementById("workOfflineMenuitemState");
@@ -6023,14 +6023,14 @@ var BrowserOffline = {
this._inited = true;
},
- uninit: function()
+ uninit()
{
if (this._inited) {
Services.obs.removeObserver(this, "network:offline-status-changed");
}
},
- toggleOfflineStatus: function()
+ toggleOfflineStatus()
{
var ioService = Services.io;
@@ -6043,7 +6043,7 @@ var BrowserOffline = {
},
// nsIObserver
- observe: function(aSubject, aTopic, aState)
+ observe(aSubject, aTopic, aState)
{
if (aTopic != "network:offline-status-changed")
return;
@@ -6054,7 +6054,7 @@ var BrowserOffline = {
},
// BrowserOffline Implementation Methods
- _canGoOffline: function()
+ _canGoOffline()
{
try {
var cancelGoOffline = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
@@ -6071,7 +6071,7 @@ var BrowserOffline = {
},
_uiElement: null,
- _updateOfflineUI: function(aOffline)
+ _updateOfflineUI(aOffline)
{
var offlineLocked = gPrefService.prefIsLocked("network.online");
if (offlineLocked)
@@ -6165,7 +6165,7 @@ var OfflineApps = {
let mainAction = {
label: gNavigatorBundle.getString("offlineApps.allowStoring.label"),
accessKey: gNavigatorBundle.getString("offlineApps.allowStoring.accesskey"),
- callback: function() {
+ callback() {
for (let [ciBrowser, ciDocId, ciUri] of notification.options.controlledItems) {
OfflineApps.allowSite(ciBrowser, ciDocId, ciUri);
}
@@ -6174,7 +6174,7 @@ var OfflineApps = {
let secondaryActions = [{
label: gNavigatorBundle.getString("offlineApps.dontAllow.label"),
accessKey: gNavigatorBundle.getString("offlineApps.dontAllow.accesskey"),
- callback: function() {
+ callback() {
for (let [, , ciUri] of notification.options.controlledItems) {
OfflineApps.disallowSite(ciUri);
}
@@ -6283,7 +6283,7 @@ var IndexedDBPromptHelper = {
var mainAction = {
label: gNavigatorBundle.getString("offlineApps.allowStoring.label"),
accessKey: gNavigatorBundle.getString("offlineApps.allowStoring.accesskey"),
- callback: function() {
+ callback() {
observer.observe(null, responseTopic,
Ci.nsIPermissionManager.ALLOW_ACTION);
}
@@ -6293,7 +6293,7 @@ var IndexedDBPromptHelper = {
{
label: gNavigatorBundle.getString("offlineApps.dontAllow.label"),
accessKey: gNavigatorBundle.getString("offlineApps.dontAllow.accesskey"),
- callback: function() {
+ callback() {
observer.observe(null, responseTopic,
Ci.nsIPermissionManager.DENY_ACTION);
}
@@ -6414,11 +6414,11 @@ function warnAboutClosingWindow() {
}
var MailIntegration = {
- sendLinkForBrowser: function(aBrowser) {
+ sendLinkForBrowser(aBrowser) {
this.sendMessage(aBrowser.currentURI.spec, aBrowser.contentTitle);
},
- sendMessage: function(aBody, aSubject) {
+ sendMessage(aBody, aSubject) {
// generate a mailto url based on the url and the url's title
var mailtoUrl = "mailto:";
if (aBody) {
@@ -6435,7 +6435,7 @@ var MailIntegration = {
// a generic method which can be used to pass arbitrary urls to the operating
// system.
// aURL --> a nsIURI which represents the url to launch
- _launchExternalUrl: function(aURL) {
+ _launchExternalUrl(aURL) {
var extProtocolSvc =
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService);
@@ -6504,7 +6504,7 @@ function AddKeywordForSearchField() {
PlacesUIUtils.showBookmarkDialog({ action: "add"
, type: "bookmark"
, uri: makeURI(bookmarkData.spec)
- , title: title
+ , title
, description: bookmarkData.description
, keyword: ""
, postData: bookmarkData.postData
@@ -6840,7 +6840,7 @@ var gIdentityHandler = {
* Handler for mouseclicks on the "More Information" button in the
* "identity-popup" panel.
*/
- handleMoreInfoClick : function(event) {
+ handleMoreInfoClick(event) {
displaySecurityInfo();
event.stopPropagation();
this._identityPopup.hidePopup();
@@ -6898,7 +6898,7 @@ var gIdentityHandler = {
* Helper to parse out the important parts of _sslStatus (of the SSL cert in
* particular) for use in constructing identity UI strings
*/
- getIdentityData : function() {
+ getIdentityData() {
var result = {};
var cert = this._sslStatus.serverCert;
@@ -6999,7 +6999,7 @@ var gIdentityHandler = {
/**
* Attempt to provide proper IDN treatment for host names
*/
- getEffectiveHost: function() {
+ getEffectiveHost() {
if (!this._IDNService)
this._IDNService = Cc["@mozilla.org/network/idn-service;1"]
.getService(Ci.nsIIDNService);
@@ -7179,7 +7179,7 @@ var gIdentityHandler = {
let buttons = [{
label: gNavigatorBundle.getString("revokeOverride.label"),
accessKey: gNavigatorBundle.getString("revokeOverride.accesskey"),
- callback: function(aNotification, aButton) {
+ callback(aNotification, aButton) {
try {
let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"]
.getService(Ci.nsIWeakCryptoOverride);
@@ -7369,7 +7369,7 @@ var gIdentityHandler = {
/**
* Click handler for the identity-box element in primary chrome.
*/
- handleIdentityButtonEvent : function(event) {
+ handleIdentityButtonEvent(event) {
event.stopPropagation();
if ((event.type == "click" && event.button != 0) ||
@@ -7430,7 +7430,7 @@ var gIdentityHandler = {
}
},
- onDragStart: function(event) {
+ onDragStart(event) {
if (gURLBar.getAttribute("pageproxystate") != "valid")
return;
@@ -7446,12 +7446,12 @@ var gIdentityHandler = {
dt.setDragImage(this._identityIcon, 16, 16);
},
- onLocationChange: function() {
+ onLocationChange() {
this._permissionJustRemoved = false;
this.updatePermissionHint();
},
- updatePermissionHint: function() {
+ updatePermissionHint() {
if (!this._permissionList.hasChildNodes() && !this._permissionJustRemoved) {
this._permissionEmptyHint.removeAttribute("hidden");
} else {
@@ -7465,7 +7465,7 @@ var gIdentityHandler = {
}
},
- updateSitePermissions: function() {
+ updateSitePermissions() {
while (this._permissionList.hasChildNodes())
this._permissionList.removeChild(this._permissionList.lastChild);
@@ -7504,7 +7504,7 @@ var gIdentityHandler = {
this.updatePermissionHint();
},
- _handleHeightChange: function(aFunction, aWillShowReloadHint) {
+ _handleHeightChange(aFunction, aWillShowReloadHint) {
let heightBefore = getComputedStyle(this._permissionList).height;
aFunction();
let heightAfter = getComputedStyle(this._permissionList).height;
@@ -7518,7 +7518,7 @@ var gIdentityHandler = {
this._identityPopupMultiView.setHeightToFit(heightChange);
},
- _createPermissionItem: function(aPermission) {
+ _createPermissionItem(aPermission) {
let container = document.createElement("hbox");
container.setAttribute("class", "identity-popup-permission-item");
container.setAttribute("align", "center");
@@ -7681,7 +7681,7 @@ var gPrivateBrowsingUI = {
};
var gRemoteTabsUI = {
- init: function() {
+ init() {
if (window.location.href != getBrowserURL() &&
// Also check hidden window for the Mac no-window case
window.location.href != "chrome://browser/content/hiddenWindow.xul") {
@@ -7828,7 +7828,7 @@ function switchToTabHavingURI(aURI, aOpenNew, aOpenParams = {}) {
}
var RestoreLastSessionObserver = {
- init: function() {
+ init() {
if (SessionStore.canRestoreLastSession &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
Services.obs.addObserver(this, "sessionstore-last-session-cleared", true);
@@ -7836,7 +7836,7 @@ var RestoreLastSessionObserver = {
}
},
- observe: function() {
+ observe() {
// The last session can only be restored once so there's
// no way we need to re-enable our menu item.
Services.obs.removeObserver(this, "sessionstore-last-session-cleared");
@@ -8047,7 +8047,7 @@ var MousePosTracker = {
return this._windowUtils = window.getInterface(Ci.nsIDOMWindowUtils);
},
- addListener: function(listener) {
+ addListener(listener) {
if (this._listeners.has(listener))
return;
@@ -8057,11 +8057,11 @@ var MousePosTracker = {
this._callListener(listener);
},
- removeListener: function(listener) {
+ removeListener(listener) {
this._listeners.delete(listener);
},
- handleEvent: function(event) {
+ handleEvent(event) {
var fullZoom = this._windowUtils.fullZoom;
this._x = event.screenX / fullZoom - window.mozInnerScreenX;
this._y = event.screenY / fullZoom - window.mozInnerScreenY;
@@ -8075,7 +8075,7 @@ var MousePosTracker = {
}, this);
},
- _callListener: function(listener) {
+ _callListener(listener) {
let rect = listener.getMouseTargetRect();
let hover = this._x >= rect.left &&
this._x <= rect.right &&
@@ -8097,7 +8097,7 @@ var MousePosTracker = {
};
var ToolbarIconColor = {
- init: function() {
+ init() {
this._initialized = true;
window.addEventListener("activate", this);
@@ -8111,7 +8111,7 @@ var ToolbarIconColor = {
this.inferFromText();
},
- uninit: function() {
+ uninit() {
this._initialized = false;
window.removeEventListener("activate", this);
@@ -8119,7 +8119,7 @@ var ToolbarIconColor = {
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "activate":
case "deactivate":
@@ -8128,7 +8128,7 @@ var ToolbarIconColor = {
}
},
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "lightweight-theme-styling-update":
// inferFromText needs to run after LightweightThemeConsumer.jsm's
@@ -8138,7 +8138,7 @@ var ToolbarIconColor = {
}
},
- inferFromText: function() {
+ inferFromText() {
if (!this._initialized)
return;
@@ -8172,14 +8172,14 @@ var ToolbarIconColor = {
}
var PanicButtonNotifier = {
- init: function() {
+ init() {
this._initialized = true;
if (window.PanicButtonNotifierShouldNotify) {
delete window.PanicButtonNotifierShouldNotify;
this.notify();
}
},
- notify: function() {
+ notify() {
if (!this._initialized) {
window.PanicButtonNotifierShouldNotify = true;
return;
@@ -8196,14 +8196,14 @@ var PanicButtonNotifier = {
Cu.reportError(ex);
}
},
- close: function() {
+ close() {
let popup = document.getElementById("panic-button-success-notification");
popup.hidePopup();
},
};
var AboutPrivateBrowsingListener = {
- init: function() {
+ init() {
window.messageManager.addMessageListener(
"AboutPrivateBrowsing:OpenPrivateWindow",
msg => {
diff --git a/browser/base/content/content.js b/browser/base/content/content.js
index c5e1c0ec1451..837cd5863b80 100644
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -103,8 +103,8 @@ var handleContentContextMenu = function(event) {
let addonInfo = {};
let subject = {
- event: event,
- addonInfo: addonInfo,
+ event,
+ addonInfo,
};
subject.wrappedJSObject = subject;
Services.obs.notifyObservers(subject, "content-contextmenu", null);
@@ -197,18 +197,18 @@ var handleContentContextMenu = function(event) {
let mainWin = browser.ownerGlobal;
mainWin.gContextMenuContentData = {
isRemote: false,
- event: event,
+ event,
popupNode: event.target,
- browser: browser,
- addonInfo: addonInfo,
+ browser,
+ addonInfo,
documentURIObject: doc.documentURIObject,
- docLocation: docLocation,
- charSet: charSet,
- referrer: referrer,
- referrerPolicy: referrerPolicy,
- contentType: contentType,
- contentDisposition: contentDisposition,
- selectionInfo: selectionInfo,
+ docLocation,
+ charSet,
+ referrer,
+ referrerPolicy,
+ contentType,
+ contentDisposition,
+ selectionInfo,
disableSetDesktopBackground: disableSetDesktopBg,
loginFillInfo,
parentAllowsMixedContent,
@@ -262,7 +262,7 @@ function getSerializedSecurityInfo(docShell) {
}
var AboutNetAndCertErrorListener = {
- init: function(chromeGlobal) {
+ init(chromeGlobal) {
addMessageListener("CertErrorDetails", this);
addMessageListener("Browser:CaptivePortalFreed", this);
chromeGlobal.addEventListener('AboutNetErrorLoad', this, false, true);
@@ -280,7 +280,7 @@ var AboutNetAndCertErrorListener = {
return content.document.documentURI.startsWith("about:certerror");
},
- receiveMessage: function(msg) {
+ receiveMessage(msg) {
if (!this.isAboutCertError) {
return;
}
@@ -348,7 +348,7 @@ var AboutNetAndCertErrorListener = {
content.dispatchEvent(new content.CustomEvent("AboutNetErrorCaptivePortalFreed"));
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (!this.isAboutNetError && !this.isAboutCertError) {
return;
}
@@ -372,7 +372,7 @@ var AboutNetAndCertErrorListener = {
}
},
- changedCertPrefs: function() {
+ changedCertPrefs() {
for (let prefName of PREF_SSL_IMPACT) {
if (Services.prefs.prefHasUserValue(prefName)) {
return true;
@@ -382,7 +382,7 @@ var AboutNetAndCertErrorListener = {
return false;
},
- onPageLoad: function(evt) {
+ onPageLoad(evt) {
if (this.isAboutCertError) {
let originalTarget = evt.originalTarget;
let ownerDoc = originalTarget.ownerDocument;
@@ -394,7 +394,7 @@ var AboutNetAndCertErrorListener = {
detail: JSON.stringify({
enabled: Services.prefs.getBoolPref("security.ssl.errorReporting.enabled"),
changedCertPrefs: this.changedCertPrefs(),
- automatic: automatic
+ automatic
})
}));
@@ -402,16 +402,16 @@ var AboutNetAndCertErrorListener = {
{reportStatus: TLS_ERROR_REPORT_TELEMETRY_UI_SHOWN});
},
- openCaptivePortalPage: function(evt) {
+ openCaptivePortalPage(evt) {
sendAsyncMessage("Browser:OpenCaptivePortalPage");
},
- onResetPreferences: function(evt) {
+ onResetPreferences(evt) {
sendAsyncMessage("Browser:ResetSSLPreferences");
},
- onSetAutomatic: function(evt) {
+ onSetAutomatic(evt) {
sendAsyncMessage("Browser:SetSSLErrorReportAuto", {
automatic: evt.detail
});
@@ -427,7 +427,7 @@ var AboutNetAndCertErrorListener = {
}
},
- onOverride: function(evt) {
+ onOverride(evt) {
let {host, port} = content.document.mozDocumentURIIfNotForErrorPages;
sendAsyncMessage("Browser:OverrideWeakCrypto", { uri: {host, port} });
}
@@ -443,7 +443,7 @@ var ClickEventHandler = {
.addSystemEventListener(global, "click", this, true);
},
- handleEvent: function(event) {
+ handleEvent(event) {
if (!event.isTrusted || event.defaultPrevented || event.button == 2) {
return;
}
@@ -484,7 +484,7 @@ var ClickEventHandler = {
let json = { button: event.button, shiftKey: event.shiftKey,
ctrlKey: event.ctrlKey, metaKey: event.metaKey,
altKey: event.altKey, href: null, title: null,
- bookmark: false, referrerPolicy: referrerPolicy,
+ bookmark: false, referrerPolicy,
originAttributes: principal ? principal.originAttributes : {},
isContentWindowPrivate: PrivateBrowsingUtils.isContentWindowPrivate(ownerDoc.defaultView)};
@@ -535,7 +535,7 @@ var ClickEventHandler = {
}
},
- onCertError: function(targetElement, ownerDoc) {
+ onCertError(targetElement, ownerDoc) {
let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
@@ -547,7 +547,7 @@ var ClickEventHandler = {
});
},
- onAboutBlocked: function(targetElement, ownerDoc) {
+ onAboutBlocked(targetElement, ownerDoc) {
var reason = 'phishing';
if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
reason = 'malware';
@@ -556,13 +556,13 @@ var ClickEventHandler = {
}
sendAsyncMessage("Browser:SiteBlockedError", {
location: ownerDoc.location.href,
- reason: reason,
+ reason,
elementId: targetElement.getAttribute("id"),
isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView)
});
},
- onAboutNetError: function(event, documentURI) {
+ onAboutNetError(event, documentURI) {
let elmId = event.originalTarget.getAttribute("id");
if (elmId == "returnButton") {
sendAsyncMessage("Browser:SSLErrorGoBack", {});
@@ -591,7 +591,7 @@ var ClickEventHandler = {
* element. This includes SVG links, because callers expect |node|
* to behave like an element, which SVG links (XLink) don't.
*/
- _hrefAndLinkNodeForClickEvent: function(event) {
+ _hrefAndLinkNodeForClickEvent(event) {
function isHTMLLink(aNode) {
// Be consistent with what nsContextMenu.js does.
return ((aNode instanceof content.HTMLAnchorElement && aNode.href) ||
@@ -656,7 +656,7 @@ addMessageListener("webrtc:StartBrowserSharing", () => {
let windowID = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
sendAsyncMessage("webrtc:response:StartBrowserSharing", {
- windowID: windowID
+ windowID
});
});
@@ -876,20 +876,20 @@ addMessageListener("Bookmarks:GetPageDetails", (message) => {
let doc = content.document;
let isErrorPage = /^about:(neterror|certerror|blocked)/.test(doc.documentURI);
sendAsyncMessage("Bookmarks:GetPageDetails:Result",
- { isErrorPage: isErrorPage,
+ { isErrorPage,
description: PlacesUIUtils.getDescriptionFromDocument(doc) });
});
var LightWeightThemeWebInstallListener = {
_previewWindow: null,
- init: function() {
+ init() {
addEventListener("InstallBrowserTheme", this, false, true);
addEventListener("PreviewBrowserTheme", this, false, true);
addEventListener("ResetBrowserThemePreview", this, false, true);
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "InstallBrowserTheme": {
sendAsyncMessage("LightWeightThemeWebInstaller:Install", {
@@ -923,7 +923,7 @@ var LightWeightThemeWebInstallListener = {
}
},
- _resetPreviewWindow: function() {
+ _resetPreviewWindow() {
this._previewWindow.removeEventListener("pagehide", this, true);
this._previewWindow = null;
}
@@ -982,11 +982,11 @@ addMessageListener("ContextMenu:SetAsDesktopBackground", (message) => {
var PageInfoListener = {
- init: function() {
+ init() {
addMessageListener("PageInfo:getData", this);
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
let strings = message.data.strings;
let window;
let document;
@@ -1017,7 +1017,7 @@ var PageInfoListener = {
this.getMediaInfo(document, window, strings);
},
- getImageInfo: function(imageElement) {
+ getImageInfo(imageElement) {
let imageInfo = null;
if (imageElement) {
imageInfo = {
@@ -1030,7 +1030,7 @@ var PageInfoListener = {
return imageInfo;
},
- getMetaInfo: function(document) {
+ getMetaInfo(document) {
let metaViewRows = [];
// Get the meta tags from the page.
@@ -1044,7 +1044,7 @@ var PageInfoListener = {
return metaViewRows;
},
- getWindowInfo: function(window) {
+ getWindowInfo(window) {
let windowInfo = {};
windowInfo.isTopWindow = window == window.top;
@@ -1058,7 +1058,7 @@ var PageInfoListener = {
return windowInfo;
},
- getDocumentInfo: function(document) {
+ getDocumentInfo(document) {
let docInfo = {};
docInfo.title = document.title;
docInfo.location = document.location.toString();
@@ -1079,7 +1079,7 @@ var PageInfoListener = {
return docInfo;
},
- getFeedsInfo: function(document, strings) {
+ getFeedsInfo(document, strings) {
let feeds = [];
// Get the feeds from the page.
let linkNodes = document.getElementsByTagName("link");
@@ -1110,13 +1110,13 @@ var PageInfoListener = {
},
// Only called once to get the media tab's media elements from the content page.
- getMediaInfo: function(document, window, strings)
+ getMediaInfo(document, window, strings)
{
let frameList = this.goThroughFrames(document, window);
Task.spawn(() => this.processFrames(document, frameList, strings));
},
- goThroughFrames: function(document, window)
+ goThroughFrames(document, window)
{
let frameList = [document];
if (window && window.frames.length > 0) {
@@ -1130,7 +1130,7 @@ var PageInfoListener = {
return frameList;
},
- processFrames: function*(document, frameList, strings)
+ *processFrames(document, frameList, strings)
{
let nodeCount = 0;
for (let doc of frameList) {
@@ -1155,7 +1155,7 @@ var PageInfoListener = {
sendAsyncMessage("PageInfo:mediaData", {isComplete: true});
},
- getMediaItems: function(document, strings, elem)
+ getMediaItems(document, strings, elem)
{
// Check for images defined in CSS (e.g. background, borders)
let computedStyle = elem.ownerGlobal.getComputedStyle(elem);
@@ -1241,7 +1241,7 @@ var PageInfoListener = {
* makePreview in pageInfo.js uses to figure out how to display the preview.
*/
- serializeElementInfo: function(document, url, type, alt, item, isBG)
+ serializeElementInfo(document, url, type, alt, item, isBG)
{
let result = {};
@@ -1322,7 +1322,7 @@ var PageInfoListener = {
// Other Misc Stuff
// Modified from the Links Panel v2.3, http://segment7.net/mozilla/links/links.html
// parse a node to extract the contents of the node
- getValueText: function(node)
+ getValueText(node)
{
let valueText = "";
@@ -1362,7 +1362,7 @@ var PageInfoListener = {
// Copied from the Links Panel v2.3, http://segment7.net/mozilla/links/links.html.
// Traverse the tree in search of an img or area element and grab its alt tag.
- getAltText: function(node)
+ getAltText(node)
{
let altText = "";
@@ -1380,7 +1380,7 @@ var PageInfoListener = {
// Copied from the Links Panel v2.3, http://segment7.net/mozilla/links/links.html.
// Strip leading and trailing whitespace, and replace multiple consecutive whitespace characters with a single space.
- stripWS: function(text)
+ stripWS(text)
{
let middleRE = /\s+/g;
let endRE = /(^\s+)|(\s+$)/g;
diff --git a/browser/base/content/contentSearchUI.js b/browser/base/content/contentSearchUI.js
index 688d8b1cfe4b..d3f8d5f143ce 100644
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -90,7 +90,7 @@ ContentSearchUIController.prototype = {
}
this._defaultEngine = {
name: engine.name,
- icon: icon,
+ icon,
};
this._updateDefaultEngineHeader();
@@ -189,7 +189,7 @@ ContentSearchUIController.prototype = {
return this._suggestionsList.children.length;
},
- selectAndUpdateInput: function(idx) {
+ selectAndUpdateInput(idx) {
this.selectedIndex = idx;
let newValue = this.suggestionAtIndex(idx) || this._stickyInputValue;
// Setting the input value when the value has not changed commits the current
@@ -200,12 +200,12 @@ ContentSearchUIController.prototype = {
this._updateSearchWithHeader();
},
- suggestionAtIndex: function(idx) {
+ suggestionAtIndex(idx) {
let row = this._suggestionsList.children[idx];
return row ? row.textContent : null;
},
- deleteSuggestionAtIndex: function(idx) {
+ deleteSuggestionAtIndex(idx) {
// Only form history suggestions can be deleted.
if (this.isFormHistorySuggestionAtIndex(idx)) {
let suggestionStr = this.suggestionAtIndex(idx);
@@ -215,20 +215,20 @@ ContentSearchUIController.prototype = {
}
},
- isFormHistorySuggestionAtIndex: function(idx) {
+ isFormHistorySuggestionAtIndex(idx) {
let row = this._suggestionsList.children[idx];
return row && row.classList.contains("formHistory");
},
- addInputValueToFormHistory: function() {
+ addInputValueToFormHistory() {
this._sendMsg("AddFormHistoryEntry", this.input.value);
},
- handleEvent: function(event) {
+ handleEvent(event) {
this["_on" + event.type[0].toUpperCase() + event.type.substr(1)](event);
},
- _onCommand: function(aEvent) {
+ _onCommand(aEvent) {
if (this.selectedButtonIndex == this._oneOffButtons.length) {
// Settings button was selected.
this._sendMsg("ManageEngines");
@@ -242,7 +242,7 @@ ContentSearchUIController.prototype = {
}
},
- search: function(aEvent) {
+ search(aEvent) {
if (!this.defaultEngine) {
return; // Not initialized yet.
}
@@ -291,7 +291,7 @@ ContentSearchUIController.prototype = {
this.addInputValueToFormHistory();
},
- _onInput: function() {
+ _onInput() {
if (!this.input.value) {
this._stickyInputValue = "";
this._hideSuggestions();
@@ -304,7 +304,7 @@ ContentSearchUIController.prototype = {
this._updateSearchWithHeader();
},
- _onKeypress: function(event) {
+ _onKeypress(event) {
let selectedIndexDelta = 0;
let selectedSuggestionDelta = 0;
let selectedOneOffDelta = 0;
@@ -451,7 +451,7 @@ ContentSearchUIController.prototype = {
},
_currentEngineIndex: -1,
- _cycleCurrentEngine: function(aReverse) {
+ _cycleCurrentEngine(aReverse) {
if ((this._currentEngineIndex == this._engines.length - 1 && !aReverse) ||
(this._currentEngineIndex == 0 && aReverse)) {
return;
@@ -461,7 +461,7 @@ ContentSearchUIController.prototype = {
this._sendMsg("SetCurrentEngine", engineName);
},
- _onFocus: function() {
+ _onFocus() {
if (this._mousedown) {
return;
}
@@ -474,7 +474,7 @@ ContentSearchUIController.prototype = {
this._speculativeConnect();
},
- _onBlur: function() {
+ _onBlur() {
if (this._mousedown) {
// At this point, this.input has lost focus, but a new element has not yet
// received it. If we re-focus this.input directly, the new element will
@@ -486,7 +486,7 @@ ContentSearchUIController.prototype = {
this._hideSuggestions();
},
- _onMousemove: function(event) {
+ _onMousemove(event) {
let idx = this._indexOfTableItem(event.target);
if (idx >= this.numSuggestions) {
this.selectedButtonIndex = idx - this.numSuggestions;
@@ -495,14 +495,14 @@ ContentSearchUIController.prototype = {
this.selectedIndex = idx;
},
- _onMouseup: function(event) {
+ _onMouseup(event) {
if (event.button == 2) {
return;
}
this._onCommand(event);
},
- _onMouseout: function(event) {
+ _onMouseout(event) {
// We only deselect one-off buttons and the settings button when they are
// moused out.
let idx = this._indexOfTableItem(event.originalTarget);
@@ -511,22 +511,22 @@ ContentSearchUIController.prototype = {
}
},
- _onClick: function(event) {
+ _onClick(event) {
this._onMouseup(event);
},
- _onContentSearchService: function(event) {
+ _onContentSearchService(event) {
let methodName = "_onMsg" + event.detail.type;
if (methodName in this) {
this[methodName](event.detail.data);
}
},
- _onMsgFocusInput: function(event) {
+ _onMsgFocusInput(event) {
this.input.focus();
},
- _onMsgSuggestions: function(suggestions) {
+ _onMsgSuggestions(suggestions) {
// Ignore the suggestions if their search string or engine doesn't match
// ours. Due to the async nature of message passing, this can easily happen
// when the user types quickly.
@@ -581,13 +581,13 @@ ContentSearchUIController.prototype = {
}
},
- _onMsgSuggestionsCancelled: function() {
+ _onMsgSuggestionsCancelled() {
if (!this._table.hidden) {
this._hideSuggestions();
}
},
- _onMsgState: function(state) {
+ _onMsgState(state) {
this.engines = state.engines;
// No point updating the default engine (and the header) if there's no change.
if (this.defaultEngine &&
@@ -598,16 +598,16 @@ ContentSearchUIController.prototype = {
this.defaultEngine = state.currentEngine;
},
- _onMsgCurrentState: function(state) {
+ _onMsgCurrentState(state) {
this._onMsgState(state);
},
- _onMsgCurrentEngine: function(engine) {
+ _onMsgCurrentEngine(engine) {
this.defaultEngine = engine;
this._pendingOneOffRefresh = true;
},
- _onMsgStrings: function(strings) {
+ _onMsgStrings(strings) {
this._strings = strings;
this._updateDefaultEngineHeader();
this._updateSearchWithHeader();
@@ -616,7 +616,7 @@ ContentSearchUIController.prototype = {
this.input.setAttribute("placeholder", this._strings.searchPlaceholder);
},
- _updateDefaultEngineHeader: function() {
+ _updateDefaultEngineHeader() {
let header = document.getElementById("contentSearchDefaultEngineHeader");
header.firstChild.setAttribute("src", this.defaultEngine.icon);
if (!this._strings) {
@@ -629,7 +629,7 @@ ContentSearchUIController.prototype = {
this._strings.searchHeader.replace("%S", this.defaultEngine.name)));
},
- _updateSearchWithHeader: function() {
+ _updateSearchWithHeader() {
if (!this._strings) {
return;
}
@@ -642,13 +642,13 @@ ContentSearchUIController.prototype = {
}
},
- _speculativeConnect: function() {
+ _speculativeConnect() {
if (this.defaultEngine) {
this._sendMsg("SpeculativeConnect", this.defaultEngine.name);
}
},
- _makeTableRow: function(type, suggestionStr, currentRow, searchWords) {
+ _makeTableRow(type, suggestionStr, currentRow, searchWords) {
let row = document.createElementNS(HTML_NS, "tr");
row.dir = "auto";
row.classList.add("contentSearchSuggestionRow");
@@ -685,28 +685,28 @@ ContentSearchUIController.prototype = {
},
// Converts favicon array buffer into a data URI.
- _getFaviconURIFromBuffer: function(buffer) {
+ _getFaviconURIFromBuffer(buffer) {
let blob = new Blob([buffer]);
return URL.createObjectURL(blob);
},
// Adds "@2x" to the name of the given PNG url for "retina" screens.
- _getImageURIForCurrentResolution: function(uri) {
+ _getImageURIForCurrentResolution(uri) {
if (window.devicePixelRatio > 1) {
return uri.replace(/\.png$/, "@2x.png");
}
return uri;
},
- _getSearchEngines: function() {
+ _getSearchEngines() {
this._sendMsg("GetState");
},
- _getStrings: function() {
+ _getStrings() {
this._sendMsg("GetStrings");
},
- _getSuggestions: function() {
+ _getSuggestions() {
this._stickyInputValue = this.input.value;
if (this.defaultEngine) {
this._sendMsg("GetSuggestions", {
@@ -716,13 +716,13 @@ ContentSearchUIController.prototype = {
}
},
- _clearSuggestionRows: function() {
+ _clearSuggestionRows() {
while (this._suggestionsList.firstElementChild) {
this._suggestionsList.firstElementChild.remove();
}
},
- _hideSuggestions: function() {
+ _hideSuggestions() {
this.input.setAttribute("aria-expanded", "false");
this.selectedIndex = -1;
this.selectedButtonIndex = -1;
@@ -730,7 +730,7 @@ ContentSearchUIController.prototype = {
this._table.hidden = true;
},
- _indexOfTableItem: function(elt) {
+ _indexOfTableItem(elt) {
if (elt.classList.contains("contentSearchOneOffItem")) {
return this.numSuggestions + this._oneOffButtons.indexOf(elt);
}
@@ -746,7 +746,7 @@ ContentSearchUIController.prototype = {
return elt.rowIndex;
},
- _makeTable: function(id) {
+ _makeTable(id) {
this._table = document.createElementNS(HTML_NS, "table");
this._table.id = id;
this._table.hidden = true;
@@ -815,7 +815,7 @@ ContentSearchUIController.prototype = {
return this._table;
},
- _setUpOneOffButtons: function() {
+ _setUpOneOffButtons() {
// Sometimes we receive a CurrentEngine message from the ContentSearch service
// before we've received a State message - i.e. before we have our engines.
if (!this._engines) {
@@ -896,11 +896,11 @@ ContentSearchUIController.prototype = {
this._oneOffsTable.hidden = false;
},
- _sendMsg: function(type, data = null) {
+ _sendMsg(type, data = null) {
dispatchEvent(new CustomEvent("ContentSearchClient", {
detail: {
- type: type,
- data: data,
+ type,
+ data,
},
}));
},
diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js
index 1e96c4e8b632..dd4336951248 100644
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -24,12 +24,12 @@ pageInfoTreeView.prototype = {
set rowCount(c) { throw "rowCount is a readonly property"; },
get rowCount() { return this.rows; },
- setTree: function(tree)
+ setTree(tree)
{
this.tree = tree;
},
- getCellText: function(row, column)
+ getCellText(row, column)
{
// row can be null, but js arrays are 0-indexed.
// colidx cannot be null, but can be larger than the number
@@ -38,16 +38,16 @@ pageInfoTreeView.prototype = {
return this.data[row][column.index] || "";
},
- setCellValue: function(row, column, value)
+ setCellValue(row, column, value)
{
},
- setCellText: function(row, column, value)
+ setCellText(row, column, value)
{
this.data[row][column.index] = value;
},
- addRow: function(row)
+ addRow(row)
{
this.rows = this.data.push(row);
this.rowCountChanged(this.rows - 1, 1);
@@ -56,24 +56,24 @@ pageInfoTreeView.prototype = {
}
},
- addRows: function(rows)
+ addRows(rows)
{
for (let row of rows) {
this.addRow(row);
}
},
- rowCountChanged: function(index, count)
+ rowCountChanged(index, count)
{
this.tree.rowCountChanged(index, count);
},
- invalidate: function()
+ invalidate()
{
this.tree.invalidate();
},
- clear: function()
+ clear()
{
if (this.tree)
this.tree.rowCountChanged(0, -this.rows);
@@ -81,12 +81,12 @@ pageInfoTreeView.prototype = {
this.data = [ ];
},
- handleCopy: function(row)
+ handleCopy(row)
{
return (row < 0 || this.copycol < 0) ? "" : (this.data[row][this.copycol] || "");
},
- performActionOnRow: function(action, row)
+ performActionOnRow(action, row)
{
if (action == "copy") {
var data = this.handleCopy(row)
@@ -94,7 +94,7 @@ pageInfoTreeView.prototype = {
}
},
- onPageMediaSort : function(columnname)
+ onPageMediaSort(columnname)
{
var tree = document.getElementById(this.treeid);
var treecol = tree.columns.getNamedColumn(columnname);
@@ -121,29 +121,29 @@ pageInfoTreeView.prototype = {
this.sortcol = treecol.index;
},
- getRowProperties: function(row) { return ""; },
- getCellProperties: function(row, column) { return ""; },
- getColumnProperties: function(column) { return ""; },
- isContainer: function(index) { return false; },
- isContainerOpen: function(index) { return false; },
- isSeparator: function(index) { return false; },
- isSorted: function() { return this.sortcol > -1 },
- canDrop: function(index, orientation) { return false; },
- drop: function(row, orientation) { return false; },
- getParentIndex: function(index) { return 0; },
- hasNextSibling: function(index, after) { return false; },
- getLevel: function(index) { return 0; },
- getImageSrc: function(row, column) { },
- getProgressMode: function(row, column) { },
- getCellValue: function(row, column) { },
- toggleOpenState: function(index) { },
- cycleHeader: function(col) { },
- selectionChanged: function() { },
- cycleCell: function(row, column) { },
- isEditable: function(row, column) { return false; },
- isSelectable: function(row, column) { return false; },
- performAction: function(action) { },
- performActionOnCell: function(action, row, column) { }
+ getRowProperties(row) { return ""; },
+ getCellProperties(row, column) { return ""; },
+ getColumnProperties(column) { return ""; },
+ isContainer(index) { return false; },
+ isContainerOpen(index) { return false; },
+ isSeparator(index) { return false; },
+ isSorted() { return this.sortcol > -1 },
+ canDrop(index, orientation) { return false; },
+ drop(row, orientation) { return false; },
+ getParentIndex(index) { return 0; },
+ hasNextSibling(index, after) { return false; },
+ getLevel(index) { return 0; },
+ getImageSrc(row, column) { },
+ getProgressMode(row, column) { },
+ getCellValue(row, column) { },
+ toggleOpenState(index) { },
+ cycleHeader(col) { },
+ selectionChanged() { },
+ cycleCell(row, column) { },
+ isEditable(row, column) { return false; },
+ isSelectable(row, column) { return false; },
+ performAction(action) { },
+ performActionOnCell(action, row, column) { }
};
// mmm, yummy. global variables.
@@ -359,7 +359,7 @@ function loadPageInfo(frameOuterWindowID, imageElement, browser)
// Look for pageInfoListener in content.js. Sends message to listener with arguments.
mm.sendAsyncMessage("PageInfo:getData", {strings: gStrings,
- frameOuterWindowID: frameOuterWindowID},
+ frameOuterWindowID},
{ imageElement });
let pageInfoData;
@@ -517,10 +517,10 @@ function toggleGroupbox(id)
function openCacheEntry(key, cb)
{
var checkCacheListener = {
- onCacheEntryCheck: function(entry, appCache) {
+ onCacheEntryCheck(entry, appCache) {
return Components.interfaces.nsICacheEntryOpenCallback.ENTRY_WANTED;
},
- onCacheEntryAvailable: function(entry, isNew, appCache, status) {
+ onCacheEntryAvailable(entry, isNew, appCache, status) {
cb(entry);
}
};
@@ -1004,7 +1004,7 @@ function makeBlockImage(url)
}
var imagePermissionObserver = {
- observe: function(aSubject, aTopic, aData)
+ observe(aSubject, aTopic, aData)
{
if (document.getElementById("mediaPreviewBox").collapsed)
return;
diff --git a/browser/base/content/pageinfo/permissions.js b/browser/base/content/pageinfo/permissions.js
index b3e1720dc544..5a563c035e97 100644
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -20,7 +20,7 @@ var gPermissions = SitePermissions.listPermissions().sort((a, b) => {
gPermissions.push("plugins");
var permissionObserver = {
- observe: function(aSubject, aTopic, aData)
+ observe(aSubject, aTopic, aData)
{
if (aTopic == "perm-changed") {
var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
diff --git a/browser/base/content/pageinfo/security.js b/browser/base/content/pageinfo/security.js
index 2638cb13d76e..e3f0fdc886b9 100644
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -9,18 +9,18 @@ XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
"resource://gre/modules/LoginHelper.jsm");
var security = {
- init: function(uri, windowInfo) {
+ init(uri, windowInfo) {
this.uri = uri;
this.windowInfo = windowInfo;
},
// Display the server certificate (static)
- viewCert : function() {
+ viewCert() {
var cert = security._cert;
viewCertHelper(window, cert);
},
- _getSecurityInfo : function() {
+ _getSecurityInfo() {
const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
const nsISSLStatus = Components.interfaces.nsISSLStatus;
@@ -54,15 +54,15 @@ var security = {
this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName;
var retval = {
- hostName : hostName,
+ hostName,
cAName : issuerName,
encryptionAlgorithm : undefined,
encryptionStrength : undefined,
version: undefined,
- isBroken : isBroken,
- isMixed : isMixed,
- isEV : isEV,
- cert : cert,
+ isBroken,
+ isMixed,
+ isEV,
+ cert,
certificateTransparency : undefined
};
@@ -117,21 +117,21 @@ var security = {
return retval;
}
return {
- hostName : hostName,
+ hostName,
cAName : "",
encryptionAlgorithm : "",
encryptionStrength : 0,
version: "",
- isBroken : isBroken,
- isMixed : isMixed,
- isEV : isEV,
+ isBroken,
+ isMixed,
+ isEV,
cert : null,
certificateTransparency : null
};
},
// Find the secureBrowserUI object (if present)
- _getSecurityUI : function() {
+ _getSecurityUI() {
if (window.opener.gBrowser)
return window.opener.gBrowser.securityUI;
return null;
@@ -140,7 +140,7 @@ var security = {
// Interface for mapping a certificate issuer organization to
// the value to be displayed.
// Bug 82017 - this implementation should be moved to pipnss C++ code
- mapIssuerOrganization: function(name) {
+ mapIssuerOrganization(name) {
if (!name) return null;
if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
@@ -152,7 +152,7 @@ var security = {
/**
* Open the cookie manager window
*/
- viewCookies : function()
+ viewCookies()
{
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
@@ -181,7 +181,7 @@ var security = {
/**
* Open the login manager window
*/
- viewPasswords : function() {
+ viewPasswords() {
LoginHelper.openPasswordManager(window, this._getSecurityInfo().hostName);
},
diff --git a/browser/base/content/sanitize.js b/browser/base/content/sanitize.js
index 725daa64ed5a..53cf4e943d37 100644
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -38,14 +38,14 @@ function Sanitizer() {
}
Sanitizer.prototype = {
// warning to the caller: this one may raise an exception (e.g. bug #265028)
- clearItem: function(aItemName)
+ clearItem(aItemName)
{
this.items[aItemName].clear();
},
prefDomain: "",
- getNameFromPreference: function(aPreferenceName)
+ getNameFromPreference(aPreferenceName)
{
return aPreferenceName.substr(this.prefDomain.length);
},
@@ -516,7 +516,7 @@ Sanitizer.prototype = {
openWindows: {
privateStateForNewWindow: "non-private",
- _canCloseWindow: function(aWindow) {
+ _canCloseWindow(aWindow) {
if (aWindow.CanCloseWindow()) {
// We already showed PermitUnload for the window, so let's
// make sure we don't do it again when we actually close the
@@ -526,7 +526,7 @@ Sanitizer.prototype = {
}
return false;
},
- _resetAllWindowClosures: function(aWindowList) {
+ _resetAllWindowClosures(aWindowList) {
for (let win of aWindowList) {
win.skipNextCanClose = false;
}
diff --git a/browser/base/content/social-content.js b/browser/base/content/social-content.js
index b5fa6a5c4bda..071d057d522c 100644
--- a/browser/base/content/social-content.js
+++ b/browser/base/content/social-content.js
@@ -114,7 +114,7 @@ const SocialErrorListener = {
webNav.loadURI(url, null, null, null, null);
}
sendAsyncMessage("Social:ErrorPageNotify", {
- origin: origin,
+ origin,
url: src
});
},
diff --git a/browser/base/content/sync/aboutSyncTabs.js b/browser/base/content/sync/aboutSyncTabs.js
index e49411c7434f..731a0edfee81 100644
--- a/browser/base/content/sync/aboutSyncTabs.js
+++ b/browser/base/content/sync/aboutSyncTabs.js
@@ -23,7 +23,7 @@ if (AppConstants.MOZ_SERVICES_CLOUDSYNC) {
var RemoteTabViewer = {
_tabsList: null,
- init: function() {
+ init() {
Services.obs.addObserver(this, "weave:service:login:finish", false);
Services.obs.addObserver(this, "weave:engine:sync:finish", false);
@@ -34,14 +34,14 @@ var RemoteTabViewer = {
this.buildList(true);
},
- uninit: function() {
+ uninit() {
Services.obs.removeObserver(this, "weave:service:login:finish");
Services.obs.removeObserver(this, "weave:engine:sync:finish");
Services.obs.removeObserver(this, "cloudsync:tabs:update");
},
- createItem: function(attrs) {
+ createItem(attrs) {
let item = document.createElement("richlistitem");
// Copy the attributes from the argument into the item.
@@ -56,7 +56,7 @@ var RemoteTabViewer = {
return item;
},
- filterTabs: function(event) {
+ filterTabs(event) {
let val = event.target.value.toLowerCase();
let numTabs = this._tabsList.getRowCount();
let clientTabs = 0;
@@ -89,7 +89,7 @@ var RemoteTabViewer = {
}
},
- openSelected: function() {
+ openSelected() {
let items = this._tabsList.selectedItems;
let urls = [];
for (let i = 0; i < items.length; i++) {
@@ -105,14 +105,14 @@ var RemoteTabViewer = {
}
},
- bookmarkSingleTab: function() {
+ bookmarkSingleTab() {
let item = this._tabsList.selectedItems[0];
let uri = Weave.Utils.makeURI(item.getAttribute("url"));
let title = item.getAttribute("title");
PlacesUIUtils.showBookmarkDialog({ action: "add"
, type: "bookmark"
- , uri: uri
- , title: title
+ , uri
+ , title
, hiddenRows: [ "description"
, "location"
, "loadInSidebar"
@@ -120,7 +120,7 @@ var RemoteTabViewer = {
}, window.top);
},
- bookmarkSelectedTabs: function() {
+ bookmarkSelectedTabs() {
let items = this._tabsList.selectedItems;
let URIs = [];
for (let i = 0; i < items.length; i++) {
@@ -142,7 +142,7 @@ var RemoteTabViewer = {
}
},
- getIcon: function(iconUri, defaultIcon) {
+ getIcon(iconUri, defaultIcon) {
try {
let iconURI = Weave.Utils.makeURI(iconUri);
return PlacesUtils.favicons.getFaviconLinkForIcon(iconURI).spec;
@@ -158,7 +158,7 @@ var RemoteTabViewer = {
_buildListRequested: false,
- buildList: function(forceSync) {
+ buildList(forceSync) {
if (this._waitingForBuildList) {
this._buildListRequested = true;
return;
@@ -192,7 +192,7 @@ var RemoteTabViewer = {
}
},
- _clearTabList: function() {
+ _clearTabList() {
let list = this._tabsList;
// Clear out existing richlistitems.
@@ -204,7 +204,7 @@ var RemoteTabViewer = {
}
},
- _generateWeaveTabList: function() {
+ _generateWeaveTabList() {
let engine = Weave.Service.engineManager.get("tabs");
let list = this._tabsList;
@@ -236,7 +236,7 @@ var RemoteTabViewer = {
let attrs = {
type: "tab",
title: title || url,
- url: url,
+ url,
icon: this.getIcon(icon),
}
let tab = this.createItem(attrs);
@@ -245,7 +245,7 @@ var RemoteTabViewer = {
}
},
- _generateCloudSyncTabList: function() {
+ _generateCloudSyncTabList() {
let updateTabList = function(remoteTabs) {
let list = this._tabsList;
@@ -275,7 +275,7 @@ var RemoteTabViewer = {
.then(updateTabList, Promise.reject.bind(Promise));
},
- adjustContextMenu: function(event) {
+ adjustContextMenu(event) {
let mode = "all";
switch (this._tabsList.selectedItems.length) {
case 0:
@@ -300,7 +300,7 @@ var RemoteTabViewer = {
}
},
- _refetchTabs: function(force) {
+ _refetchTabs(force) {
if (!force) {
// Don't bother refetching tabs if we already did so recently
let lastFetch = 0;
@@ -325,7 +325,7 @@ var RemoteTabViewer = {
return true;
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
switch (topic) {
case "weave:service:login:finish":
// A login has finished, which means that a Sync is about to start and
@@ -346,7 +346,7 @@ var RemoteTabViewer = {
}
},
- handleClick: function(event) {
+ handleClick(event) {
if (event.target.getAttribute("type") != "tab") {
return;
}
diff --git a/browser/base/content/sync/genericChange.js b/browser/base/content/sync/genericChange.js
index a9571b662f6d..5828e5dbb900 100644
--- a/browser/base/content/sync/genericChange.js
+++ b/browser/base/content/sync/genericChange.js
@@ -136,7 +136,7 @@ var Change = {
window.setTimeout(window.close, 1500);
},
- onDialogAccept: function() {
+ onDialogAccept() {
switch (this._dialogType) {
case "UpdatePassphrase":
case "ResetPassphrase":
@@ -147,7 +147,7 @@ var Change = {
return undefined;
},
- doGeneratePassphrase: function() {
+ doGeneratePassphrase() {
let passphrase = Weave.Utils.generatePassphrase();
this._passphraseBox.value = Weave.Utils.hyphenatePassphrase(passphrase);
this._dialog.getButton("finish").disabled = false;
@@ -201,7 +201,7 @@ var Change = {
return false;
},
- validate: function(event) {
+ validate(event) {
let valid = false;
let errorString = "";
diff --git a/browser/base/content/sync/setup.js b/browser/base/content/sync/setup.js
index ab7f61001565..9190263283a9 100644
--- a/browser/base/content/sync/setup.js
+++ b/browser/base/content/sync/setup.js
@@ -61,7 +61,7 @@ var gSyncSetup = {
return document.getElementById("existingServer").selectedIndex == 0;
},
- init: function() {
+ init() {
let obs = [
["weave:service:change-passphrase", "onResetPassphrase"],
["weave:service:login:start", "onLoginStart"],
@@ -121,14 +121,14 @@ var gSyncSetup = {
.getAttribute("accesskey");
},
- startNewAccountSetup: function() {
+ startNewAccountSetup() {
if (!Weave.Utils.ensureMPUnlocked())
return;
this._settingUpNew = true;
this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE;
},
- useExistingAccount: function() {
+ useExistingAccount() {
if (!Weave.Utils.ensureMPUnlocked())
return;
this._settingUpNew = false;
@@ -173,22 +173,22 @@ var gSyncSetup = {
gSyncUtils.resetPassphrase(true);
},
- onResetPassphrase: function() {
+ onResetPassphrase() {
document.getElementById("existingPassphrase").value =
Weave.Utils.hyphenatePassphrase(Weave.Service.identity.syncKey);
this.checkFields();
this.wizard.advance();
},
- onLoginStart: function() {
+ onLoginStart() {
this.toggleLoginFeedback(false);
},
- onLoginEnd: function() {
+ onLoginEnd() {
this.toggleLoginFeedback(true);
},
- sendCredentialsAfterSync: function() {
+ sendCredentialsAfterSync() {
let send = function() {
Services.obs.removeObserver("weave:service:sync:finish", send);
Services.obs.removeObserver("weave:service:sync:error", send);
@@ -202,7 +202,7 @@ var gSyncSetup = {
Services.obs.addObserver("weave:service:sync:error", send, false);
},
- toggleLoginFeedback: function(stop) {
+ toggleLoginFeedback(stop) {
document.getElementById("login-throbber").hidden = stop;
let password = document.getElementById("existingPasswordFeedbackRow");
let server = document.getElementById("existingServerFeedbackRow");
@@ -231,7 +231,7 @@ var gSyncSetup = {
this._setFeedbackMessage(feedback, false, Weave.Status.login);
},
- setupInitialSync: function() {
+ setupInitialSync() {
let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
switch (action) {
case "resetClient":
@@ -248,11 +248,11 @@ var gSyncSetup = {
},
// fun with validation!
- checkFields: function() {
+ checkFields() {
this.wizard.canAdvance = this.readyToAdvance();
},
- readyToAdvance: function() {
+ readyToAdvance() {
switch (this.wizard.pageIndex) {
case INTRO_PAGE:
return false;
@@ -293,7 +293,7 @@ var gSyncSetup = {
this.pin3.value.length == PIN_PART_LENGTH);
},
- onEmailInput: function() {
+ onEmailInput() {
// Check account validity when the user stops typing for 1 second.
if (this._checkAccountTimer)
window.clearTimeout(this._checkAccountTimer);
@@ -302,7 +302,7 @@ var gSyncSetup = {
}, 1000);
},
- checkAccount: function() {
+ checkAccount() {
delete this._checkAccountTimer;
let value = Weave.Utils.normalizeAccount(
document.getElementById("weaveEmail").value);
@@ -337,7 +337,7 @@ var gSyncSetup = {
this.checkFields();
},
- onPasswordChange: function() {
+ onPasswordChange() {
let password = document.getElementById("weavePassword");
let pwconfirm = document.getElementById("weavePasswordConfirm");
let [valid, errorString] = gSyncUtils.validatePassword(password, pwconfirm);
@@ -349,7 +349,7 @@ var gSyncSetup = {
this.checkFields();
},
- onPageShow: function() {
+ onPageShow() {
switch (this.wizard.pageIndex) {
case PAIR_PAGE:
this.wizard.getButton("back").hidden = true;
@@ -420,7 +420,7 @@ var gSyncSetup = {
}
},
- onWizardAdvance: function() {
+ onWizardAdvance() {
// Check pageIndex so we don't prompt before the Sync setup wizard appears.
// This is a fallback in case the Master Password gets locked mid-wizard.
if ((this.wizard.pageIndex >= 0) &&
@@ -509,7 +509,7 @@ var gSyncSetup = {
return true;
},
- onWizardBack: function() {
+ onWizardBack() {
switch (this.wizard.pageIndex) {
case NEW_ACCOUNT_START_PAGE:
this.wizard.pageIndex = INTRO_PAGE;
@@ -535,7 +535,7 @@ var gSyncSetup = {
return true;
},
- wizardFinish: function() {
+ wizardFinish() {
this.setupInitialSync();
if (this.wizardType == "pair") {
@@ -563,7 +563,7 @@ var gSyncSetup = {
window.close();
},
- onWizardCancel: function() {
+ onWizardCancel() {
if (this._resettingSync)
return;
@@ -572,12 +572,12 @@ var gSyncSetup = {
Weave.Service.startOver();
},
- onSyncOptions: function() {
+ onSyncOptions() {
this._beforeOptionsPage = this.wizard.pageIndex;
this.wizard.pageIndex = OPTIONS_PAGE;
},
- returnFromOptions: function() {
+ returnFromOptions() {
this.wizard.getButton("next").label = this._nextButtonLabel;
this.wizard.getButton("next").setAttribute("accesskey",
this._nextButtonAccesskey);
@@ -644,7 +644,7 @@ var gSyncSetup = {
this._jpakeclient.controller = controller;
},
- startEasySetup: function() {
+ startEasySetup() {
// Don't do anything if we have a client already (e.g. we went to
// Sync Options and just came back).
if (this._jpakeclient)
@@ -691,7 +691,7 @@ var gSyncSetup = {
this._jpakeclient.receiveNoPIN();
},
- abortEasySetup: function() {
+ abortEasySetup() {
document.getElementById("easySetupPIN1").value = "";
document.getElementById("easySetupPIN2").value = "";
document.getElementById("easySetupPIN3").value = "";
@@ -702,7 +702,7 @@ var gSyncSetup = {
delete this._jpakeclient;
},
- manualSetup: function() {
+ manualSetup() {
this.abortEasySetup();
this.wizard.pageIndex = EXISTING_ACCOUNT_LOGIN_PAGE;
},
@@ -710,7 +710,7 @@ var gSyncSetup = {
// _handleNoScript is needed because it blocks the captcha. So we temporarily
// allow the necessary sites so that we can verify the user is in fact a human.
// This was done with the help of Giorgio (NoScript author). See bug 508112.
- _handleNoScript: function(addExceptions) {
+ _handleNoScript(addExceptions) {
// if NoScript isn't installed, or is disabled, bail out.
let ns = Cc["@maone.net/noscript-service;1"];
if (ns == null)
@@ -734,7 +734,7 @@ var gSyncSetup = {
}
},
- onExistingServerCommand: function() {
+ onExistingServerCommand() {
let control = document.getElementById("existingServer");
if (control.selectedIndex == 0) {
control.removeAttribute("editable");
@@ -750,7 +750,7 @@ var gSyncSetup = {
this.checkFields();
},
- onExistingServerInput: function() {
+ onExistingServerInput() {
// Check custom server validity when the user stops typing for 1 second.
if (this._existingServerTimer)
window.clearTimeout(this._existingServerTimer);
@@ -759,7 +759,7 @@ var gSyncSetup = {
}, 1000);
},
- onServerCommand: function() {
+ onServerCommand() {
setVisibility(document.getElementById("TOSRow"), this._usingMainServers);
let control = document.getElementById("server");
if (!this._usingMainServers) {
@@ -783,7 +783,7 @@ var gSyncSetup = {
this.checkFields();
},
- onServerInput: function() {
+ onServerInput() {
// Check custom server validity when the user stops typing for 1 second.
if (this._checkServerTimer)
window.clearTimeout(this._checkServerTimer);
@@ -792,7 +792,7 @@ var gSyncSetup = {
}, 1000);
},
- checkServer: function() {
+ checkServer() {
delete this._checkServerTimer;
let el = document.getElementById("server");
let valid = false;
@@ -813,7 +813,7 @@ var gSyncSetup = {
this.checkFields();
},
- _validateServer: function(element) {
+ _validateServer(element) {
let valid = false;
let val = element.value;
if (!val)
@@ -859,7 +859,7 @@ var gSyncSetup = {
return valid;
},
- _handleChoice: function() {
+ _handleChoice() {
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
document.getElementById("chosenActionDeck").selectedIndex = desc;
switch (desc) {
@@ -983,7 +983,7 @@ var gSyncSetup = {
// sets class and string on a feedback element
// if no property string is passed in, we clear label/style
- _setFeedback: function(element, success, string) {
+ _setFeedback(element, success, string) {
element.hidden = success || !string;
let classname = success ? "success" : "error";
let image = element.getElementsByAttribute("class", "statusIcon")[0];
@@ -993,7 +993,7 @@ var gSyncSetup = {
},
// shim
- _setFeedbackMessage: function(element, success, string) {
+ _setFeedbackMessage(element, success, string) {
let str = "";
if (string) {
try {
@@ -1015,7 +1015,7 @@ var gSyncSetup = {
}
},
- onStateChange: function(webProgress, request, stateFlags, status) {
+ onStateChange(webProgress, request, stateFlags, status) {
// We're only looking for the end of the frame load
if ((stateFlags & Ci.nsIWebProgressListener.STATE_STOP) == 0)
return;
@@ -1029,10 +1029,10 @@ var gSyncSetup = {
setVisibility(this.captchaBrowser, responseStatus != 404);
// XXX TODO we should really log any responseStatus other than 200
},
- onProgressChange: function() {},
- onStatusChange: function() {},
- onSecurityChange: function() {},
- onLocationChange: function() {}
+ onProgressChange() {},
+ onStatusChange() {},
+ onSecurityChange() {},
+ onLocationChange() {}
};
// Define lazy getters for various XUL elements.
diff --git a/browser/base/content/sync/utils.js b/browser/base/content/sync/utils.js
index c49d4b3b71fb..ea60ba1a0541 100644
--- a/browser/base/content/sync/utils.js
+++ b/browser/base/content/sync/utils.js
@@ -22,7 +22,7 @@ var gSyncUtils = {
},
// opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
- _openLink: function(url) {
+ _openLink(url) {
let thisDocEl = document.documentElement,
openerDocEl = window.opener && window.opener.document.documentElement;
if (thisDocEl.id == "accountSetup" && window.opener &&
@@ -58,22 +58,22 @@ var gSyncUtils = {
type, duringSetup);
},
- changePassword: function() {
+ changePassword() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ChangePassword");
},
- resetPassphrase: function(duringSetup) {
+ resetPassphrase(duringSetup) {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ResetPassphrase", duringSetup);
},
- updatePassphrase: function() {
+ updatePassphrase() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("UpdatePassphrase");
},
- resetPassword: function() {
+ resetPassword() {
this._openLink(Weave.Service.pwResetURL);
},
@@ -82,7 +82,7 @@ var gSyncUtils = {
return Weave.Svc.Prefs.get(root + "termsURL");
},
- openToS: function() {
+ openToS() {
this._openLink(this.tosURL);
},
@@ -91,7 +91,7 @@ var gSyncUtils = {
return Weave.Svc.Prefs.get(root + "privacyURL");
},
- openPrivacyPolicy: function() {
+ openPrivacyPolicy() {
this._openLink(this.privacyPolicyURL);
},
@@ -102,7 +102,7 @@ var gSyncUtils = {
* @param elid : ID of the form element containing the passphrase.
* @param callback : Function called once the iframe has loaded.
*/
- _preparePPiframe: function(elid, callback) {
+ _preparePPiframe(elid, callback) {
let pp = document.getElementById(elid).value;
// Create an invisible iframe whose contents we can print.
@@ -137,7 +137,7 @@ var gSyncUtils = {
*
* @param elid : ID of the form element containing the passphrase.
*/
- passphrasePrint: function(elid) {
+ passphrasePrint(elid) {
this._preparePPiframe(elid, function(iframe) {
let webBrowserPrint = iframe.contentWindow
.QueryInterface(Ci.nsIInterfaceRequestor)
@@ -165,7 +165,7 @@ var gSyncUtils = {
*
* @param elid : ID of the form element containing the passphrase.
*/
- passphraseSave: function(elid) {
+ passphraseSave(elid) {
let dialogTitle = this.bundle.GetStringFromName("save.recoverykey.title");
let defaultSaveName = this.bundle.GetStringFromName("save.recoverykey.defaultfilename");
this._preparePPiframe(elid, function(iframe) {
@@ -203,7 +203,7 @@ var gSyncUtils = {
*
* returns [valid, errorString]
*/
- validatePassword: function(el1, el2) {
+ validatePassword(el1, el2) {
let valid = false;
let val1 = el1.value;
let val2 = el2 ? el2.value : "";
diff --git a/browser/base/content/tab-content.js b/browser/base/content/tab-content.js
index 34eb58627207..67db5b5fc183 100644
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -27,7 +27,7 @@ XPCOMUtils.defineLazyGetter(this, "SimpleServiceDiscovery", function() {
ssdp.registerDevice({
id: "roku:ecp",
target: "roku:ecp",
- factory: function(aService) {
+ factory(aService) {
Cu.import("resource://gre/modules/RokuApp.jsm");
return new RokuApp(aService);
},
@@ -98,13 +98,13 @@ addMessageListener("SecondScreen:tab-mirror", function(message) {
if (app) {
let width = content.innerWidth;
let height = content.innerHeight;
- let viewport = {cssWidth: width, cssHeight: height, width: width, height: height};
+ let viewport = {cssWidth: width, cssHeight: height, width, height};
app.mirror(function() {}, content, viewport, function() {}, content);
}
});
var AboutHomeListener = {
- init: function(chromeGlobal) {
+ init(chromeGlobal) {
chromeGlobal.addEventListener('AboutHomeLoad', this, false, true);
},
@@ -112,7 +112,7 @@ var AboutHomeListener = {
return content.document.documentURI.toLowerCase() == "about:home";
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (!this.isAboutHome) {
return;
}
@@ -129,7 +129,7 @@ var AboutHomeListener = {
}
},
- receiveMessage: function(aMessage) {
+ receiveMessage(aMessage) {
if (!this.isAboutHome) {
return;
}
@@ -140,7 +140,7 @@ var AboutHomeListener = {
}
},
- onUpdate: function(aData) {
+ onUpdate(aData) {
let doc = content.document;
if (aData.showRestoreLastSession && !PrivateBrowsingUtils.isContentWindowPrivate(content))
doc.getElementById("launcher").setAttribute("session", "true");
@@ -154,7 +154,7 @@ var AboutHomeListener = {
docElt.setAttribute("snippetsVersion", aData.snippetsVersion);
},
- onPageLoad: function() {
+ onPageLoad() {
addMessageListener("AboutHome:Update", this);
addEventListener("click", this, true);
addEventListener("pagehide", this, true);
@@ -163,7 +163,7 @@ var AboutHomeListener = {
sendAsyncMessage("AboutHome:RequestUpdate");
},
- onClick: function(aEvent) {
+ onClick(aEvent) {
if (!aEvent.isTrusted || // Don't trust synthetic events
aEvent.button == 2 || aEvent.target.localName != "button") {
return;
@@ -210,7 +210,7 @@ var AboutHomeListener = {
}
},
- onPageHide: function(aEvent) {
+ onPageHide(aEvent) {
if (aEvent.target.defaultView.frameElement) {
return;
}
@@ -260,7 +260,7 @@ var AboutReaderListener = {
_isLeavingReaderMode: false,
- init: function() {
+ init() {
addEventListener("AboutReaderContentLoaded", this, false, true);
addEventListener("DOMContentLoaded", this, false);
addEventListener("pageshow", this, false);
@@ -269,7 +269,7 @@ var AboutReaderListener = {
addMessageListener("Reader:PushState", this);
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
switch (message.name) {
case "Reader:ToggleReaderMode":
if (!this.isAboutReader) {
@@ -294,7 +294,7 @@ var AboutReaderListener = {
return content.document.documentURI.startsWith("about:reader");
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (aEvent.originalTarget.defaultView != content) {
return;
}
@@ -344,7 +344,7 @@ var AboutReaderListener = {
* this is a suitable document). Calling it on things which won't be
* painted is not going to work.
*/
- updateReaderButton: function(forceNonArticle) {
+ updateReaderButton(forceNonArticle) {
if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader ||
!content || !(content.document instanceof content.HTMLDocument) ||
content.document.mozSyntheticDocument) {
@@ -354,14 +354,14 @@ var AboutReaderListener = {
this.scheduleReadabilityCheckPostPaint(forceNonArticle);
},
- cancelPotentialPendingReadabilityCheck: function() {
+ cancelPotentialPendingReadabilityCheck() {
if (this._pendingReadabilityCheck) {
removeEventListener("MozAfterPaint", this._pendingReadabilityCheck);
delete this._pendingReadabilityCheck;
}
},
- scheduleReadabilityCheckPostPaint: function(forceNonArticle) {
+ scheduleReadabilityCheckPostPaint(forceNonArticle) {
if (this._pendingReadabilityCheck) {
// We need to stop this check before we re-add one because we don't know
// if forceNonArticle was true or false last time.
@@ -371,7 +371,7 @@ var AboutReaderListener = {
addEventListener("MozAfterPaint", this._pendingReadabilityCheck);
},
- onPaintWhenWaitedFor: function(forceNonArticle, event) {
+ onPaintWhenWaitedFor(forceNonArticle, event) {
// In non-e10s, we'll get called for paints other than ours, and so it's
// possible that this page hasn't been laid out yet, in which case we
// should wait until we get an event that does relate to our layout. We
@@ -401,18 +401,18 @@ var ContentSearchMediator = {
"about:newtab",
]),
- init: function(chromeGlobal) {
+ init(chromeGlobal) {
chromeGlobal.addEventListener("ContentSearchClient", this, true, true);
addMessageListener("ContentSearch", this);
},
- handleEvent: function(event) {
+ handleEvent(event) {
if (this._contentWhitelisted) {
this._sendMsg(event.detail.type, event.detail.data);
}
},
- receiveMessage: function(msg) {
+ receiveMessage(msg) {
if (msg.data.type == "AddToWhitelist") {
for (let uri of msg.data.data) {
this.whitelist.add(uri);
@@ -429,18 +429,18 @@ var ContentSearchMediator = {
return this.whitelist.has(content.document.documentURI);
},
- _sendMsg: function(type, data = null) {
+ _sendMsg(type, data = null) {
sendAsyncMessage("ContentSearch", {
- type: type,
- data: data,
+ type,
+ data,
});
},
- _fireEvent: function(type, data = null) {
+ _fireEvent(type, data = null) {
let event = Cu.cloneInto({
detail: {
- type: type,
- data: data,
+ type,
+ data,
},
}, content);
content.dispatchEvent(new content.CustomEvent("ContentSearchService",
@@ -450,7 +450,7 @@ var ContentSearchMediator = {
ContentSearchMediator.init(this);
var PageStyleHandler = {
- init: function() {
+ init() {
addMessageListener("PageStyle:Switch", this);
addMessageListener("PageStyle:Disable", this);
addEventListener("pageshow", () => this.sendStyleSheetInfo());
@@ -460,23 +460,23 @@ var PageStyleHandler = {
return docShell.contentViewer;
},
- sendStyleSheetInfo: function() {
+ sendStyleSheetInfo() {
let filteredStyleSheets = this._filterStyleSheets(this.getAllStyleSheets());
sendAsyncMessage("PageStyle:StyleSheets", {
- filteredStyleSheets: filteredStyleSheets,
+ filteredStyleSheets,
authorStyleDisabled: this.markupDocumentViewer.authorStyleDisabled,
preferredStyleSheetSet: content.document.preferredStyleSheetSet
});
},
- getAllStyleSheets: function(frameset = content) {
+ getAllStyleSheets(frameset = content) {
let selfSheets = Array.slice(frameset.document.styleSheets);
let subSheets = Array.map(frameset.frames, frame => this.getAllStyleSheets(frame));
return selfSheets.concat(...subSheets);
},
- receiveMessage: function(msg) {
+ receiveMessage(msg) {
switch (msg.name) {
case "PageStyle:Switch":
this.markupDocumentViewer.authorStyleDisabled = false;
@@ -491,7 +491,7 @@ var PageStyleHandler = {
this.sendStyleSheetInfo();
},
- _stylesheetSwitchAll: function(frameset, title) {
+ _stylesheetSwitchAll(frameset, title) {
if (!title || this._stylesheetInFrame(frameset, title)) {
this._stylesheetSwitchFrame(frameset, title);
}
@@ -502,7 +502,7 @@ var PageStyleHandler = {
}
},
- _stylesheetSwitchFrame: function(frame, title) {
+ _stylesheetSwitchFrame(frame, title) {
var docStyleSheets = frame.document.styleSheets;
for (let i = 0; i < docStyleSheets.length; ++i) {
@@ -515,11 +515,11 @@ var PageStyleHandler = {
}
},
- _stylesheetInFrame: function(frame, title) {
+ _stylesheetInFrame(frame, title) {
return Array.some(frame.document.styleSheets, (styleSheet) => styleSheet.title == title);
},
- _filterStyleSheets: function(styleSheets) {
+ _filterStyleSheets(styleSheets) {
let result = [];
for (let currentStyleSheet of styleSheets) {
@@ -661,13 +661,13 @@ let PrerenderContentHandler = {
sendAsyncMessage("Prerender:Request", {
href: aHref.spec,
referrer: aReferrer ? aReferrer.spec : null,
- id: id,
+ id,
});
this._pending.push({
href: aHref,
referrer: aReferrer,
- id: id,
+ id,
success: null,
failure: null,
});
@@ -699,12 +699,12 @@ if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
}
var WebBrowserChrome = {
- onBeforeLinkTraversal: function(originalTarget, linkURI, linkNode, isAppTab) {
+ onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
return BrowserUtils.onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab);
},
// Check whether this URI should load in the current process
- shouldLoadURI: function(aDocShell, aURI, aReferrer) {
+ shouldLoadURI(aDocShell, aURI, aReferrer) {
if (!E10SUtils.shouldLoadURI(aDocShell, aURI, aReferrer)) {
E10SUtils.redirectLoad(aDocShell, aURI, aReferrer);
return false;
@@ -713,23 +713,23 @@ var WebBrowserChrome = {
return true;
},
- shouldLoadURIInThisProcess: function(aURI) {
+ shouldLoadURIInThisProcess(aURI) {
return E10SUtils.shouldLoadURIInThisProcess(aURI);
},
// Try to reload the currently active or currently loading page in a new process.
- reloadInFreshProcess: function(aDocShell, aURI, aReferrer) {
+ reloadInFreshProcess(aDocShell, aURI, aReferrer) {
E10SUtils.redirectLoad(aDocShell, aURI, aReferrer, true);
return true;
},
- startPrerenderingDocument: function(aHref, aReferrer) {
+ startPrerenderingDocument(aHref, aReferrer) {
if (PrerenderContentHandler.initialized) {
PrerenderContentHandler.startPrerenderingDocument(aHref, aReferrer);
}
},
- shouldSwitchToPrerenderedDocument: function(aHref, aReferrer, aSuccess, aFailure) {
+ shouldSwitchToPrerenderedDocument(aHref, aReferrer, aSuccess, aFailure) {
if (PrerenderContentHandler.initialized) {
return PrerenderContentHandler.shouldSwitchToPrerenderedDocument(
aHref, aReferrer, aSuccess, aFailure);
@@ -747,7 +747,7 @@ if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
var DOMFullscreenHandler = {
- init: function() {
+ init() {
addMessageListener("DOMFullscreen:Entered", this);
addMessageListener("DOMFullscreen:CleanUp", this);
addEventListener("MozDOMFullscreen:Request", this);
@@ -765,7 +765,7 @@ var DOMFullscreenHandler = {
.getInterface(Ci.nsIDOMWindowUtils);
},
- receiveMessage: function(aMessage) {
+ receiveMessage(aMessage) {
let windowUtils = this._windowUtils;
switch (aMessage.name) {
case "DOMFullscreen:Entered": {
@@ -793,7 +793,7 @@ var DOMFullscreenHandler = {
}
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "MozDOMFullscreen:Request": {
sendAsyncMessage("DOMFullscreen:Request");
diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml
index f105ad15d024..2ccf6d8add39 100644
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -566,18 +566,18 @@
// count of open requests (should always be 0 or 1)
mRequestCount: 0,
- destroy: function() {
+ destroy() {
delete this.mTab;
delete this.mBrowser;
delete this.mTabBrowser;
},
- _callProgressListeners: function() {
+ _callProgressListeners() {
Array.unshift(arguments, this.mBrowser);
return this.mTabBrowser._callProgressListeners.apply(this.mTabBrowser, arguments);
},
- _shouldShowProgress: function(aRequest) {
+ _shouldShowProgress(aRequest) {
if (this.mBlank)
return false;
@@ -591,9 +591,9 @@
return true;
},
- onProgressChange: function(aWebProgress, aRequest,
- aCurSelfProgress, aMaxSelfProgress,
- aCurTotalProgress, aMaxTotalProgress) {
+ onProgressChange(aWebProgress, aRequest,
+ aCurSelfProgress, aMaxSelfProgress,
+ aCurTotalProgress, aMaxTotalProgress) {
this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0;
if (!this._shouldShowProgress(aRequest))
@@ -608,15 +608,15 @@
aCurTotalProgress, aMaxTotalProgress]);
},
- onProgressChange64: function(aWebProgress, aRequest,
- aCurSelfProgress, aMaxSelfProgress,
- aCurTotalProgress, aMaxTotalProgress) {
+ onProgressChange64(aWebProgress, aRequest,
+ aCurSelfProgress, aMaxSelfProgress,
+ aCurTotalProgress, aMaxTotalProgress) {
return this.onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
aMaxTotalProgress);
},
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
+ onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
if (!aRequest)
return;
@@ -757,8 +757,8 @@
this.mStatus = aStatus;
},
- onLocationChange: function(aWebProgress, aRequest, aLocation,
- aFlags) {
+ onLocationChange(aWebProgress, aRequest, aLocation,
+ aFlags) {
// OnLocationChange is called for both the top-level content
// and the subframes.
let topLevel = aWebProgress.isTopLevel;
@@ -838,7 +838,7 @@
}
},
- onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
+ onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {
if (this.mBlank)
return;
@@ -848,17 +848,17 @@
this.mMessage = aMessage;
},
- onSecurityChange: function(aWebProgress, aRequest, aState) {
+ onSecurityChange(aWebProgress, aRequest, aState) {
this._callProgressListeners("onSecurityChange",
[aWebProgress, aRequest, aState]);
},
- onRefreshAttempted: function(aWebProgress, aURI, aDelay, aSameURI) {
+ onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) {
return this._callProgressListeners("onRefreshAttempted",
[aWebProgress, aURI, aDelay, aSameURI]);
},
- QueryInterface: function(aIID) {
+ QueryInterface(aIID) {
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsIWebProgressListener2) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
@@ -2072,7 +2072,7 @@
// No preloaded browser found, create one.
browser = this._createBrowser({permanentKey: aTab.permanentKey,
remoteType,
- uriIsAboutBlank: uriIsAboutBlank,
+ uriIsAboutBlank,
userContextId: aParams.userContextId,
relatedBrowser: aParams.relatedBrowser,
opener: aParams.opener,
@@ -2124,7 +2124,7 @@
var evt = new CustomEvent("TabBrowserInserted", { bubbles: true, detail: {} });
aTab.dispatchEvent(evt);
- return { usingPreloadedContent: usingPreloadedContent };
+ return { usingPreloadedContent };
]]>