mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
[Pale-Moon] Issue #1737 - Part 8: Phase 1 proofread + adjust for updated code style
This commit is contained in:
parent
500d51dfc4
commit
054a3fb4a5
21 changed files with 221 additions and 292 deletions
|
|
@ -32,7 +32,7 @@ function init(aEvent)
|
|||
Components.utils.reportError(ex);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch(e) {
|
||||
// Pref is unset
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -296,8 +296,7 @@ var gGestureSupport = {
|
|||
let command;
|
||||
try {
|
||||
command = this._getPref(aGesture.concat(subCombo).join("."));
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
if (command) {
|
||||
return command;
|
||||
|
|
|
|||
|
|
@ -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:{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -102,8 +102,7 @@ function onOK() {
|
|||
// disableAddons will asynchronously restart the application
|
||||
return false;
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
restartApp();
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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() {};
|
||||
view.sortingChanged = function() {};
|
||||
|
||||
// Override a bunch of methods to account for the grippy row.
|
||||
|
||||
|
|
|
|||
|
|
@ -344,8 +344,7 @@ function openLinkIn(url, where, params) {
|
|||
if (where == "current") {
|
||||
try {
|
||||
uriObj = Services.io.newURI(url, null, null);
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
if (where == "current" && w.gBrowser.selectedTab.pinned) {
|
||||
|
|
@ -542,8 +541,7 @@ function isBidiEnabled() {
|
|||
rv = true;
|
||||
Services.prefs.setBoolPref("bidi.browser.ui", true);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
@ -863,8 +861,7 @@ function isValidFeed(aLink, aPrincipal, aIsFeed) {
|
|||
urlSecurityCheck(aLink.href, aPrincipal,
|
||||
Components.interfaces.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
|
||||
return type || "application/rss+xml";
|
||||
} catch(ex) {
|
||||
}
|
||||
} catch(ex) {}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ DistributionCustomizer.prototype = {
|
|||
}
|
||||
keys.sort();
|
||||
|
||||
let items = { };
|
||||
let items = {};
|
||||
let defaultItemId = -1;
|
||||
let maxItemId = -1;
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ DistributionCustomizer.prototype = {
|
|||
}
|
||||
|
||||
if (!items[iid]) {
|
||||
items[iid] = { };
|
||||
items[iid] = {};
|
||||
}
|
||||
if (keys.indexOf(keys[i] + "." + this._locale) >= 0) {
|
||||
items[iid][iprop] = this._ini.getString(section, keys[i] + "." +
|
||||
|
|
@ -283,7 +283,7 @@ DistributionCustomizer.prototype = {
|
|||
}
|
||||
defaults.setComplexValue("distribution.about",
|
||||
Ci.nsISupportsString, partnerAbout);
|
||||
} catch (e) {
|
||||
} catch(e) {
|
||||
/* ignore bad prefs due to bug 895473 and move on */
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
|
@ -365,7 +365,7 @@ function enumerate(UTF8Enumerator) {
|
|||
}
|
||||
|
||||
function enumToObject(UTF8Enumerator) {
|
||||
let ret = { };
|
||||
let ret = {};
|
||||
for (let i in enumerate(UTF8Enumerator)) {
|
||||
ret[i] = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const ALLOW_SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT;
|
|||
const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT;
|
||||
const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE;
|
||||
|
||||
function AboutRedirector() { }
|
||||
function AboutRedirector() {}
|
||||
AboutRedirector.prototype = {
|
||||
classDescription: "Browser about: Redirector",
|
||||
classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"),
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ function doSearch(searchTerm, cmdLine) {
|
|||
sa);
|
||||
}
|
||||
|
||||
function nsBrowserContentHandler() { }
|
||||
function nsBrowserContentHandler() {}
|
||||
nsBrowserContentHandler.prototype = {
|
||||
classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
|
||||
|
||||
|
|
@ -448,7 +448,7 @@ nsBrowserContentHandler.prototype = {
|
|||
cmdLine.preventDefault = true;
|
||||
}
|
||||
} catch(e) {
|
||||
Components.utils.reportError(e);
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -570,8 +570,7 @@ nsBrowserContentHandler.prototype = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
} catch(ex) {
|
||||
}
|
||||
} catch(ex) {}
|
||||
|
||||
// formatURLPref might return "about:blank" if getting the pref fails
|
||||
if (overridePage == "about:blank") {
|
||||
|
|
@ -623,8 +622,7 @@ nsBrowserContentHandler.prototype = {
|
|||
if (height) {
|
||||
this.mFeatures += ",height=" + height;
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
// The global PB Service consumes this flag, so only eat it in per-window
|
||||
// PB builds.
|
||||
|
|
@ -702,7 +700,7 @@ function handURIToExistingBrowser(uri, location, cmdLine, forcePrivate) {
|
|||
nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
}
|
||||
|
||||
function nsDefaultCommandLineHandler() { }
|
||||
function nsDefaultCommandLineHandler() {}
|
||||
nsDefaultCommandLineHandler.prototype = {
|
||||
classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
|
||||
|
||||
|
|
@ -738,7 +736,7 @@ nsDefaultCommandLineHandler.prototype = {
|
|||
var dir = fl.get("ProfD", Components.interfaces.nsILocalFile);
|
||||
this._haveProfile = true;
|
||||
} catch(e) {
|
||||
while ((ar = cmdLine.handleFlagWithParam("url", false))) { }
|
||||
while ((ar = cmdLine.handleFlagWithParam("url", false))) {}
|
||||
cmdLine.preventDefault = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -780,8 +778,7 @@ nsDefaultCommandLineHandler.prototype = {
|
|||
try {
|
||||
handURIToExistingBrowser(urilist[0], nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW, cmdLine);
|
||||
return;
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
var URLlist = urilist.filter(shouldLoadURI).map(function(u) u.spec);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function BrowserGlue() {
|
|||
|
||||
XPCOMUtils.defineLazyGetter(this, "_sanitizer",
|
||||
function() {
|
||||
let sanitizerScope = { };
|
||||
let sanitizerScope = {};
|
||||
Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js", sanitizerScope);
|
||||
return sanitizerScope.Sanitizer;
|
||||
});
|
||||
|
|
@ -475,8 +475,7 @@ BrowserGlue.prototype = {
|
|||
try {
|
||||
averageTime = Services.prefs.getIntPref("browser.slowStartup.averageTime");
|
||||
samples = Services.prefs.getIntPref("browser.slowStartup.samples");
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
averageTime = (averageTime * samples + currentTime) / ++samples;
|
||||
|
||||
|
|
@ -655,8 +654,7 @@ BrowserGlue.prototype = {
|
|||
// Windows 8 is version 6.2.
|
||||
let version = Services.sysinfo.getProperty("version");
|
||||
claimAllTypes = (parseFloat(version) < 6.2);
|
||||
} catch (ex) {
|
||||
}
|
||||
} catch (ex) {}
|
||||
#endif
|
||||
ShellService.setDefaultBrowser(claimAllTypes, false);
|
||||
}
|
||||
|
|
@ -962,8 +960,7 @@ BrowserGlue.prototype = {
|
|||
Services.prefs.getBoolPref("browser.places.importBookmarksHTML");
|
||||
if (importBookmarksHTML)
|
||||
importBookmarks = true;
|
||||
} catch(ex) {
|
||||
}
|
||||
} catch(ex) {}
|
||||
|
||||
Task.spawn(function() {
|
||||
// Check if Safe Mode or the user has required to restore bookmarks from
|
||||
|
|
@ -977,8 +974,7 @@ BrowserGlue.prototype = {
|
|||
yield this._backupBookmarks();
|
||||
importBookmarks = true;
|
||||
}
|
||||
} catch(ex) {
|
||||
}
|
||||
} catch(ex) {}
|
||||
|
||||
// If the user did not require to restore default bookmarks, or import
|
||||
// from bookmarks.html, we will try to restore from JSON/JSONLZ4
|
||||
|
|
@ -1051,7 +1047,7 @@ BrowserGlue.prototype = {
|
|||
// Ensure that smart bookmarks are created once the operation
|
||||
// is complete.
|
||||
this.ensurePlacesDefaultQueriesInitialized();
|
||||
} catch (e) {
|
||||
} catch(e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
}.bind(this)
|
||||
|
|
@ -1171,8 +1167,7 @@ BrowserGlue.prototype = {
|
|||
let maxBackups = BOOKMARKS_BACKUP_MAX_BACKUPS;
|
||||
try {
|
||||
maxBackups = Services.prefs.getIntPref("browser.bookmarks.max_backups");
|
||||
}
|
||||
catch(ex) {
|
||||
} catch(ex) {
|
||||
// Use default.
|
||||
}
|
||||
|
||||
|
|
@ -1225,8 +1220,7 @@ BrowserGlue.prototype = {
|
|||
let currentUIVersion = 0;
|
||||
try {
|
||||
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
|
||||
} catch(ex) {
|
||||
}
|
||||
} catch(ex) {}
|
||||
if (currentUIVersion >= UI_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1432,8 +1426,7 @@ BrowserGlue.prototype = {
|
|||
Services.prefs.clearUserPref("privacy.donottrackheader.value");
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
}
|
||||
catch (ex) {}
|
||||
}
|
||||
|
||||
#ifndef MOZ_JXR
|
||||
|
|
@ -1447,8 +1440,7 @@ BrowserGlue.prototype = {
|
|||
} else if (ihaValue.includes("image/jxr")) {
|
||||
Services.prefs.clearUserPref(ihaPref);
|
||||
}
|
||||
}
|
||||
catch (ex) {}
|
||||
} catch(ex) {}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1468,13 +1460,13 @@ BrowserGlue.prototype = {
|
|||
if (dsCertFile.exists()) {
|
||||
try {
|
||||
dsCertFile.remove(false);
|
||||
} catch(e) { }
|
||||
} catch(e) {}
|
||||
}
|
||||
dsKeyFile.append("key4.db");
|
||||
if (dsKeyFile.exists()) {
|
||||
try {
|
||||
dsKeyFile.remove(false);
|
||||
} catch(e) { }
|
||||
} catch(e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1546,8 +1538,7 @@ BrowserGlue.prototype = {
|
|||
var url = "about:permissions";
|
||||
try {
|
||||
url = url + "?filter=" + aPrincipal.URI.host;
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
win.openUILinkIn(url, "tab");
|
||||
},
|
||||
|
||||
|
|
@ -1555,8 +1546,7 @@ BrowserGlue.prototype = {
|
|||
try {
|
||||
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
||||
Ci.nsIAlertsService);
|
||||
} catch(e) {
|
||||
}
|
||||
} catch(e) {}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
|
@ -1590,8 +1580,7 @@ BrowserGlue.prototype = {
|
|||
if (!this._dataSource.HasAssertion(docResource, persistResource, aSource, true)) {
|
||||
this._dataSource.Assert(docResource, persistResource, aSource, true);
|
||||
}
|
||||
}
|
||||
catch(ex) {}
|
||||
} catch(ex) {}
|
||||
},
|
||||
|
||||
// ------------------------------
|
||||
|
|
@ -1797,7 +1786,7 @@ BrowserGlue.prototype = {
|
|||
_xpcom_factory: BrowserGlueServiceFactory,
|
||||
}
|
||||
|
||||
function ContentPermissionPrompt() { }
|
||||
function ContentPermissionPrompt() {}
|
||||
ContentPermissionPrompt.prototype = {
|
||||
classID: Components.ID("{d8903bf6-68d5-4e97-bcd1-e4d3012f721a}"),
|
||||
|
||||
|
|
@ -1904,7 +1893,7 @@ ContentPermissionPrompt.prototype = {
|
|||
let autoAllow = !mainAction;
|
||||
|
||||
if (!aOptions) {
|
||||
aOptions = { };
|
||||
aOptions = {};
|
||||
}
|
||||
|
||||
aOptions.removeOnDismissal = autoAllow;
|
||||
|
|
@ -1994,7 +1983,7 @@ ContentPermissionPrompt.prototype = {
|
|||
stringId: "webNotifications.showForSession",
|
||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
||||
callback: function() { },
|
||||
callback: function() {},
|
||||
}
|
||||
];
|
||||
} else {
|
||||
|
|
@ -2003,19 +1992,19 @@ ContentPermissionPrompt.prototype = {
|
|||
stringId: "webNotifications.showForSession",
|
||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
||||
callback: function() { },
|
||||
callback: function() {},
|
||||
},
|
||||
{
|
||||
stringId: "webNotifications.alwaysShow",
|
||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
expireType: null,
|
||||
callback: function() { },
|
||||
callback: function() {},
|
||||
},
|
||||
{
|
||||
stringId: "webNotifications.neverShow",
|
||||
action: Ci.nsIPermissionManager.DENY_ACTION,
|
||||
expireType: null,
|
||||
callback: function() { },
|
||||
callback: function() {},
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue