зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254496 - Remove gURLBar null-checks. r=dao
This commit is contained in:
Родитель
831eafdf2f
Коммит
b3deb181bb
|
@ -85,10 +85,8 @@ var CustomizationHandler = {
|
|||
UpdateUrlbarSearchSplitterState();
|
||||
|
||||
// Update the urlbar
|
||||
if (gURLBar) {
|
||||
URLBarSetURI();
|
||||
XULBrowserWindow.asyncUpdateUI();
|
||||
}
|
||||
URLBarSetURI();
|
||||
XULBrowserWindow.asyncUpdateUI();
|
||||
|
||||
// Re-enable parts of the UI we disabled during the dialog
|
||||
let menubar = document.getElementById("main-menubar");
|
||||
|
|
|
@ -385,8 +385,7 @@ var PlacesCommandHook = {
|
|||
}
|
||||
|
||||
// Revert the contents of the location bar
|
||||
if (gURLBar)
|
||||
gURLBar.handleRevert();
|
||||
gURLBar.handleRevert();
|
||||
|
||||
// If it was not requested to open directly in "edit" mode, we are done.
|
||||
if (!aShowEditUI)
|
||||
|
@ -460,8 +459,7 @@ var PlacesCommandHook = {
|
|||
}
|
||||
|
||||
// Revert the contents of the location bar
|
||||
if (gURLBar)
|
||||
gURLBar.handleRevert();
|
||||
gURLBar.handleRevert();
|
||||
|
||||
// If it was not requested to open directly in "edit" mode, we are done.
|
||||
if (!aShowEditUI)
|
||||
|
|
|
@ -408,10 +408,8 @@ const gSessionHistoryObserver = {
|
|||
// Hide session restore button on about:home
|
||||
window.messageManager.broadcastAsyncMessage("Browser:HideSessionRestoreButton");
|
||||
|
||||
if (gURLBar) {
|
||||
// Clear undo history of the URL bar
|
||||
gURLBar.editor.transactionManager.clear()
|
||||
}
|
||||
// Clear undo history of the URL bar
|
||||
gURLBar.editor.transactionManager.clear()
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -462,13 +460,12 @@ var gPopupBlockerObserver = {
|
|||
if (aEvent.originalTarget != gBrowser.selectedBrowser)
|
||||
return;
|
||||
|
||||
if (!this._reportButton && gURLBar)
|
||||
if (!this._reportButton)
|
||||
this._reportButton = document.getElementById("page-report-button");
|
||||
|
||||
if (!gBrowser.selectedBrowser.blockedPopups) {
|
||||
// Hide the icon in the location bar (if the location bar exists)
|
||||
if (gURLBar)
|
||||
this._reportButton.hidden = true;
|
||||
this._reportButton.hidden = true;
|
||||
|
||||
// Hide the notification box (if it's visible).
|
||||
let notificationBox = gBrowser.getNotificationBox();
|
||||
|
@ -479,8 +476,7 @@ var gPopupBlockerObserver = {
|
|||
return;
|
||||
}
|
||||
|
||||
if (gURLBar)
|
||||
this._reportButton.hidden = false;
|
||||
this._reportButton.hidden = false;
|
||||
|
||||
// Only show the notification again if we've not already shown it. Since
|
||||
// notifications are per-browser, we don't need to worry about re-adding
|
||||
|
@ -997,10 +993,8 @@ var gBrowserInit = {
|
|||
|
||||
if (!window.toolbar.visible) {
|
||||
// adjust browser UI for popups
|
||||
if (gURLBar) {
|
||||
gURLBar.setAttribute("readonly", "true");
|
||||
gURLBar.setAttribute("enablehistory", "false");
|
||||
}
|
||||
gURLBar.setAttribute("readonly", "true");
|
||||
gURLBar.setAttribute("enablehistory", "false");
|
||||
goSetCommandEnabled("cmd_newNavigatorTab", false);
|
||||
}
|
||||
|
||||
|
@ -4340,14 +4334,15 @@ var XULBrowserWindow = {
|
|||
this.reloadCommand.removeAttribute("disabled");
|
||||
}
|
||||
|
||||
if (gURLBar) {
|
||||
URLBarSetURI(aLocationURI);
|
||||
URLBarSetURI(aLocationURI);
|
||||
|
||||
BookmarkingUI.onLocationChange();
|
||||
SocialUI.updateState();
|
||||
UITour.onLocationChange(location);
|
||||
gTabletModePageCounter.inc();
|
||||
}
|
||||
BookmarkingUI.onLocationChange();
|
||||
|
||||
SocialUI.updateState();
|
||||
|
||||
UITour.onLocationChange(location);
|
||||
|
||||
gTabletModePageCounter.inc();
|
||||
|
||||
// Utility functions for disabling find
|
||||
var shouldDisableFind = function shouldDisableFind(aDocument) {
|
||||
|
@ -7288,19 +7283,17 @@ var gPrivateBrowsingUI = {
|
|||
}
|
||||
}
|
||||
|
||||
if (gURLBar) {
|
||||
let value = gURLBar.getAttribute("autocompletesearchparam") || "";
|
||||
if (!PrivateBrowsingUtils.permanentPrivateBrowsing &&
|
||||
!value.includes("disable-private-actions")) {
|
||||
// Disable switch to tab autocompletion for private windows.
|
||||
// We leave it enabled for permanent private browsing mode though.
|
||||
value += " disable-private-actions";
|
||||
}
|
||||
if (!value.includes("private-window")) {
|
||||
value += " private-window";
|
||||
}
|
||||
gURLBar.setAttribute("autocompletesearchparam", value);
|
||||
let urlBarSearchParam = gURLBar.getAttribute("autocompletesearchparam") || "";
|
||||
if (!PrivateBrowsingUtils.permanentPrivateBrowsing &&
|
||||
!urlBarSearchParam.includes("disable-private-actions")) {
|
||||
// Disable switch to tab autocompletion for private windows.
|
||||
// We leave it enabled for permanent private browsing mode though.
|
||||
urlBarSearchParam += " disable-private-actions";
|
||||
}
|
||||
if (!urlBarSearchParam.includes("private-window")) {
|
||||
urlBarSearchParam += " private-window";
|
||||
}
|
||||
gURLBar.setAttribute("autocompletesearchparam", urlBarSearchParam);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче