Browse Source

[Pale-Moon] Issue #1737 - Part 8: Phase 1 proofread + adjust for updated code style

pull/24/head
Pale Moon 2 years ago committed by Roy Tam
parent
commit
054a3fb4a5
  1. 2
      application/palemoon/base/content/aboutDialog.js
  2. 2
      application/palemoon/base/content/browser-addons.js
  3. 5
      application/palemoon/base/content/browser-fullScreen.js
  4. 3
      application/palemoon/base/content/browser-gestureSupport.js
  5. 12
      application/palemoon/base/content/browser-menudragging.js
  6. 3
      application/palemoon/base/content/browser-places.js
  7. 3
      application/palemoon/base/content/browser-tabPreviews.js
  8. 7
      application/palemoon/base/content/browser-thumbnails.js
  9. 258
      application/palemoon/base/content/browser.js
  10. 16
      application/palemoon/base/content/content.js
  11. 34
      application/palemoon/base/content/nsContextMenu.js
  12. 16
      application/palemoon/base/content/openLocation.js
  13. 23
      application/palemoon/base/content/padlock.js
  14. 3
      application/palemoon/base/content/safeMode.js
  15. 18
      application/palemoon/base/content/sanitize.js
  16. 19
      application/palemoon/base/content/sanitizeDialog.js
  17. 9
      application/palemoon/base/content/utilityOverlay.js
  18. 8
      application/palemoon/components/distribution.js
  19. 2
      application/palemoon/components/nsAboutRedirector.js
  20. 17
      application/palemoon/components/nsBrowserContentHandler.js
  21. 53
      application/palemoon/components/nsBrowserGlue.js

2
application/palemoon/base/content/aboutDialog.js

@ -32,7 +32,7 @@ function init(aEvent)
Components.utils.reportError(ex);
}
}
} catch (e) {
} catch(e) {
// Pref is unset
}

2
application/palemoon/base/content/browser-addons.js

@ -312,7 +312,7 @@ var LightWeightThemeWebInstaller = {
},
get _manager () {
var temp = { };
var temp = {};
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
delete this._manager;
return this._manager = temp.LightweightThemeManager;

5
application/palemoon/base/content/browser-fullScreen.js

@ -268,12 +268,11 @@ var FullScreen = {
let host = null;
try {
host = uri.host;
} catch(e) {
}
} catch(e) {}
let hostLabel = document.getElementById("full-screen-domain-text");
if (host) {
// Document's principal's URI has a host. Display a warning including the hostname.
let utils = { };
let utils = {};
Cu.import("resource://gre/modules/DownloadUtils.jsm", utils);
let displayHost = utils.DownloadUtils.getURIHost(uri.spec)[0];
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");

3
application/palemoon/base/content/browser-gestureSupport.js

@ -296,8 +296,7 @@ var gGestureSupport = {
let command;
try {
command = this._getPref(aGesture.concat(subCombo).join("."));
} catch(e) {
}
} catch(e) {}
if (command) {
return command;

12
application/palemoon/base/content/browser-menudragging.js

@ -125,8 +125,7 @@ var browserMenuDragging = {
if (!!parentPopup.openNode) {
try {
parentPopup.openNode.hidePopup();
} catch(e) {
}
} catch(e) {}
}
parentPopup.openNode = menupopup;
@ -318,8 +317,7 @@ var browserMenuDragging = {
default:
return xpPref.setBoolPref(aPrefString, aValue); break;
}
} catch(e) {
}
} catch(e) {}
return null;
},
@ -328,8 +326,7 @@ var browserMenuDragging = {
var pbi = Components.classes["@mozilla.org/preferences;1"].
getService(Components.interfaces.nsIPrefBranch2);
pbi.addObserver(aObserver.domain, aObserver, false);
} catch(e) {
}
} catch(e) {}
},
removePrefListener: function(aObserver) {
@ -337,8 +334,7 @@ var browserMenuDragging = {
var pbi = Components.classes["@mozilla.org/preferences;1"].
getService(Components.interfaces.nsIPrefBranch2);
pbi.removeObserver(aObserver.domain, aObserver);
} catch(e) {
}
} catch(e) {}
},
PrefListener:{

3
application/palemoon/base/content/browser-places.js

@ -299,8 +299,7 @@ var PlacesCommandHook = {
title = title || url.spec;
description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
charset = webNav.document.characterSet;
} catch(e) {
}
} catch(e) {}
if (aShowEditUI) {
// If we bookmark the page here (i.e. page was not "starred" already)

3
application/palemoon/base/content/browser-tabPreviews.js

@ -725,8 +725,7 @@ var allTabs = {
let tabstring = tab.linkedBrowser.currentURI.spec;
try {
tabstring = decodeURI(tabstring);
} catch (e) {
}
} catch(e) {}
tabstring = tab.label + " " + tab.label.toLocaleLowerCase() + " " + tabstring;
for (let i = 0; i < filter.length; i++) {
matches += tabstring.includes(filter[i]);

7
application/palemoon/base/content/browser-thumbnails.js

@ -39,8 +39,7 @@ var gBrowserThumbnails = {
try {
if (Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled"))
return;
} catch (e) {
}
} catch(e) {}
PageThumbs.addExpirationFilter(this);
gBrowser.addTabsProgressListener(this);
@ -182,7 +181,7 @@ var gBrowserThumbnails = {
let httpChannel;
try {
httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
} catch (e) {
} catch(e) {
// Not an HTTP channel.
}
@ -192,7 +191,7 @@ var gBrowserThumbnails = {
if (Math.floor(httpChannel.responseStatus / 100) != 2) {
return false;
}
} catch (e) {
} catch(e) {
// Can't get response information from the httpChannel
// because mResponseHead is not available.
return false;

258
application/palemoon/base/content/browser.js

@ -77,7 +77,7 @@ XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
});
this.__defineGetter__("AddonManager", function() {
let tmp = { };
let tmp = {};
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
return this.AddonManager = tmp.AddonManager;
});
@ -95,13 +95,13 @@ XPCOMUtils.defineLazyModuleGetter(this, "Weave", "resource://services-sync/main.
#endif
XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
let tmp = { };
let tmp = {};
Cu.import("resource:///modules/PopupNotifications.jsm", tmp);
try {
return new tmp.PopupNotifications(gBrowser,
document.getElementById("notification-popup"),
document.getElementById("notification-popup-box"));
} catch (ex) {
} catch(ex) {
Cu.reportError(ex);
return null;
}
@ -181,8 +181,9 @@ function pageShowEventHandlers(persisted) {
// The PluginClickToPlay events are not fired when navigating using the
// BF cache. |persisted| is true when the page is loaded from the
// BF cache, so this code reshows the notification if necessary.
if (persisted)
if (persisted) {
gPluginHandler.reshowClickToPlayNotification();
}
}
function UpdateBackForwardCommands(aWebNavigation) {
@ -673,8 +674,7 @@ var gPopupBlockerObserver = {
var host = "";
try {
host = gBrowser.currentURI.host;
} catch(e) {
}
} catch(e) {}
var bundlePreferences = document.getElementById("bundle_preferences");
var params = { blockVisible : false,
@ -1041,8 +1041,7 @@ var gBrowserInit = {
// so that we don't disrupt startup
try {
gBrowser.loadTabs(specs, false, true);
} catch(e) {
}
} catch(e) {}
} else if (uriToLoad instanceof XULElement) {
// swap the given tab with the default about:blank tab and then close
// the original tab in the other window.
@ -1159,7 +1158,7 @@ var gBrowserInit = {
// Bug 666804 - NetworkPrioritizer support for e10s
if (!gMultiProcessBrowser) {
let NP = { };
let NP = {};
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
NP.trackBrowserWindow(window);
}
@ -1197,7 +1196,7 @@ var gBrowserInit = {
setTimeout(function() {
try {
Services.logins;
} catch (ex) {
} catch(ex) {
Cu.reportError(ex);
}
}, 3000);
@ -1299,7 +1298,7 @@ var gBrowserInit = {
try {
const startupCrashEndDelay = 30 * 1000;
setTimeout(Services.startup.trackStartupCrashEnd, startupCrashEndDelay);
} catch (ex) {
} catch(ex) {
Cu.reportError("Could not end startup crash tracking: " + ex);
}
@ -1372,8 +1371,7 @@ var gBrowserInit = {
try {
gBrowser.removeProgressListener(window.XULBrowserWindow);
gBrowser.removeTabsProgressListener(window.TabsProgressListener);
} catch (ex) {
}
} catch(ex) {}
BookmarkingUI.uninit();
@ -1431,13 +1429,13 @@ var gBrowserInit = {
try {
gPrefService.removeObserver(gURLBarSettings.prefSuggest, gURLBarSettings);
gPrefService.removeObserver(gURLBarSettings.prefKeyword, gURLBarSettings);
} catch (ex) {
} catch(ex) {
Cu.reportError(ex);
}
try {
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
} catch (ex) {
} catch(ex) {
Cu.reportError(ex);
}
@ -1507,8 +1505,7 @@ var gBrowserInit = {
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
.getService(Ci.nsIMacDockSupport);
dockSupport.dockMenu = nativeMenu;
} catch (e) {
}
} catch(e) {}
}
}
@ -1608,55 +1605,55 @@ var nonBrowserWindowShutdown = gBrowserInit.nonBrowserWindowShutdown.bind(
function HandleAppCommandEvent(evt) {
switch (evt.command) {
case "Back":
BrowserBack();
break;
case "Forward":
BrowserForward();
break;
case "Reload":
BrowserReloadSkipCache();
break;
case "Stop":
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true") {
BrowserStop();
}
break;
case "Search":
BrowserSearch.webSearch();
break;
case "Bookmarks":
toggleSidebar('viewBookmarksSidebar');
break;
case "Home":
BrowserHome();
break;
case "New":
BrowserOpenTab();
break;
case "Close":
BrowserCloseTabOrWindow();
break;
case "Find":
gFindBar.onFindCommand();
break;
case "Help":
openHelpLink('firefox-help');
break;
case "Open":
BrowserOpenFileWindow();
break;
case "Print":
PrintUtils.print();
break;
case "Save":
saveDocument(window.content.document);
break;
case "SendMail":
MailIntegration.sendLinkForWindow(window.content);
break;
default:
return;
case "Back":
BrowserBack();
break;
case "Forward":
BrowserForward();
break;
case "Reload":
BrowserReloadSkipCache();
break;
case "Stop":
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true") {
BrowserStop();
}
break;
case "Search":
BrowserSearch.webSearch();
break;
case "Bookmarks":
toggleSidebar('viewBookmarksSidebar');
break;
case "Home":
BrowserHome();
break;
case "New":
BrowserOpenTab();
break;
case "Close":
BrowserCloseTabOrWindow();
break;
case "Find":
gFindBar.onFindCommand();
break;
case "Help":
openHelpLink('firefox-help');
break;
case "Open":
BrowserOpenFileWindow();
break;
case "Print":
PrintUtils.print();
break;
case "Save":
saveDocument(window.content.document);
break;
case "SendMail":
MailIntegration.sendLinkForWindow(window.content);
break;
default:
return;
}
evt.stopPropagation();
evt.preventDefault();
@ -1692,8 +1689,7 @@ function BrowserForward(aEvent) {
if (where == "current") {
try {
gBrowser.goForward();
} catch(ex) {
}
} catch(ex) {}
} else {
duplicateTabIn(gBrowser.selectedTab, where, 1);
}
@ -1705,8 +1701,7 @@ function BrowserBack(aEvent) {
if (where == "current") {
try {
gBrowser.goBack();
} catch(ex) {
}
} catch(ex) {}
} else {
duplicateTabIn(gBrowser.selectedTab, where, -1);
}
@ -1715,24 +1710,24 @@ function BrowserBack(aEvent) {
function BrowserHandleBackspace()
{
switch (gPrefService.getIntPref("browser.backspace_action")) {
case 0:
BrowserBack();
break;
case 1:
goDoCommand("cmd_scrollPageUp");
break;
case 0:
BrowserBack();
break;
case 1:
goDoCommand("cmd_scrollPageUp");
break;
}
}
function BrowserHandleShiftBackspace()
{
switch (gPrefService.getIntPref("browser.backspace_action")) {
case 0:
BrowserForward();
break;
case 1:
goDoCommand("cmd_scrollPageDown");
break;
case 0:
BrowserForward();
break;
case 1:
goDoCommand("cmd_scrollPageDown");
break;
}
}
@ -1817,8 +1812,7 @@ function loadOneOrMoreURIs(aURIString) {
// so that we don't disrupt startup
try {
gBrowser.loadTabs(aURIString.split("|"), false, true);
} catch(e) {
}
} catch(e) {}
}
function focusAndSelectUrlBar() {
@ -1901,8 +1895,7 @@ var gLastOpenDirectory = {
Ci.nsILocalFile);
if (!this._lastDir.exists())
this._lastDir = null;
} catch(e) {
}
} catch(e) {}
}
return this._lastDir;
},
@ -1939,8 +1932,7 @@ function BrowserOpenFileWindow() {
gLastOpenDirectory.path =
fp.file.parent.QueryInterface(Ci.nsILocalFile);
}
} catch (ex) {
}
} catch(ex) {}
openUILinkIn(fp.fileURL.spec, "current");
}
};
@ -1952,8 +1944,7 @@ function BrowserOpenFileWindow() {
nsIFilePicker.filterHTML);
fp.displayDirectory = gLastOpenDirectory.path;
fp.open(fpCallback);
} catch (ex) {
}
} catch(ex) {}
}
function BrowserCloseTabOrWindow() {
@ -1998,8 +1989,7 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
originPrincipal: originPrincipal,
triggeringPrincipal: triggeringPrincipal,
forceAboutBlankViewerInCurrent: forceAboutBlankViewerInCurrent });
} catch (e) {
}
} catch(e) {}
}
/**
@ -2069,8 +2059,7 @@ function getShortcutOrURIAndPostData(url, callback = null) {
try {
// makeURI() throws if URI is invalid.
uri = makeURI(shortcutURL);
} catch (ex) {
}
} catch(ex) {}
if (uri) {
// Try to get the saved character-set.
@ -2177,8 +2166,7 @@ function readFromClipboard()
data = data.value.QueryInterface(Components.interfaces.nsISupportsString);
url = data.data.substring(0, dataLen.value / 2);
}
} catch (ex) {
}
} catch(ex) {}
return url;
}
@ -2255,8 +2243,7 @@ function URLBarSetURI(aURI) {
// Strip off "wyciwyg://" and passwords for the location bar
try {
uri = Services.uriFixup.createExposableURI(uri);
} catch (e) {
}
} catch(e) {}
// Replace initial page URIs with an empty string
// only if there's no opener (bug 370555).
@ -2306,8 +2293,7 @@ function losslessDecodeURI(aURI) {
// by the location bar (bug 410726).
.replace(/%(?!3B|2F|3F|3A|40|26|3D|2B|24|2C|23)|[\r\n\t]/ig,
encodeURIComponent);
} catch (e) {
}
} catch(e) {}
}
}
@ -2554,7 +2540,7 @@ var BrowserOnClick = {
case 1 : // Pre-populate
params.location = aOwnerDoc.location.href;
}
} catch (e) {
} catch(e) {
Components.utils.reportError("Couldn't get ssl_override pref: " + e);
}
@ -2692,13 +2678,11 @@ function BrowserReloadWithFlags(reloadFlags) {
var sh = webNav.sessionHistory;
if (sh)
webNav = sh.QueryInterface(nsIWebNavigation);
} catch(e) {
}
} catch(e) {}
try {
webNav.reload(reloadFlags);
} catch(e) {
}
} catch(e) {}
}
var PrintPreviewListener = {
@ -2757,7 +2741,7 @@ var PrintPreviewListener = {
},
_hideChrome: function() {
this._chromeState = { };
this._chromeState = {};
var sidebar = document.getElementById("sidebar-box");
this._chromeState.sidebarOpen = !sidebar.hidden;
@ -2876,7 +2860,7 @@ function openHomeDialog(aURL) {
homepageStr.data = aURL;
gPrefService.setComplexValue("browser.startup.homepage",
Components.interfaces.nsISupportsString, homepageStr);
} catch (ex) {
} catch(ex) {
dump("Failed to set the home page.\n"+ex+"\n");
}
}
@ -2884,20 +2868,19 @@ function openHomeDialog(aURL) {
var bookmarksButtonObserver = {
onDrop: function(aEvent) {
let name = { };
let name = {};
let url = browserDragAndDrop.drop(aEvent, name);
try {
PlacesUIUtils.showBookmarkDialog({ action: "add"
, type: "bookmark"
, uri: makeURI(url)
, title: name
, hiddenRows: [ "description"
, "location"
, "loadInSidebar"
, "keyword" ]
PlacesUIUtils.showBookmarkDialog({ action: "add",
type: "bookmark",
uri: makeURI(url),
title: name,
hiddenRows: [ "description",
"location",
"loadInSidebar",
"keyword" ]
}, window);
} catch(ex) {
}
} catch(ex) {}
},
onDragOver: function(aEvent) {
@ -2914,8 +2897,7 @@ var newTabButtonObserver = {
browserDragAndDrop.dragOver(aEvent);
},
onDragExit: function(aEvent) {
},
onDragExit: function(aEvent) {},
onDrop: function(aEvent) {
let links = browserDragAndDrop.dropLinks(aEvent);
@ -2936,8 +2918,7 @@ var newWindowButtonObserver = {
browserDragAndDrop.dragOver(aEvent);
},
onDragExit: function(aEvent) {
},
onDragExit: function(aEvent) {},
onDrop: function(aEvent) {
let links = browserDragAndDrop.dropLinks(aEvent);
@ -3495,8 +3476,9 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
// Hacky: update the PopupNotifications' object's reference to the iconBox,
// if it already exists, since it may have changed if the URL bar was
// added/removed.
if (!window.__lookupGetter__("PopupNotifications"))
if (!window.__lookupGetter__("PopupNotifications")) {
PopupNotifications.iconBox = document.getElementById("notification-popup-box");
}
}
PlacesToolbarHelper.customizeDone();
@ -4119,8 +4101,7 @@ var XULBrowserWindow = {
"<" + contentHost + "> but cached host is <" + this._host + ">.\n"
);
}
} catch (ex) {
}
} catch(ex) {}
#endif
return;
}
@ -4180,7 +4161,7 @@ var XULBrowserWindow = {
locationObj.host = location.host;
locationObj.hostname = location.hostname;
locationObj.port = location.port;
} catch (ex) {
} catch(ex) {
// Can sometimes throw if the URL being visited has no host/hostname,
// e.g. about:blank. The _state for these pages means we won't need these
// properties anyways, though.
@ -4608,8 +4589,9 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
// Empty the menu
for (var i = popup.childNodes.length-1; i >= 0; --i) {
var deadItem = popup.childNodes[i];
if (deadItem.hasAttribute("toolbarId"))
if (deadItem.hasAttribute("toolbarId")) {
popup.removeChild(deadItem);
}
}
var firstMenuItem = aInsertPoint || popup.firstChild;
@ -4729,8 +4711,9 @@ var AudioIndicator = {
},
observe: function(subject, topic, data) {
if (topic == "nsPref:changed")
if (topic == "nsPref:changed") {
this.syncUI();
}
},
_prefName: "browser.tabs.showAudioPlayingIcon"
@ -4774,8 +4757,9 @@ var TabsOnTop = {
},
observe: function(subject, topic, data) {
if (topic == "nsPref:changed")
if (topic == "nsPref:changed") {
this.syncUI();
}
},
_prefName: "browser.tabs.onTop"
@ -5086,8 +5070,7 @@ var gHomeButton = {
try {
url = gPrefService.getComplexValue(this.prefDomain,
Components.interfaces.nsIPrefLocalizedString).data;
} catch(e) {
}
} catch(e) {}
// use this if we can't find the pref
if (!url) {
@ -5337,7 +5320,7 @@ function contentAreaClick(event, isPanelClick) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
PlacesUIUtils.markPageAsFollowedLink(href);
}
} catch (ex) {
} catch(ex) {
// Skip invalid URIs.
}
}
@ -5551,8 +5534,7 @@ function UpdateCharsetDetector(target) {
try {
prefvalue = gPrefService.getComplexValue("intl.charset.detector", Ci.nsIPrefLocalizedString).data;
} catch (ex) {
}
} catch(ex) {}
if (!prefvalue) {
prefvalue = "off";
@ -5760,8 +5742,7 @@ var BrowserOffline = {
if (cancelGoOffline.data) {
return false;
}
} catch (ex) {
}
} catch(ex) {}
return true;
},
@ -6420,9 +6401,10 @@ function AddKeywordForSearchField() {
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
} else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) {
for (var j=0; j < el.options.length; j++) {
if (el.options[j].selected)
if (el.options[j].selected) {
formData.push(escapeNameValuePair(el.name, el.options[j].value,
isURLEncoded));
}
}
}
}
@ -6797,7 +6779,7 @@ var gIdentityHandler = {
try {
let baseDomain = Services.eTLD.getBaseDomainFromHost(this._lastLocation.hostname);
return this._IDNService.convertToDisplayIDN(baseDomain, {});
} catch (e) {
} catch(e) {
// If something goes wrong (e.g. hostname is an IP address) just fall back
// to the full domain.
return this._lastLocation.hostname;

16
application/palemoon/base/content/content.js

@ -67,8 +67,7 @@ var handleContentContextMenu = function (event) {
let plugin = null;
try {
plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
} catch(e) {
}
} catch(e) {}
if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
// Don't open a context menu for plugins.
return;
@ -81,7 +80,7 @@ var handleContentContextMenu = function (event) {
return;
}
let addonInfo = { };
let addonInfo = {};
let subject = {
event: event,
addonInfo: addonInfo,
@ -130,15 +129,12 @@ var handleContentContextMenu = function (event) {
imageCache.findEntryProperties(event.target.currentURI, doc);
try {
contentType = props.get("type", Ci.nsISupportsCString).data;
} catch(e) {
}
} catch(e) {}
try {
contentDisposition =
props.get("content-disposition", Ci.nsISupportsCString).data;
} catch(e) {
}
} catch(e) {
}
} catch(e) {}
} catch(e) {}
}
let selectionInfo = BrowserUtils.getSelectionDetails(content);
@ -178,5 +174,5 @@ addMessageListener("Finder:Initialize", function() {
});
addEventListener("DOMWebNotificationClicked", function(event) {
sendAsyncMessage("DOMWebNotificationClicked", { });
sendAsyncMessage("DOMWebNotificationClicked", {});
}, false);

34
application/palemoon/base/content/nsContextMenu.js

@ -30,8 +30,7 @@ nsContextMenu.prototype = {
this.ellipsis = "\u2026";
try {
this.ellipsis = gPrefService.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
} catch(e) {
}
} catch(e) {}
this.isContentSelected = this.isContentSelection();
this.onPlainTextLink = false;
@ -87,16 +86,14 @@ nsContextMenu.prototype = {
if (/^(?:https?|ftp):/i.test(linkText)) {
try {
uri = makeURI(linkText);
} catch(ex) {
}
} catch(ex) {}
} else if (/^[-a-z\d\.]+\.[-a-z\d]{2,}[-_=~:#%&\?\w\/\.]*$/i.test(linkText)) {
// Check if this could be a valid url, just missing the protocol.
let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
.getService(Ci.nsIURIFixup);
try {
uri = uriFixup.createFixupURI(linkText, uriFixup.FIXUP_FLAG_NONE);
} catch(ex) {
}
} catch(ex) {}
}
if (uri && uri.host) {
@ -438,7 +435,7 @@ nsContextMenu.prototype = {
return gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
let inspector = toolbox.getCurrentPanel();
this.browser.messageManager.sendAsyncMessage("debug:inspect", { }, { node: this.target });
this.browser.messageManager.sendAsyncMessage("debug:inspect", {}, { node: this.target });
inspector.walker.findInspectingNode().then(nodeFront => {
inspector.selection.setNodeFront(nodeFront, "browser-context-menu");
});
@ -554,7 +551,7 @@ nsContextMenu.prototype = {
try {
computedURL = this.getComputedURL(bodyElt, "background-image");
this._hasMultipleBGImages = false;
} catch (e) {
} catch(e) {
this._hasMultipleBGImages = true;
}
if (computedURL) {
@ -613,8 +610,7 @@ nsContextMenu.prototype = {
// this.principal.checkMayLoad(this.linkURI, false, true);
this.linkDownload = elem.download;
}
} catch(ex) {
}
} catch(ex) {}
}
// Background image? Don't bother if we've already found a
@ -917,8 +913,7 @@ nsContextMenu.prototype = {
let url = uri.QueryInterface(Ci.nsIURL);
if (url.fileBaseName)
name = decodeURI(url.fileBaseName) + ".jpg";
} catch (e) {
}
} catch(e) {}
if (!name) {
name = "snapshot.jpg";
}
@ -1029,7 +1024,7 @@ nsContextMenu.prototype = {
// nsIExternalHelperAppService.doContent, which will wait for the
// appropriate MIME-type headers and then prompt the user with a
// file picker
function saveAsListener() { }
function saveAsListener() {}
saveAsListener.prototype = {
extListener: null,
@ -1059,8 +1054,7 @@ nsContextMenu.prototype = {
const promptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"].
getService(Ci.nsIPromptService);
promptSvc.alert(doc.defaultView, title, msg);
} catch (ex) {
}
} catch(ex) {}
return;
}
@ -1091,7 +1085,7 @@ nsContextMenu.prototype = {
}
}
function callbacks() { }
function callbacks() {}
callbacks.prototype = {
getInterface: function(aIID) {
@ -1111,7 +1105,7 @@ nsContextMenu.prototype = {
// if it we don't have the headers after a short time, the user
// won't have received any feedback from their click. that's bad. so
// we give up waiting for the filename.
function timerCallback() { }
function timerCallback() {}
timerCallback.prototype = {
notify: function(aTimer) {
@ -1468,15 +1462,13 @@ nsContextMenu.prototype = {
try {
locale = gPrefService.getComplexValue("intl.accept_languages",
Ci.nsIPrefLocalizedString).data;
} catch(e) {
}
} catch(e) {}
var version = "-";
try {
version = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULAppInfo).version;
} catch(e) {
}
} catch(e) {}
uri = uri.replace(/%LOCALE%/, escape(locale)).replace(/%VERSION%/, version);

16
application/palemoon/base/content/openLocation.js

@ -5,9 +5,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var browser;
var dialog = { };
var dialog = {};
var pref = null;
var openLocationModule = { };
var openLocationModule = {};
try {
pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
@ -37,8 +37,7 @@ function onLoad() {
if (useAutoFill) {
dialog.input.setAttribute("completedefaultindex", "true");
}
} catch(ex) {
}
} catch(ex) {}
try {
var value = pref.getIntPref("general.open_location.last_window_choice");
@ -47,8 +46,7 @@ function onLoad() {
dialog.openWhereList.selectedItem = element;
}
dialog.input.value = gOpenLocationLastURL.value;
} catch(ex) {
}
} catch(ex) {}
if (dialog.input.value) {
// XXX should probably be done automatically
@ -109,8 +107,7 @@ function openLocation(openData) {
browser.delayedOpenTab(openData.url, null, null, openData.postData, true);
break;
}
} catch(ex) {
}
} catch(ex) {}
if (pref) {
gOpenLocationLastURL.value = dialog.input.value;
@ -147,6 +144,5 @@ function onChooseFile()
nsIFilePicker.filterImages | nsIFilePicker.filterXML |
nsIFilePicker.filterHTML);
fp.open(fpCallback);
} catch(ex) {
}
} catch(ex) {}
}

23
application/palemoon/base/content/padlock.js

@ -11,10 +11,10 @@ var padlock_PadLock =
event.stopPropagation();
gIdentityHandler.handleMoreInfoClick(event);
},
onStateChange: function() { },
onProgressChange: function() { },
onLocationChange: function() { },
onStatusChange: function() { },
onStateChange: function() {},
onProgressChange: function() {},
onLocationChange: function() {},
onStatusChange: function() {},
onSecurityChange: function(aCallerWebProgress, aRequestWithState, aState) {
// aState is defined as a bitmask that may be extended in the future.
// We filter out any unknown bits before testing for known values.
@ -67,8 +67,7 @@ var padlock_PadLock =
// do not warn when using local protocols
is_insecure = false;
}
} catch(ex) {
}
} catch(ex) {}
let ub = document.getElementById("urlbar");
if (ub) {
@ -84,8 +83,7 @@ var padlock_PadLock =
padlock_PadLock.setPadlockLevel("padlock-ib", level);
padlock_PadLock.setPadlockLevel("padlock-ib-left", level);
padlock_PadLock.setPadlockLevel("padlock-ub-right", level);
} catch(e) {
}
} catch(e) {}
padlock_PadLock.setPadlockLevel("padlock-sb", level);
padlock_PadLock.setPadlockLevel("padlock-tab", level);
@ -203,8 +201,7 @@ var padlock_PadLock =
try {
// XXX should probably be done automatically
document.getElementById("urlbar").setAttribute("https_color", colshow);
} catch(e) {
}
} catch(e) {}
var lockenabled = padlock_PadLock.prefbranch.getBoolPref("shown");
var padshow = "";
@ -216,8 +213,7 @@ var padlock_PadLock =
document.getElementById("padlock-ib").setAttribute("padshow", padshow);
document.getElementById("padlock-ib-left").setAttribute("padshow", padshow);
document.getElementById("padlock-ub-right").setAttribute("padshow", padshow);
} catch(e) {
}
} catch(e) {}
document.getElementById("padlock-sb").setAttribute("padshow", padshow);
document.getElementById("padlock-tab").setAttribute("padshow", padshow);
@ -226,8 +222,7 @@ var padlock_PadLock =
document.getElementById("padlock-ib").setAttribute("padstyle", padstyle);
document.getElementById("padlock-ib-left").setAttribute("padstyle", padstyle);
document.getElementById("padlock-ub-right").setAttribute("padstyle", padstyle);
} catch(e) {
}
} catch(e) {}
document.getElementById("padlock-sb").setAttribute("padstyle", padstyle);
document.getElementById("padlock-tab").setAttribute("padstyle", padstyle);

3
application/palemoon/base/content/safeMode.js

@ -102,8 +102,7 @@ function onOK() {
// disableAddons will asynchronously restart the application
return false;
}
} catch(e) {
}
} catch(e) {}
restartApp();
return false;

18
application/palemoon/base/content/sanitize.js

@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/Console.jsm");
function Sanitizer() { }
function Sanitizer() {}
Sanitizer.prototype = {
// warning to the caller: this one may raise an exception (e.g. bug #265028)
@ -119,15 +119,13 @@ Sanitizer.prototype = {
// Cache doesn't consult timespan, nor does it have the
// facility for timespan-based eviction. Wipe it.
cache.clear();
} catch(er) {
}
} catch(er) {}
var imageCache = Cc["@mozilla.org/image/tools;1"].
getService(Ci.imgITools).getImgCacheForDocument(null);
try {
imageCache.clearCache(false); // true=chrome, false=content
} catch(er) {
}
} catch(er) {}
},
get canClear() {
@ -224,16 +222,14 @@ Sanitizer.prototype = {
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.notifyObservers(null, "browser:purge-session-history", "");
} catch(e) {
}
} catch(e) {}
// Clear last URL of the Open Web Location dialog
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
try {
prefs.clearUserPref("general.open_location.last_url");
} catch(e) {
}
} catch(e) {}
},
get canClear()
@ -304,14 +300,14 @@ Sanitizer.prototype = {
aCallback("formdata", aReason == 0 && count > 0, aArg);
}
};
FormHistory.count({ }, countDone);
FormHistory.count({}, countDone);
return false;
}
},
downloads: {
clear: Task.async(function* (range) {
let refObj = { };
let refObj = {};
try {
let filterByTime = null;
if (range) {

19
application/palemoon/base/content/sanitizeDialog.js

@ -111,7 +111,7 @@ var gSanitizePromptDialog = {
docElt.getButton("cancel").disabled = true;
try {
s.sanitize().then(window.close, window.close);
} catch (er) {
} catch(er) {
Components.utils.reportError("Exception during sanitize: " + er);
return true; // We *do* want to close immediately on error.
}
@ -164,8 +164,7 @@ var gSanitizePromptDialog = {
try {
document.documentElement.getButton("accept").disabled = !found;
} catch(e) {
}
} catch(e) {}
// Update the warning prompt if needed
this.prepareWarning(true);
@ -329,8 +328,8 @@ var gSanitizePromptDialog = {
// Now calculate the rows in the tree of the durations' start times. For
// each duration, we are looking for the node in the tree whose time is the
// smallest time greater than or equal to the duration's start time.
this.durationRowsToVals = { };
this.durationValsToRows = { };
this.durationRowsToVals = {};
this.durationValsToRows = {};
var view = this.placesTree.view;
// For all rows in the tree except the grippy row...
for (let i = 0; i < view.rowCount - 1; i++) {
@ -486,7 +485,7 @@ var gSanitizePromptDialog = {
try {
s.sanitize();
} catch (er) {
} catch(er) {
Components.utils.reportError("Exception during sanitize: " + er);
}
return true;
@ -592,8 +591,8 @@ var gContiguousSelectionTreeHelper = {
throw "contiguous selection tree helper: getGrippyRow called with " +
"multiple selection ranges";
}
var max = { };
sel.getRangeAt(0, { }, max);
var max = {};
sel.getRangeAt(0, {}, max);
return max.value + 1;
},
@ -822,8 +821,8 @@ var gContiguousSelectionTreeHelper = {
};
// No clicking headers to sort the tree or sort feedback on columns.
view.cycleHeader = function() { };
view.sortingChanged = function() { };
view.cycleHeader = function() {};