mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +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);
|
Components.utils.reportError(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
// Pref is unset
|
// Pref is unset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,7 @@ var LightWeightThemeWebInstaller = {
|
||||||
},
|
},
|
||||||
|
|
||||||
get _manager () {
|
get _manager () {
|
||||||
var temp = { };
|
var temp = {};
|
||||||
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
|
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
|
||||||
delete this._manager;
|
delete this._manager;
|
||||||
return this._manager = temp.LightweightThemeManager;
|
return this._manager = temp.LightweightThemeManager;
|
||||||
|
|
|
||||||
|
|
@ -268,12 +268,11 @@ var FullScreen = {
|
||||||
let host = null;
|
let host = null;
|
||||||
try {
|
try {
|
||||||
host = uri.host;
|
host = uri.host;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
let hostLabel = document.getElementById("full-screen-domain-text");
|
let hostLabel = document.getElementById("full-screen-domain-text");
|
||||||
if (host) {
|
if (host) {
|
||||||
// Document's principal's URI has a host. Display a warning including the hostname.
|
// 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);
|
Cu.import("resource://gre/modules/DownloadUtils.jsm", utils);
|
||||||
let displayHost = utils.DownloadUtils.getURIHost(uri.spec)[0];
|
let displayHost = utils.DownloadUtils.getURIHost(uri.spec)[0];
|
||||||
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||||
|
|
|
||||||
|
|
@ -296,8 +296,7 @@ var gGestureSupport = {
|
||||||
let command;
|
let command;
|
||||||
try {
|
try {
|
||||||
command = this._getPref(aGesture.concat(subCombo).join("."));
|
command = this._getPref(aGesture.concat(subCombo).join("."));
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (command) {
|
if (command) {
|
||||||
return command;
|
return command;
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,7 @@ var browserMenuDragging = {
|
||||||
if (!!parentPopup.openNode) {
|
if (!!parentPopup.openNode) {
|
||||||
try {
|
try {
|
||||||
parentPopup.openNode.hidePopup();
|
parentPopup.openNode.hidePopup();
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
parentPopup.openNode = menupopup;
|
parentPopup.openNode = menupopup;
|
||||||
|
|
||||||
|
|
@ -318,8 +317,7 @@ var browserMenuDragging = {
|
||||||
default:
|
default:
|
||||||
return xpPref.setBoolPref(aPrefString, aValue); break;
|
return xpPref.setBoolPref(aPrefString, aValue); break;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -328,8 +326,7 @@ var browserMenuDragging = {
|
||||||
var pbi = Components.classes["@mozilla.org/preferences;1"].
|
var pbi = Components.classes["@mozilla.org/preferences;1"].
|
||||||
getService(Components.interfaces.nsIPrefBranch2);
|
getService(Components.interfaces.nsIPrefBranch2);
|
||||||
pbi.addObserver(aObserver.domain, aObserver, false);
|
pbi.addObserver(aObserver.domain, aObserver, false);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
removePrefListener: function(aObserver) {
|
removePrefListener: function(aObserver) {
|
||||||
|
|
@ -337,8 +334,7 @@ var browserMenuDragging = {
|
||||||
var pbi = Components.classes["@mozilla.org/preferences;1"].
|
var pbi = Components.classes["@mozilla.org/preferences;1"].
|
||||||
getService(Components.interfaces.nsIPrefBranch2);
|
getService(Components.interfaces.nsIPrefBranch2);
|
||||||
pbi.removeObserver(aObserver.domain, aObserver);
|
pbi.removeObserver(aObserver.domain, aObserver);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
PrefListener:{
|
PrefListener:{
|
||||||
|
|
|
||||||
|
|
@ -299,8 +299,7 @@ var PlacesCommandHook = {
|
||||||
title = title || url.spec;
|
title = title || url.spec;
|
||||||
description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
|
description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
|
||||||
charset = webNav.document.characterSet;
|
charset = webNav.document.characterSet;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (aShowEditUI) {
|
if (aShowEditUI) {
|
||||||
// If we bookmark the page here (i.e. page was not "starred" already)
|
// 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;
|
let tabstring = tab.linkedBrowser.currentURI.spec;
|
||||||
try {
|
try {
|
||||||
tabstring = decodeURI(tabstring);
|
tabstring = decodeURI(tabstring);
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
tabstring = tab.label + " " + tab.label.toLocaleLowerCase() + " " + tabstring;
|
tabstring = tab.label + " " + tab.label.toLocaleLowerCase() + " " + tabstring;
|
||||||
for (let i = 0; i < filter.length; i++) {
|
for (let i = 0; i < filter.length; i++) {
|
||||||
matches += tabstring.includes(filter[i]);
|
matches += tabstring.includes(filter[i]);
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,7 @@ var gBrowserThumbnails = {
|
||||||
try {
|
try {
|
||||||
if (Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled"))
|
if (Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled"))
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
PageThumbs.addExpirationFilter(this);
|
PageThumbs.addExpirationFilter(this);
|
||||||
gBrowser.addTabsProgressListener(this);
|
gBrowser.addTabsProgressListener(this);
|
||||||
|
|
@ -182,7 +181,7 @@ var gBrowserThumbnails = {
|
||||||
let httpChannel;
|
let httpChannel;
|
||||||
try {
|
try {
|
||||||
httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
|
httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
// Not an HTTP channel.
|
// Not an HTTP channel.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,7 +191,7 @@ var gBrowserThumbnails = {
|
||||||
if (Math.floor(httpChannel.responseStatus / 100) != 2) {
|
if (Math.floor(httpChannel.responseStatus / 100) != 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
// Can't get response information from the httpChannel
|
// Can't get response information from the httpChannel
|
||||||
// because mResponseHead is not available.
|
// because mResponseHead is not available.
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.__defineGetter__("AddonManager", function() {
|
this.__defineGetter__("AddonManager", function() {
|
||||||
let tmp = { };
|
let tmp = {};
|
||||||
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
|
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
|
||||||
return this.AddonManager = tmp.AddonManager;
|
return this.AddonManager = tmp.AddonManager;
|
||||||
});
|
});
|
||||||
|
|
@ -95,13 +95,13 @@ XPCOMUtils.defineLazyModuleGetter(this, "Weave", "resource://services-sync/main.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
|
XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
|
||||||
let tmp = { };
|
let tmp = {};
|
||||||
Cu.import("resource:///modules/PopupNotifications.jsm", tmp);
|
Cu.import("resource:///modules/PopupNotifications.jsm", tmp);
|
||||||
try {
|
try {
|
||||||
return new tmp.PopupNotifications(gBrowser,
|
return new tmp.PopupNotifications(gBrowser,
|
||||||
document.getElementById("notification-popup"),
|
document.getElementById("notification-popup"),
|
||||||
document.getElementById("notification-popup-box"));
|
document.getElementById("notification-popup-box"));
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -181,8 +181,9 @@ function pageShowEventHandlers(persisted) {
|
||||||
// The PluginClickToPlay events are not fired when navigating using the
|
// The PluginClickToPlay events are not fired when navigating using the
|
||||||
// BF cache. |persisted| is true when the page is loaded from the
|
// BF cache. |persisted| is true when the page is loaded from the
|
||||||
// BF cache, so this code reshows the notification if necessary.
|
// BF cache, so this code reshows the notification if necessary.
|
||||||
if (persisted)
|
if (persisted) {
|
||||||
gPluginHandler.reshowClickToPlayNotification();
|
gPluginHandler.reshowClickToPlayNotification();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateBackForwardCommands(aWebNavigation) {
|
function UpdateBackForwardCommands(aWebNavigation) {
|
||||||
|
|
@ -673,8 +674,7 @@ var gPopupBlockerObserver = {
|
||||||
var host = "";
|
var host = "";
|
||||||
try {
|
try {
|
||||||
host = gBrowser.currentURI.host;
|
host = gBrowser.currentURI.host;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
var bundlePreferences = document.getElementById("bundle_preferences");
|
var bundlePreferences = document.getElementById("bundle_preferences");
|
||||||
var params = { blockVisible : false,
|
var params = { blockVisible : false,
|
||||||
|
|
@ -1041,8 +1041,7 @@ var gBrowserInit = {
|
||||||
// so that we don't disrupt startup
|
// so that we don't disrupt startup
|
||||||
try {
|
try {
|
||||||
gBrowser.loadTabs(specs, false, true);
|
gBrowser.loadTabs(specs, false, true);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
} else if (uriToLoad instanceof XULElement) {
|
} else if (uriToLoad instanceof XULElement) {
|
||||||
// swap the given tab with the default about:blank tab and then close
|
// swap the given tab with the default about:blank tab and then close
|
||||||
// the original tab in the other window.
|
// the original tab in the other window.
|
||||||
|
|
@ -1159,7 +1158,7 @@ var gBrowserInit = {
|
||||||
|
|
||||||
// Bug 666804 - NetworkPrioritizer support for e10s
|
// Bug 666804 - NetworkPrioritizer support for e10s
|
||||||
if (!gMultiProcessBrowser) {
|
if (!gMultiProcessBrowser) {
|
||||||
let NP = { };
|
let NP = {};
|
||||||
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
|
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
|
||||||
NP.trackBrowserWindow(window);
|
NP.trackBrowserWindow(window);
|
||||||
}
|
}
|
||||||
|
|
@ -1197,7 +1196,7 @@ var gBrowserInit = {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
try {
|
try {
|
||||||
Services.logins;
|
Services.logins;
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
@ -1299,7 +1298,7 @@ var gBrowserInit = {
|
||||||
try {
|
try {
|
||||||
const startupCrashEndDelay = 30 * 1000;
|
const startupCrashEndDelay = 30 * 1000;
|
||||||
setTimeout(Services.startup.trackStartupCrashEnd, startupCrashEndDelay);
|
setTimeout(Services.startup.trackStartupCrashEnd, startupCrashEndDelay);
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
Cu.reportError("Could not end startup crash tracking: " + ex);
|
Cu.reportError("Could not end startup crash tracking: " + ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1372,8 +1371,7 @@ var gBrowserInit = {
|
||||||
try {
|
try {
|
||||||
gBrowser.removeProgressListener(window.XULBrowserWindow);
|
gBrowser.removeProgressListener(window.XULBrowserWindow);
|
||||||
gBrowser.removeTabsProgressListener(window.TabsProgressListener);
|
gBrowser.removeTabsProgressListener(window.TabsProgressListener);
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
BookmarkingUI.uninit();
|
BookmarkingUI.uninit();
|
||||||
|
|
||||||
|
|
@ -1431,13 +1429,13 @@ var gBrowserInit = {
|
||||||
try {
|
try {
|
||||||
gPrefService.removeObserver(gURLBarSettings.prefSuggest, gURLBarSettings);
|
gPrefService.removeObserver(gURLBarSettings.prefSuggest, gURLBarSettings);
|
||||||
gPrefService.removeObserver(gURLBarSettings.prefKeyword, gURLBarSettings);
|
gPrefService.removeObserver(gURLBarSettings.prefKeyword, gURLBarSettings);
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
|
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1507,8 +1505,7 @@ var gBrowserInit = {
|
||||||
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
|
let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
|
||||||
.getService(Ci.nsIMacDockSupport);
|
.getService(Ci.nsIMacDockSupport);
|
||||||
dockSupport.dockMenu = nativeMenu;
|
dockSupport.dockMenu = nativeMenu;
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1608,55 +1605,55 @@ var nonBrowserWindowShutdown = gBrowserInit.nonBrowserWindowShutdown.bind(
|
||||||
|
|
||||||
function HandleAppCommandEvent(evt) {
|
function HandleAppCommandEvent(evt) {
|
||||||
switch (evt.command) {
|
switch (evt.command) {
|
||||||
case "Back":
|
case "Back":
|
||||||
BrowserBack();
|
BrowserBack();
|
||||||
break;
|
break;
|
||||||
case "Forward":
|
case "Forward":
|
||||||
BrowserForward();
|
BrowserForward();
|
||||||
break;
|
break;
|
||||||
case "Reload":
|
case "Reload":
|
||||||
BrowserReloadSkipCache();
|
BrowserReloadSkipCache();
|
||||||
break;
|
break;
|
||||||
case "Stop":
|
case "Stop":
|
||||||
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true") {
|
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true") {
|
||||||
BrowserStop();
|
BrowserStop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Search":
|
case "Search":
|
||||||
BrowserSearch.webSearch();
|
BrowserSearch.webSearch();
|
||||||
break;
|
break;
|
||||||
case "Bookmarks":
|
case "Bookmarks":
|
||||||
toggleSidebar('viewBookmarksSidebar');
|
toggleSidebar('viewBookmarksSidebar');
|
||||||
break;
|
break;
|
||||||
case "Home":
|
case "Home":
|
||||||
BrowserHome();
|
BrowserHome();
|
||||||
break;
|
break;
|
||||||
case "New":
|
case "New":
|
||||||
BrowserOpenTab();
|
BrowserOpenTab();
|
||||||
break;
|
break;
|
||||||
case "Close":
|
case "Close":
|
||||||
BrowserCloseTabOrWindow();
|
BrowserCloseTabOrWindow();
|
||||||
break;
|
break;
|
||||||
case "Find":
|
case "Find":
|
||||||
gFindBar.onFindCommand();
|
gFindBar.onFindCommand();
|
||||||
break;
|
break;
|
||||||
case "Help":
|
case "Help":
|
||||||
openHelpLink('firefox-help');
|
openHelpLink('firefox-help');
|
||||||
break;
|
break;
|
||||||
case "Open":
|
case "Open":
|
||||||
BrowserOpenFileWindow();
|
BrowserOpenFileWindow();
|
||||||
break;
|
break;
|
||||||
case "Print":
|
case "Print":
|
||||||
PrintUtils.print();
|
PrintUtils.print();
|
||||||
break;
|
break;
|
||||||
case "Save":
|
case "Save":
|
||||||
saveDocument(window.content.document);
|
saveDocument(window.content.document);
|
||||||
break;
|
break;
|
||||||
case "SendMail":
|
case "SendMail":
|
||||||
MailIntegration.sendLinkForWindow(window.content);
|
MailIntegration.sendLinkForWindow(window.content);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
@ -1692,8 +1689,7 @@ function BrowserForward(aEvent) {
|
||||||
if (where == "current") {
|
if (where == "current") {
|
||||||
try {
|
try {
|
||||||
gBrowser.goForward();
|
gBrowser.goForward();
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
duplicateTabIn(gBrowser.selectedTab, where, 1);
|
duplicateTabIn(gBrowser.selectedTab, where, 1);
|
||||||
}
|
}
|
||||||
|
|
@ -1705,8 +1701,7 @@ function BrowserBack(aEvent) {
|
||||||
if (where == "current") {
|
if (where == "current") {
|
||||||
try {
|
try {
|
||||||
gBrowser.goBack();
|
gBrowser.goBack();
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
duplicateTabIn(gBrowser.selectedTab, where, -1);
|
duplicateTabIn(gBrowser.selectedTab, where, -1);
|
||||||
}
|
}
|
||||||
|
|
@ -1715,24 +1710,24 @@ function BrowserBack(aEvent) {
|
||||||
function BrowserHandleBackspace()
|
function BrowserHandleBackspace()
|
||||||
{
|
{
|
||||||
switch (gPrefService.getIntPref("browser.backspace_action")) {
|
switch (gPrefService.getIntPref("browser.backspace_action")) {
|
||||||
case 0:
|
case 0:
|
||||||
BrowserBack();
|
BrowserBack();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
goDoCommand("cmd_scrollPageUp");
|
goDoCommand("cmd_scrollPageUp");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BrowserHandleShiftBackspace()
|
function BrowserHandleShiftBackspace()
|
||||||
{
|
{
|
||||||
switch (gPrefService.getIntPref("browser.backspace_action")) {
|
switch (gPrefService.getIntPref("browser.backspace_action")) {
|
||||||
case 0:
|
case 0:
|
||||||
BrowserForward();
|
BrowserForward();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
goDoCommand("cmd_scrollPageDown");
|
goDoCommand("cmd_scrollPageDown");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1817,8 +1812,7 @@ function loadOneOrMoreURIs(aURIString) {
|
||||||
// so that we don't disrupt startup
|
// so that we don't disrupt startup
|
||||||
try {
|
try {
|
||||||
gBrowser.loadTabs(aURIString.split("|"), false, true);
|
gBrowser.loadTabs(aURIString.split("|"), false, true);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function focusAndSelectUrlBar() {
|
function focusAndSelectUrlBar() {
|
||||||
|
|
@ -1901,8 +1895,7 @@ var gLastOpenDirectory = {
|
||||||
Ci.nsILocalFile);
|
Ci.nsILocalFile);
|
||||||
if (!this._lastDir.exists())
|
if (!this._lastDir.exists())
|
||||||
this._lastDir = null;
|
this._lastDir = null;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this._lastDir;
|
return this._lastDir;
|
||||||
},
|
},
|
||||||
|
|
@ -1939,8 +1932,7 @@ function BrowserOpenFileWindow() {
|
||||||
gLastOpenDirectory.path =
|
gLastOpenDirectory.path =
|
||||||
fp.file.parent.QueryInterface(Ci.nsILocalFile);
|
fp.file.parent.QueryInterface(Ci.nsILocalFile);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
openUILinkIn(fp.fileURL.spec, "current");
|
openUILinkIn(fp.fileURL.spec, "current");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -1952,8 +1944,7 @@ function BrowserOpenFileWindow() {
|
||||||
nsIFilePicker.filterHTML);
|
nsIFilePicker.filterHTML);
|
||||||
fp.displayDirectory = gLastOpenDirectory.path;
|
fp.displayDirectory = gLastOpenDirectory.path;
|
||||||
fp.open(fpCallback);
|
fp.open(fpCallback);
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function BrowserCloseTabOrWindow() {
|
function BrowserCloseTabOrWindow() {
|
||||||
|
|
@ -1998,8 +1989,7 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
|
||||||
originPrincipal: originPrincipal,
|
originPrincipal: originPrincipal,
|
||||||
triggeringPrincipal: triggeringPrincipal,
|
triggeringPrincipal: triggeringPrincipal,
|
||||||
forceAboutBlankViewerInCurrent: forceAboutBlankViewerInCurrent });
|
forceAboutBlankViewerInCurrent: forceAboutBlankViewerInCurrent });
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2069,8 +2059,7 @@ function getShortcutOrURIAndPostData(url, callback = null) {
|
||||||
try {
|
try {
|
||||||
// makeURI() throws if URI is invalid.
|
// makeURI() throws if URI is invalid.
|
||||||
uri = makeURI(shortcutURL);
|
uri = makeURI(shortcutURL);
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (uri) {
|
if (uri) {
|
||||||
// Try to get the saved character-set.
|
// Try to get the saved character-set.
|
||||||
|
|
@ -2177,8 +2166,7 @@ function readFromClipboard()
|
||||||
data = data.value.QueryInterface(Components.interfaces.nsISupportsString);
|
data = data.value.QueryInterface(Components.interfaces.nsISupportsString);
|
||||||
url = data.data.substring(0, dataLen.value / 2);
|
url = data.data.substring(0, dataLen.value / 2);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -2255,8 +2243,7 @@ function URLBarSetURI(aURI) {
|
||||||
// Strip off "wyciwyg://" and passwords for the location bar
|
// Strip off "wyciwyg://" and passwords for the location bar
|
||||||
try {
|
try {
|
||||||
uri = Services.uriFixup.createExposableURI(uri);
|
uri = Services.uriFixup.createExposableURI(uri);
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Replace initial page URIs with an empty string
|
// Replace initial page URIs with an empty string
|
||||||
// only if there's no opener (bug 370555).
|
// only if there's no opener (bug 370555).
|
||||||
|
|
@ -2306,8 +2293,7 @@ function losslessDecodeURI(aURI) {
|
||||||
// by the location bar (bug 410726).
|
// by the location bar (bug 410726).
|
||||||
.replace(/%(?!3B|2F|3F|3A|40|26|3D|2B|24|2C|23)|[\r\n\t]/ig,
|
.replace(/%(?!3B|2F|3F|3A|40|26|3D|2B|24|2C|23)|[\r\n\t]/ig,
|
||||||
encodeURIComponent);
|
encodeURIComponent);
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2554,7 +2540,7 @@ var BrowserOnClick = {
|
||||||
case 1 : // Pre-populate
|
case 1 : // Pre-populate
|
||||||
params.location = aOwnerDoc.location.href;
|
params.location = aOwnerDoc.location.href;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
Components.utils.reportError("Couldn't get ssl_override pref: " + e);
|
Components.utils.reportError("Couldn't get ssl_override pref: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2692,13 +2678,11 @@ function BrowserReloadWithFlags(reloadFlags) {
|
||||||
var sh = webNav.sessionHistory;
|
var sh = webNav.sessionHistory;
|
||||||
if (sh)
|
if (sh)
|
||||||
webNav = sh.QueryInterface(nsIWebNavigation);
|
webNav = sh.QueryInterface(nsIWebNavigation);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webNav.reload(reloadFlags);
|
webNav.reload(reloadFlags);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var PrintPreviewListener = {
|
var PrintPreviewListener = {
|
||||||
|
|
@ -2757,7 +2741,7 @@ var PrintPreviewListener = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_hideChrome: function() {
|
_hideChrome: function() {
|
||||||
this._chromeState = { };
|
this._chromeState = {};
|
||||||
|
|
||||||
var sidebar = document.getElementById("sidebar-box");
|
var sidebar = document.getElementById("sidebar-box");
|
||||||
this._chromeState.sidebarOpen = !sidebar.hidden;
|
this._chromeState.sidebarOpen = !sidebar.hidden;
|
||||||
|
|
@ -2876,7 +2860,7 @@ function openHomeDialog(aURL) {
|
||||||
homepageStr.data = aURL;
|
homepageStr.data = aURL;
|
||||||
gPrefService.setComplexValue("browser.startup.homepage",
|
gPrefService.setComplexValue("browser.startup.homepage",
|
||||||
Components.interfaces.nsISupportsString, homepageStr);
|
Components.interfaces.nsISupportsString, homepageStr);
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
dump("Failed to set the home page.\n"+ex+"\n");
|
dump("Failed to set the home page.\n"+ex+"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2884,20 +2868,19 @@ function openHomeDialog(aURL) {
|
||||||
|
|
||||||
var bookmarksButtonObserver = {
|
var bookmarksButtonObserver = {
|
||||||
onDrop: function(aEvent) {
|
onDrop: function(aEvent) {
|
||||||
let name = { };
|
let name = {};
|
||||||
let url = browserDragAndDrop.drop(aEvent, name);
|
let url = browserDragAndDrop.drop(aEvent, name);
|
||||||
try {
|
try {
|
||||||
PlacesUIUtils.showBookmarkDialog({ action: "add"
|
PlacesUIUtils.showBookmarkDialog({ action: "add",
|
||||||
, type: "bookmark"
|
type: "bookmark",
|
||||||
, uri: makeURI(url)
|
uri: makeURI(url),
|
||||||
, title: name
|
title: name,
|
||||||
, hiddenRows: [ "description"
|
hiddenRows: [ "description",
|
||||||
, "location"
|
"location",
|
||||||
, "loadInSidebar"
|
"loadInSidebar",
|
||||||
, "keyword" ]
|
"keyword" ]
|
||||||
}, window);
|
}, window);
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragOver: function(aEvent) {
|
onDragOver: function(aEvent) {
|
||||||
|
|
@ -2914,8 +2897,7 @@ var newTabButtonObserver = {
|
||||||
browserDragAndDrop.dragOver(aEvent);
|
browserDragAndDrop.dragOver(aEvent);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragExit: function(aEvent) {
|
onDragExit: function(aEvent) {},
|
||||||
},
|
|
||||||
|
|
||||||
onDrop: function(aEvent) {
|
onDrop: function(aEvent) {
|
||||||
let links = browserDragAndDrop.dropLinks(aEvent);
|
let links = browserDragAndDrop.dropLinks(aEvent);
|
||||||
|
|
@ -2936,8 +2918,7 @@ var newWindowButtonObserver = {
|
||||||
browserDragAndDrop.dragOver(aEvent);
|
browserDragAndDrop.dragOver(aEvent);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragExit: function(aEvent) {
|
onDragExit: function(aEvent) {},
|
||||||
},
|
|
||||||
|
|
||||||
onDrop: function(aEvent) {
|
onDrop: function(aEvent) {
|
||||||
let links = browserDragAndDrop.dropLinks(aEvent);
|
let links = browserDragAndDrop.dropLinks(aEvent);
|
||||||
|
|
@ -3495,8 +3476,9 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
|
||||||
// Hacky: update the PopupNotifications' object's reference to the iconBox,
|
// Hacky: update the PopupNotifications' object's reference to the iconBox,
|
||||||
// if it already exists, since it may have changed if the URL bar was
|
// if it already exists, since it may have changed if the URL bar was
|
||||||
// added/removed.
|
// added/removed.
|
||||||
if (!window.__lookupGetter__("PopupNotifications"))
|
if (!window.__lookupGetter__("PopupNotifications")) {
|
||||||
PopupNotifications.iconBox = document.getElementById("notification-popup-box");
|
PopupNotifications.iconBox = document.getElementById("notification-popup-box");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlacesToolbarHelper.customizeDone();
|
PlacesToolbarHelper.customizeDone();
|
||||||
|
|
@ -4119,8 +4101,7 @@ var XULBrowserWindow = {
|
||||||
"<" + contentHost + "> but cached host is <" + this._host + ">.\n"
|
"<" + contentHost + "> but cached host is <" + this._host + ">.\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -4180,7 +4161,7 @@ var XULBrowserWindow = {
|
||||||
locationObj.host = location.host;
|
locationObj.host = location.host;
|
||||||
locationObj.hostname = location.hostname;
|
locationObj.hostname = location.hostname;
|
||||||
locationObj.port = location.port;
|
locationObj.port = location.port;
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
// Can sometimes throw if the URL being visited has no host/hostname,
|
// 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
|
// e.g. about:blank. The _state for these pages means we won't need these
|
||||||
// properties anyways, though.
|
// properties anyways, though.
|
||||||
|
|
@ -4608,8 +4589,9 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||||
// Empty the menu
|
// Empty the menu
|
||||||
for (var i = popup.childNodes.length-1; i >= 0; --i) {
|
for (var i = popup.childNodes.length-1; i >= 0; --i) {
|
||||||
var deadItem = popup.childNodes[i];
|
var deadItem = popup.childNodes[i];
|
||||||
if (deadItem.hasAttribute("toolbarId"))
|
if (deadItem.hasAttribute("toolbarId")) {
|
||||||
popup.removeChild(deadItem);
|
popup.removeChild(deadItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstMenuItem = aInsertPoint || popup.firstChild;
|
var firstMenuItem = aInsertPoint || popup.firstChild;
|
||||||
|
|
@ -4729,8 +4711,9 @@ var AudioIndicator = {
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function(subject, topic, data) {
|
observe: function(subject, topic, data) {
|
||||||
if (topic == "nsPref:changed")
|
if (topic == "nsPref:changed") {
|
||||||
this.syncUI();
|
this.syncUI();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_prefName: "browser.tabs.showAudioPlayingIcon"
|
_prefName: "browser.tabs.showAudioPlayingIcon"
|
||||||
|
|
@ -4774,8 +4757,9 @@ var TabsOnTop = {
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function(subject, topic, data) {
|
observe: function(subject, topic, data) {
|
||||||
if (topic == "nsPref:changed")
|
if (topic == "nsPref:changed") {
|
||||||
this.syncUI();
|
this.syncUI();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_prefName: "browser.tabs.onTop"
|
_prefName: "browser.tabs.onTop"
|
||||||
|
|
@ -5086,8 +5070,7 @@ var gHomeButton = {
|
||||||
try {
|
try {
|
||||||
url = gPrefService.getComplexValue(this.prefDomain,
|
url = gPrefService.getComplexValue(this.prefDomain,
|
||||||
Components.interfaces.nsIPrefLocalizedString).data;
|
Components.interfaces.nsIPrefLocalizedString).data;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// use this if we can't find the pref
|
// use this if we can't find the pref
|
||||||
if (!url) {
|
if (!url) {
|
||||||
|
|
@ -5337,7 +5320,7 @@ function contentAreaClick(event, isPanelClick) {
|
||||||
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
|
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
|
||||||
PlacesUIUtils.markPageAsFollowedLink(href);
|
PlacesUIUtils.markPageAsFollowedLink(href);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch(ex) {
|
||||||
// Skip invalid URIs.
|
// Skip invalid URIs.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5551,8 +5534,7 @@ function UpdateCharsetDetector(target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
prefvalue = gPrefService.getComplexValue("intl.charset.detector", Ci.nsIPrefLocalizedString).data;
|
prefvalue = gPrefService.getComplexValue("intl.charset.detector", Ci.nsIPrefLocalizedString).data;
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (!prefvalue) {
|
if (!prefvalue) {
|
||||||
prefvalue = "off";
|
prefvalue = "off";
|
||||||
|
|
@ -5760,8 +5742,7 @@ var BrowserOffline = {
|
||||||
if (cancelGoOffline.data) {
|
if (cancelGoOffline.data) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
@ -6420,9 +6401,10 @@ function AddKeywordForSearchField() {
|
||||||
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
|
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
|
||||||
} else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) {
|
} else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) {
|
||||||
for (var j=0; j < el.options.length; j++) {
|
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,
|
formData.push(escapeNameValuePair(el.name, el.options[j].value,
|
||||||
isURLEncoded));
|
isURLEncoded));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6797,7 +6779,7 @@ var gIdentityHandler = {
|
||||||
try {
|
try {
|
||||||
let baseDomain = Services.eTLD.getBaseDomainFromHost(this._lastLocation.hostname);
|
let baseDomain = Services.eTLD.getBaseDomainFromHost(this._lastLocation.hostname);
|
||||||
return this._IDNService.convertToDisplayIDN(baseDomain, {});
|
return this._IDNService.convertToDisplayIDN(baseDomain, {});
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
// If something goes wrong (e.g. hostname is an IP address) just fall back
|
// If something goes wrong (e.g. hostname is an IP address) just fall back
|
||||||
// to the full domain.
|
// to the full domain.
|
||||||
return this._lastLocation.hostname;
|
return this._lastLocation.hostname;
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ var handleContentContextMenu = function (event) {
|
||||||
let plugin = null;
|
let plugin = null;
|
||||||
try {
|
try {
|
||||||
plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
|
plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
|
if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
|
||||||
// Don't open a context menu for plugins.
|
// Don't open a context menu for plugins.
|
||||||
return;
|
return;
|
||||||
|
|
@ -81,7 +80,7 @@ var handleContentContextMenu = function (event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let addonInfo = { };
|
let addonInfo = {};
|
||||||
let subject = {
|
let subject = {
|
||||||
event: event,
|
event: event,
|
||||||
addonInfo: addonInfo,
|
addonInfo: addonInfo,
|
||||||
|
|
@ -130,15 +129,12 @@ var handleContentContextMenu = function (event) {
|
||||||
imageCache.findEntryProperties(event.target.currentURI, doc);
|
imageCache.findEntryProperties(event.target.currentURI, doc);
|
||||||
try {
|
try {
|
||||||
contentType = props.get("type", Ci.nsISupportsCString).data;
|
contentType = props.get("type", Ci.nsISupportsCString).data;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
contentDisposition =
|
contentDisposition =
|
||||||
props.get("content-disposition", Ci.nsISupportsCString).data;
|
props.get("content-disposition", Ci.nsISupportsCString).data;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
} catch(e) {}
|
||||||
} catch(e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let selectionInfo = BrowserUtils.getSelectionDetails(content);
|
let selectionInfo = BrowserUtils.getSelectionDetails(content);
|
||||||
|
|
@ -178,5 +174,5 @@ addMessageListener("Finder:Initialize", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
addEventListener("DOMWebNotificationClicked", function(event) {
|
addEventListener("DOMWebNotificationClicked", function(event) {
|
||||||
sendAsyncMessage("DOMWebNotificationClicked", { });
|
sendAsyncMessage("DOMWebNotificationClicked", {});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ nsContextMenu.prototype = {
|
||||||
this.ellipsis = "\u2026";
|
this.ellipsis = "\u2026";
|
||||||
try {
|
try {
|
||||||
this.ellipsis = gPrefService.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
this.ellipsis = gPrefService.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
this.isContentSelected = this.isContentSelection();
|
this.isContentSelected = this.isContentSelection();
|
||||||
this.onPlainTextLink = false;
|
this.onPlainTextLink = false;
|
||||||
|
|
@ -87,16 +86,14 @@ nsContextMenu.prototype = {
|
||||||
if (/^(?:https?|ftp):/i.test(linkText)) {
|
if (/^(?:https?|ftp):/i.test(linkText)) {
|
||||||
try {
|
try {
|
||||||
uri = makeURI(linkText);
|
uri = makeURI(linkText);
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
} else if (/^[-a-z\d\.]+\.[-a-z\d]{2,}[-_=~:#%&\?\w\/\.]*$/i.test(linkText)) {
|
} 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.
|
// Check if this could be a valid url, just missing the protocol.
|
||||||
let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
|
let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
|
||||||
.getService(Ci.nsIURIFixup);
|
.getService(Ci.nsIURIFixup);
|
||||||
try {
|
try {
|
||||||
uri = uriFixup.createFixupURI(linkText, uriFixup.FIXUP_FLAG_NONE);
|
uri = uriFixup.createFixupURI(linkText, uriFixup.FIXUP_FLAG_NONE);
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri && uri.host) {
|
if (uri && uri.host) {
|
||||||
|
|
@ -438,7 +435,7 @@ nsContextMenu.prototype = {
|
||||||
return gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
|
return gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
|
||||||
let inspector = toolbox.getCurrentPanel();
|
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.walker.findInspectingNode().then(nodeFront => {
|
||||||
inspector.selection.setNodeFront(nodeFront, "browser-context-menu");
|
inspector.selection.setNodeFront(nodeFront, "browser-context-menu");
|
||||||
});
|
});
|
||||||
|
|
@ -554,7 +551,7 @@ nsContextMenu.prototype = {
|
||||||
try {
|
try {
|
||||||
computedURL = this.getComputedURL(bodyElt, "background-image");
|
computedURL = this.getComputedURL(bodyElt, "background-image");
|
||||||
this._hasMultipleBGImages = false;
|
this._hasMultipleBGImages = false;
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
this._hasMultipleBGImages = true;
|
this._hasMultipleBGImages = true;
|
||||||
}
|
}
|
||||||
if (computedURL) {
|
if (computedURL) {
|
||||||
|
|
@ -613,8 +610,7 @@ nsContextMenu.prototype = {
|
||||||
// this.principal.checkMayLoad(this.linkURI, false, true);
|
// this.principal.checkMayLoad(this.linkURI, false, true);
|
||||||
this.linkDownload = elem.download;
|
this.linkDownload = elem.download;
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Background image? Don't bother if we've already found a
|
// Background image? Don't bother if we've already found a
|
||||||
|
|
@ -917,8 +913,7 @@ nsContextMenu.prototype = {
|
||||||
let url = uri.QueryInterface(Ci.nsIURL);
|
let url = uri.QueryInterface(Ci.nsIURL);
|
||||||
if (url.fileBaseName)
|
if (url.fileBaseName)
|
||||||
name = decodeURI(url.fileBaseName) + ".jpg";
|
name = decodeURI(url.fileBaseName) + ".jpg";
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = "snapshot.jpg";
|
name = "snapshot.jpg";
|
||||||
}
|
}
|
||||||
|
|
@ -1029,7 +1024,7 @@ nsContextMenu.prototype = {
|
||||||
// nsIExternalHelperAppService.doContent, which will wait for the
|
// nsIExternalHelperAppService.doContent, which will wait for the
|
||||||
// appropriate MIME-type headers and then prompt the user with a
|
// appropriate MIME-type headers and then prompt the user with a
|
||||||
// file picker
|
// file picker
|
||||||
function saveAsListener() { }
|
function saveAsListener() {}
|
||||||
|
|
||||||
saveAsListener.prototype = {
|
saveAsListener.prototype = {
|
||||||
extListener: null,
|
extListener: null,
|
||||||
|
|
@ -1059,8 +1054,7 @@ nsContextMenu.prototype = {
|
||||||
const promptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"].
|
const promptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"].
|
||||||
getService(Ci.nsIPromptService);
|
getService(Ci.nsIPromptService);
|
||||||
promptSvc.alert(doc.defaultView, title, msg);
|
promptSvc.alert(doc.defaultView, title, msg);
|
||||||
} catch (ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1091,7 +1085,7 @@ nsContextMenu.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function callbacks() { }
|
function callbacks() {}
|
||||||
|
|
||||||
callbacks.prototype = {
|
callbacks.prototype = {
|
||||||
getInterface: function(aIID) {
|
getInterface: function(aIID) {
|
||||||
|
|
@ -1111,7 +1105,7 @@ nsContextMenu.prototype = {
|
||||||
// if it we don't have the headers after a short time, the user
|
// 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
|
// won't have received any feedback from their click. that's bad. so
|
||||||
// we give up waiting for the filename.
|
// we give up waiting for the filename.
|
||||||
function timerCallback() { }
|
function timerCallback() {}
|
||||||
|
|
||||||
timerCallback.prototype = {
|
timerCallback.prototype = {
|
||||||
notify: function(aTimer) {
|
notify: function(aTimer) {
|
||||||
|
|
@ -1468,15 +1462,13 @@ nsContextMenu.prototype = {
|
||||||
try {
|
try {
|
||||||
locale = gPrefService.getComplexValue("intl.accept_languages",
|
locale = gPrefService.getComplexValue("intl.accept_languages",
|
||||||
Ci.nsIPrefLocalizedString).data;
|
Ci.nsIPrefLocalizedString).data;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
var version = "-";
|
var version = "-";
|
||||||
try {
|
try {
|
||||||
version = Cc["@mozilla.org/xre/app-info;1"].
|
version = Cc["@mozilla.org/xre/app-info;1"].
|
||||||
getService(Ci.nsIXULAppInfo).version;
|
getService(Ci.nsIXULAppInfo).version;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
uri = uri.replace(/%LOCALE%/, escape(locale)).replace(/%VERSION%/, version);
|
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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
var browser;
|
var browser;
|
||||||
var dialog = { };
|
var dialog = {};
|
||||||
var pref = null;
|
var pref = null;
|
||||||
var openLocationModule = { };
|
var openLocationModule = {};
|
||||||
try {
|
try {
|
||||||
pref = Components.classes["@mozilla.org/preferences-service;1"]
|
pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Components.interfaces.nsIPrefBranch);
|
.getService(Components.interfaces.nsIPrefBranch);
|
||||||
|
|
@ -37,8 +37,7 @@ function onLoad() {
|
||||||
if (useAutoFill) {
|
if (useAutoFill) {
|
||||||
dialog.input.setAttribute("completedefaultindex", "true");
|
dialog.input.setAttribute("completedefaultindex", "true");
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var value = pref.getIntPref("general.open_location.last_window_choice");
|
var value = pref.getIntPref("general.open_location.last_window_choice");
|
||||||
|
|
@ -47,8 +46,7 @@ function onLoad() {
|
||||||
dialog.openWhereList.selectedItem = element;
|
dialog.openWhereList.selectedItem = element;
|
||||||
}
|
}
|
||||||
dialog.input.value = gOpenLocationLastURL.value;
|
dialog.input.value = gOpenLocationLastURL.value;
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (dialog.input.value) {
|
if (dialog.input.value) {
|
||||||
// XXX should probably be done automatically
|
// XXX should probably be done automatically
|
||||||
|
|
@ -109,8 +107,7 @@ function openLocation(openData) {
|
||||||
browser.delayedOpenTab(openData.url, null, null, openData.postData, true);
|
browser.delayedOpenTab(openData.url, null, null, openData.postData, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
if (pref) {
|
if (pref) {
|
||||||
gOpenLocationLastURL.value = dialog.input.value;
|
gOpenLocationLastURL.value = dialog.input.value;
|
||||||
|
|
@ -147,6 +144,5 @@ function onChooseFile()
|
||||||
nsIFilePicker.filterImages | nsIFilePicker.filterXML |
|
nsIFilePicker.filterImages | nsIFilePicker.filterXML |
|
||||||
nsIFilePicker.filterHTML);
|
nsIFilePicker.filterHTML);
|
||||||
fp.open(fpCallback);
|
fp.open(fpCallback);
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ var padlock_PadLock =
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
gIdentityHandler.handleMoreInfoClick(event);
|
gIdentityHandler.handleMoreInfoClick(event);
|
||||||
},
|
},
|
||||||
onStateChange: function() { },
|
onStateChange: function() {},
|
||||||
onProgressChange: function() { },
|
onProgressChange: function() {},
|
||||||
onLocationChange: function() { },
|
onLocationChange: function() {},
|
||||||
onStatusChange: function() { },
|
onStatusChange: function() {},
|
||||||
onSecurityChange: function(aCallerWebProgress, aRequestWithState, aState) {
|
onSecurityChange: function(aCallerWebProgress, aRequestWithState, aState) {
|
||||||
// aState is defined as a bitmask that may be extended in the future.
|
// aState is defined as a bitmask that may be extended in the future.
|
||||||
// We filter out any unknown bits before testing for known values.
|
// 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
|
// do not warn when using local protocols
|
||||||
is_insecure = false;
|
is_insecure = false;
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
let ub = document.getElementById("urlbar");
|
let ub = document.getElementById("urlbar");
|
||||||
if (ub) {
|
if (ub) {
|
||||||
|
|
@ -84,8 +83,7 @@ var padlock_PadLock =
|
||||||
padlock_PadLock.setPadlockLevel("padlock-ib", level);
|
padlock_PadLock.setPadlockLevel("padlock-ib", level);
|
||||||
padlock_PadLock.setPadlockLevel("padlock-ib-left", level);
|
padlock_PadLock.setPadlockLevel("padlock-ib-left", level);
|
||||||
padlock_PadLock.setPadlockLevel("padlock-ub-right", level);
|
padlock_PadLock.setPadlockLevel("padlock-ub-right", level);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
padlock_PadLock.setPadlockLevel("padlock-sb", level);
|
padlock_PadLock.setPadlockLevel("padlock-sb", level);
|
||||||
padlock_PadLock.setPadlockLevel("padlock-tab", level);
|
padlock_PadLock.setPadlockLevel("padlock-tab", level);
|
||||||
|
|
@ -203,8 +201,7 @@ var padlock_PadLock =
|
||||||
try {
|
try {
|
||||||
// XXX should probably be done automatically
|
// XXX should probably be done automatically
|
||||||
document.getElementById("urlbar").setAttribute("https_color", colshow);
|
document.getElementById("urlbar").setAttribute("https_color", colshow);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
var lockenabled = padlock_PadLock.prefbranch.getBoolPref("shown");
|
var lockenabled = padlock_PadLock.prefbranch.getBoolPref("shown");
|
||||||
var padshow = "";
|
var padshow = "";
|
||||||
|
|
@ -216,8 +213,7 @@ var padlock_PadLock =
|
||||||
document.getElementById("padlock-ib").setAttribute("padshow", padshow);
|
document.getElementById("padlock-ib").setAttribute("padshow", padshow);
|
||||||
document.getElementById("padlock-ib-left").setAttribute("padshow", padshow);
|
document.getElementById("padlock-ib-left").setAttribute("padshow", padshow);
|
||||||
document.getElementById("padlock-ub-right").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-sb").setAttribute("padshow", padshow);
|
||||||
document.getElementById("padlock-tab").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").setAttribute("padstyle", padstyle);
|
||||||
document.getElementById("padlock-ib-left").setAttribute("padstyle", padstyle);
|
document.getElementById("padlock-ib-left").setAttribute("padstyle", padstyle);
|
||||||
document.getElementById("padlock-ub-right").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-sb").setAttribute("padstyle", padstyle);
|
||||||
document.getElementById("padlock-tab").setAttribute("padstyle", padstyle);
|
document.getElementById("padlock-tab").setAttribute("padstyle", padstyle);
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,7 @@ function onOK() {
|
||||||
// disableAddons will asynchronously restart the application
|
// disableAddons will asynchronously restart the application
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
restartApp();
|
restartApp();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||||
"resource://gre/modules/Console.jsm");
|
"resource://gre/modules/Console.jsm");
|
||||||
|
|
||||||
function Sanitizer() { }
|
function Sanitizer() {}
|
||||||
|
|
||||||
Sanitizer.prototype = {
|
Sanitizer.prototype = {
|
||||||
// warning to the caller: this one may raise an exception (e.g. bug #265028)
|
// 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
|
// Cache doesn't consult timespan, nor does it have the
|
||||||
// facility for timespan-based eviction. Wipe it.
|
// facility for timespan-based eviction. Wipe it.
|
||||||
cache.clear();
|
cache.clear();
|
||||||
} catch(er) {
|
} catch(er) {}
|
||||||
}
|
|
||||||
|
|
||||||
var imageCache = Cc["@mozilla.org/image/tools;1"].
|
var imageCache = Cc["@mozilla.org/image/tools;1"].
|
||||||
getService(Ci.imgITools).getImgCacheForDocument(null);
|
getService(Ci.imgITools).getImgCacheForDocument(null);
|
||||||
try {
|
try {
|
||||||
imageCache.clearCache(false); // true=chrome, false=content
|
imageCache.clearCache(false); // true=chrome, false=content
|
||||||
} catch(er) {
|
} catch(er) {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get canClear() {
|
get canClear() {
|
||||||
|
|
@ -224,16 +222,14 @@ Sanitizer.prototype = {
|
||||||
var os = Components.classes["@mozilla.org/observer-service;1"]
|
var os = Components.classes["@mozilla.org/observer-service;1"]
|
||||||
.getService(Components.interfaces.nsIObserverService);
|
.getService(Components.interfaces.nsIObserverService);
|
||||||
os.notifyObservers(null, "browser:purge-session-history", "");
|
os.notifyObservers(null, "browser:purge-session-history", "");
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Clear last URL of the Open Web Location dialog
|
// Clear last URL of the Open Web Location dialog
|
||||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Components.interfaces.nsIPrefBranch);
|
.getService(Components.interfaces.nsIPrefBranch);
|
||||||
try {
|
try {
|
||||||
prefs.clearUserPref("general.open_location.last_url");
|
prefs.clearUserPref("general.open_location.last_url");
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get canClear()
|
get canClear()
|
||||||
|
|
@ -304,14 +300,14 @@ Sanitizer.prototype = {
|
||||||
aCallback("formdata", aReason == 0 && count > 0, aArg);
|
aCallback("formdata", aReason == 0 && count > 0, aArg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FormHistory.count({ }, countDone);
|
FormHistory.count({}, countDone);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
downloads: {
|
downloads: {
|
||||||
clear: Task.async(function* (range) {
|
clear: Task.async(function* (range) {
|
||||||
let refObj = { };
|
let refObj = {};
|
||||||
try {
|
try {
|
||||||
let filterByTime = null;
|
let filterByTime = null;
|
||||||
if (range) {
|
if (range) {
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ var gSanitizePromptDialog = {
|
||||||
docElt.getButton("cancel").disabled = true;
|
docElt.getButton("cancel").disabled = true;
|
||||||
try {
|
try {
|
||||||
s.sanitize().then(window.close, window.close);
|
s.sanitize().then(window.close, window.close);
|
||||||
} catch (er) {
|
} catch(er) {
|
||||||
Components.utils.reportError("Exception during sanitize: " + er);
|
Components.utils.reportError("Exception during sanitize: " + er);
|
||||||
return true; // We *do* want to close immediately on error.
|
return true; // We *do* want to close immediately on error.
|
||||||
}
|
}
|
||||||
|
|
@ -164,8 +164,7 @@ var gSanitizePromptDialog = {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
document.documentElement.getButton("accept").disabled = !found;
|
document.documentElement.getButton("accept").disabled = !found;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// Update the warning prompt if needed
|
// Update the warning prompt if needed
|
||||||
this.prepareWarning(true);
|
this.prepareWarning(true);
|
||||||
|
|
@ -329,8 +328,8 @@ var gSanitizePromptDialog = {
|
||||||
// Now calculate the rows in the tree of the durations' start times. For
|
// 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
|
// 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.
|
// smallest time greater than or equal to the duration's start time.
|
||||||
this.durationRowsToVals = { };
|
this.durationRowsToVals = {};
|
||||||
this.durationValsToRows = { };
|
this.durationValsToRows = {};
|
||||||
var view = this.placesTree.view;
|
var view = this.placesTree.view;
|
||||||
// For all rows in the tree except the grippy row...
|
// For all rows in the tree except the grippy row...
|
||||||
for (let i = 0; i < view.rowCount - 1; i++) {
|
for (let i = 0; i < view.rowCount - 1; i++) {
|
||||||
|
|
@ -486,7 +485,7 @@ var gSanitizePromptDialog = {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
s.sanitize();
|
s.sanitize();
|
||||||
} catch (er) {
|
} catch(er) {
|
||||||
Components.utils.reportError("Exception during sanitize: " + er);
|
Components.utils.reportError("Exception during sanitize: " + er);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -592,8 +591,8 @@ var gContiguousSelectionTreeHelper = {
|
||||||
throw "contiguous selection tree helper: getGrippyRow called with " +
|
throw "contiguous selection tree helper: getGrippyRow called with " +
|
||||||
"multiple selection ranges";
|
"multiple selection ranges";
|
||||||
}
|
}
|
||||||
var max = { };
|
var max = {};
|
||||||
sel.getRangeAt(0, { }, max);
|
sel.getRangeAt(0, {}, max);
|
||||||
return max.value + 1;
|
return max.value + 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -822,8 +821,8 @@ var gContiguousSelectionTreeHelper = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// No clicking headers to sort the tree or sort feedback on columns.
|
// No clicking headers to sort the tree or sort feedback on columns.
|
||||||
view.cycleHeader = function() { };
|
view.cycleHeader = function() {};
|
||||||
view.sortingChanged = function() { };
|
view.sortingChanged = function() {};
|
||||||
|
|
||||||
// Override a bunch of methods to account for the grippy row.
|
// Override a bunch of methods to account for the grippy row.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,8 +344,7 @@ function openLinkIn(url, where, params) {
|
||||||
if (where == "current") {
|
if (where == "current") {
|
||||||
try {
|
try {
|
||||||
uriObj = Services.io.newURI(url, null, null);
|
uriObj = Services.io.newURI(url, null, null);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (where == "current" && w.gBrowser.selectedTab.pinned) {
|
if (where == "current" && w.gBrowser.selectedTab.pinned) {
|
||||||
|
|
@ -542,8 +541,7 @@ function isBidiEnabled() {
|
||||||
rv = true;
|
rv = true;
|
||||||
Services.prefs.setBoolPref("bidi.browser.ui", true);
|
Services.prefs.setBoolPref("bidi.browser.ui", true);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
@ -863,8 +861,7 @@ function isValidFeed(aLink, aPrincipal, aIsFeed) {
|
||||||
urlSecurityCheck(aLink.href, aPrincipal,
|
urlSecurityCheck(aLink.href, aPrincipal,
|
||||||
Components.interfaces.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
|
Components.interfaces.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
|
||||||
return type || "application/rss+xml";
|
return type || "application/rss+xml";
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ DistributionCustomizer.prototype = {
|
||||||
}
|
}
|
||||||
keys.sort();
|
keys.sort();
|
||||||
|
|
||||||
let items = { };
|
let items = {};
|
||||||
let defaultItemId = -1;
|
let defaultItemId = -1;
|
||||||
let maxItemId = -1;
|
let maxItemId = -1;
|
||||||
|
|
||||||
|
|
@ -91,7 +91,7 @@ DistributionCustomizer.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!items[iid]) {
|
if (!items[iid]) {
|
||||||
items[iid] = { };
|
items[iid] = {};
|
||||||
}
|
}
|
||||||
if (keys.indexOf(keys[i] + "." + this._locale) >= 0) {
|
if (keys.indexOf(keys[i] + "." + this._locale) >= 0) {
|
||||||
items[iid][iprop] = this._ini.getString(section, keys[i] + "." +
|
items[iid][iprop] = this._ini.getString(section, keys[i] + "." +
|
||||||
|
|
@ -283,7 +283,7 @@ DistributionCustomizer.prototype = {
|
||||||
}
|
}
|
||||||
defaults.setComplexValue("distribution.about",
|
defaults.setComplexValue("distribution.about",
|
||||||
Ci.nsISupportsString, partnerAbout);
|
Ci.nsISupportsString, partnerAbout);
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
/* ignore bad prefs due to bug 895473 and move on */
|
/* ignore bad prefs due to bug 895473 and move on */
|
||||||
Cu.reportError(e);
|
Cu.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
@ -365,7 +365,7 @@ function enumerate(UTF8Enumerator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function enumToObject(UTF8Enumerator) {
|
function enumToObject(UTF8Enumerator) {
|
||||||
let ret = { };
|
let ret = {};
|
||||||
for (let i in enumerate(UTF8Enumerator)) {
|
for (let i in enumerate(UTF8Enumerator)) {
|
||||||
ret[i] = 1;
|
ret[i] = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const ALLOW_SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT;
|
||||||
const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT;
|
const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT;
|
||||||
const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE;
|
const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE;
|
||||||
|
|
||||||
function AboutRedirector() { }
|
function AboutRedirector() {}
|
||||||
AboutRedirector.prototype = {
|
AboutRedirector.prototype = {
|
||||||
classDescription: "Browser about: Redirector",
|
classDescription: "Browser about: Redirector",
|
||||||
classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"),
|
classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"),
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ function doSearch(searchTerm, cmdLine) {
|
||||||
sa);
|
sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nsBrowserContentHandler() { }
|
function nsBrowserContentHandler() {}
|
||||||
nsBrowserContentHandler.prototype = {
|
nsBrowserContentHandler.prototype = {
|
||||||
classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
|
classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
|
||||||
|
|
||||||
|
|
@ -448,7 +448,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
cmdLine.preventDefault = true;
|
cmdLine.preventDefault = true;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -570,8 +570,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
// formatURLPref might return "about:blank" if getting the pref fails
|
// formatURLPref might return "about:blank" if getting the pref fails
|
||||||
if (overridePage == "about:blank") {
|
if (overridePage == "about:blank") {
|
||||||
|
|
@ -623,8 +622,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
if (height) {
|
if (height) {
|
||||||
this.mFeatures += ",height=" + height;
|
this.mFeatures += ",height=" + height;
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// The global PB Service consumes this flag, so only eat it in per-window
|
// The global PB Service consumes this flag, so only eat it in per-window
|
||||||
// PB builds.
|
// PB builds.
|
||||||
|
|
@ -702,7 +700,7 @@ function handURIToExistingBrowser(uri, location, cmdLine, forcePrivate) {
|
||||||
nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nsDefaultCommandLineHandler() { }
|
function nsDefaultCommandLineHandler() {}
|
||||||
nsDefaultCommandLineHandler.prototype = {
|
nsDefaultCommandLineHandler.prototype = {
|
||||||
classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
|
classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
|
||||||
|
|
||||||
|
|
@ -738,7 +736,7 @@ nsDefaultCommandLineHandler.prototype = {
|
||||||
var dir = fl.get("ProfD", Components.interfaces.nsILocalFile);
|
var dir = fl.get("ProfD", Components.interfaces.nsILocalFile);
|
||||||
this._haveProfile = true;
|
this._haveProfile = true;
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
while ((ar = cmdLine.handleFlagWithParam("url", false))) { }
|
while ((ar = cmdLine.handleFlagWithParam("url", false))) {}
|
||||||
cmdLine.preventDefault = true;
|
cmdLine.preventDefault = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -780,8 +778,7 @@ nsDefaultCommandLineHandler.prototype = {
|
||||||
try {
|
try {
|
||||||
handURIToExistingBrowser(urilist[0], nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW, cmdLine);
|
handURIToExistingBrowser(urilist[0], nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW, cmdLine);
|
||||||
return;
|
return;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var URLlist = urilist.filter(shouldLoadURI).map(function(u) u.spec);
|
var URLlist = urilist.filter(shouldLoadURI).map(function(u) u.spec);
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ function BrowserGlue() {
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, "_sanitizer",
|
XPCOMUtils.defineLazyGetter(this, "_sanitizer",
|
||||||
function() {
|
function() {
|
||||||
let sanitizerScope = { };
|
let sanitizerScope = {};
|
||||||
Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js", sanitizerScope);
|
Services.scriptloader.loadSubScript("chrome://browser/content/sanitize.js", sanitizerScope);
|
||||||
return sanitizerScope.Sanitizer;
|
return sanitizerScope.Sanitizer;
|
||||||
});
|
});
|
||||||
|
|
@ -475,8 +475,7 @@ BrowserGlue.prototype = {
|
||||||
try {
|
try {
|
||||||
averageTime = Services.prefs.getIntPref("browser.slowStartup.averageTime");
|
averageTime = Services.prefs.getIntPref("browser.slowStartup.averageTime");
|
||||||
samples = Services.prefs.getIntPref("browser.slowStartup.samples");
|
samples = Services.prefs.getIntPref("browser.slowStartup.samples");
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
|
|
||||||
averageTime = (averageTime * samples + currentTime) / ++samples;
|
averageTime = (averageTime * samples + currentTime) / ++samples;
|
||||||
|
|
||||||
|
|
@ -655,8 +654,7 @@ BrowserGlue.prototype = {
|
||||||
// Windows 8 is version 6.2.
|
// Windows 8 is version 6.2.
|
||||||
let version = Services.sysinfo.getProperty("version");
|
let version = Services.sysinfo.getProperty("version");
|
||||||
claimAllTypes = (parseFloat(version) < 6.2);
|
claimAllTypes = (parseFloat(version) < 6.2);
|
||||||
} catch (ex) {
|
} catch (ex) {}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
ShellService.setDefaultBrowser(claimAllTypes, false);
|
ShellService.setDefaultBrowser(claimAllTypes, false);
|
||||||
}
|
}
|
||||||
|
|
@ -962,8 +960,7 @@ BrowserGlue.prototype = {
|
||||||
Services.prefs.getBoolPref("browser.places.importBookmarksHTML");
|
Services.prefs.getBoolPref("browser.places.importBookmarksHTML");
|
||||||
if (importBookmarksHTML)
|
if (importBookmarksHTML)
|
||||||
importBookmarks = true;
|
importBookmarks = true;
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
Task.spawn(function() {
|
Task.spawn(function() {
|
||||||
// Check if Safe Mode or the user has required to restore bookmarks from
|
// Check if Safe Mode or the user has required to restore bookmarks from
|
||||||
|
|
@ -977,8 +974,7 @@ BrowserGlue.prototype = {
|
||||||
yield this._backupBookmarks();
|
yield this._backupBookmarks();
|
||||||
importBookmarks = true;
|
importBookmarks = true;
|
||||||
}
|
}
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
|
|
||||||
// If the user did not require to restore default bookmarks, or import
|
// If the user did not require to restore default bookmarks, or import
|
||||||
// from bookmarks.html, we will try to restore from JSON/JSONLZ4
|
// 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
|
// Ensure that smart bookmarks are created once the operation
|
||||||
// is complete.
|
// is complete.
|
||||||
this.ensurePlacesDefaultQueriesInitialized();
|
this.ensurePlacesDefaultQueriesInitialized();
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
Cu.reportError(e);
|
Cu.reportError(e);
|
||||||
}
|
}
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
|
|
@ -1171,8 +1167,7 @@ BrowserGlue.prototype = {
|
||||||
let maxBackups = BOOKMARKS_BACKUP_MAX_BACKUPS;
|
let maxBackups = BOOKMARKS_BACKUP_MAX_BACKUPS;
|
||||||
try {
|
try {
|
||||||
maxBackups = Services.prefs.getIntPref("browser.bookmarks.max_backups");
|
maxBackups = Services.prefs.getIntPref("browser.bookmarks.max_backups");
|
||||||
}
|
} catch(ex) {
|
||||||
catch(ex) {
|
|
||||||
// Use default.
|
// Use default.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1225,8 +1220,7 @@ BrowserGlue.prototype = {
|
||||||
let currentUIVersion = 0;
|
let currentUIVersion = 0;
|
||||||
try {
|
try {
|
||||||
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
|
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
|
||||||
} catch(ex) {
|
} catch(ex) {}
|
||||||
}
|
|
||||||
if (currentUIVersion >= UI_VERSION) {
|
if (currentUIVersion >= UI_VERSION) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1432,8 +1426,7 @@ BrowserGlue.prototype = {
|
||||||
Services.prefs.clearUserPref("privacy.donottrackheader.value");
|
Services.prefs.clearUserPref("privacy.donottrackheader.value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MOZ_JXR
|
#ifndef MOZ_JXR
|
||||||
|
|
@ -1447,8 +1440,7 @@ BrowserGlue.prototype = {
|
||||||
} else if (ihaValue.includes("image/jxr")) {
|
} else if (ihaValue.includes("image/jxr")) {
|
||||||
Services.prefs.clearUserPref(ihaPref);
|
Services.prefs.clearUserPref(ihaPref);
|
||||||
}
|
}
|
||||||
}
|
} catch(ex) {}
|
||||||
catch (ex) {}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -1468,13 +1460,13 @@ BrowserGlue.prototype = {
|
||||||
if (dsCertFile.exists()) {
|
if (dsCertFile.exists()) {
|
||||||
try {
|
try {
|
||||||
dsCertFile.remove(false);
|
dsCertFile.remove(false);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
dsKeyFile.append("key4.db");
|
dsKeyFile.append("key4.db");
|
||||||
if (dsKeyFile.exists()) {
|
if (dsKeyFile.exists()) {
|
||||||
try {
|
try {
|
||||||
dsKeyFile.remove(false);
|
dsKeyFile.remove(false);
|
||||||
} catch(e) { }
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1546,8 +1538,7 @@ BrowserGlue.prototype = {
|
||||||
var url = "about:permissions";
|
var url = "about:permissions";
|
||||||
try {
|
try {
|
||||||
url = url + "?filter=" + aPrincipal.URI.host;
|
url = url + "?filter=" + aPrincipal.URI.host;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
win.openUILinkIn(url, "tab");
|
win.openUILinkIn(url, "tab");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1555,8 +1546,7 @@ BrowserGlue.prototype = {
|
||||||
try {
|
try {
|
||||||
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
||||||
Ci.nsIAlertsService);
|
Ci.nsIAlertsService);
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1590,8 +1580,7 @@ BrowserGlue.prototype = {
|
||||||
if (!this._dataSource.HasAssertion(docResource, persistResource, aSource, true)) {
|
if (!this._dataSource.HasAssertion(docResource, persistResource, aSource, true)) {
|
||||||
this._dataSource.Assert(docResource, persistResource, aSource, true);
|
this._dataSource.Assert(docResource, persistResource, aSource, true);
|
||||||
}
|
}
|
||||||
}
|
} catch(ex) {}
|
||||||
catch(ex) {}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// ------------------------------
|
// ------------------------------
|
||||||
|
|
@ -1797,7 +1786,7 @@ BrowserGlue.prototype = {
|
||||||
_xpcom_factory: BrowserGlueServiceFactory,
|
_xpcom_factory: BrowserGlueServiceFactory,
|
||||||
}
|
}
|
||||||
|
|
||||||
function ContentPermissionPrompt() { }
|
function ContentPermissionPrompt() {}
|
||||||
ContentPermissionPrompt.prototype = {
|
ContentPermissionPrompt.prototype = {
|
||||||
classID: Components.ID("{d8903bf6-68d5-4e97-bcd1-e4d3012f721a}"),
|
classID: Components.ID("{d8903bf6-68d5-4e97-bcd1-e4d3012f721a}"),
|
||||||
|
|
||||||
|
|
@ -1904,7 +1893,7 @@ ContentPermissionPrompt.prototype = {
|
||||||
let autoAllow = !mainAction;
|
let autoAllow = !mainAction;
|
||||||
|
|
||||||
if (!aOptions) {
|
if (!aOptions) {
|
||||||
aOptions = { };
|
aOptions = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
aOptions.removeOnDismissal = autoAllow;
|
aOptions.removeOnDismissal = autoAllow;
|
||||||
|
|
@ -1994,7 +1983,7 @@ ContentPermissionPrompt.prototype = {
|
||||||
stringId: "webNotifications.showForSession",
|
stringId: "webNotifications.showForSession",
|
||||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||||
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
||||||
callback: function() { },
|
callback: function() {},
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2003,19 +1992,19 @@ ContentPermissionPrompt.prototype = {
|
||||||
stringId: "webNotifications.showForSession",
|
stringId: "webNotifications.showForSession",
|
||||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||||
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
|
||||||
callback: function() { },
|
callback: function() {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stringId: "webNotifications.alwaysShow",
|
stringId: "webNotifications.alwaysShow",
|
||||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||||
expireType: null,
|
expireType: null,
|
||||||
callback: function() { },
|
callback: function() {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stringId: "webNotifications.neverShow",
|
stringId: "webNotifications.neverShow",
|
||||||
action: Ci.nsIPermissionManager.DENY_ACTION,
|
action: Ci.nsIPermissionManager.DENY_ACTION,
|
||||||
expireType: null,
|
expireType: null,
|
||||||
callback: function() { },
|
callback: function() {},
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue