Bug 1880914 - Move BrowserStop. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D206102
This commit is contained in:
Yi Xiong Wong
2024-04-03 10:32:27 +00:00
parent 3df27d805a
commit e26b29eb0a
6 changed files with 9 additions and 10 deletions

View File

@@ -196,6 +196,10 @@ var BrowserCommands = {
}
},
stop() {
gBrowser.webNavigation.stop(Ci.nsIWebNavigation.STOP_ALL);
},
home(aEvent) {
if (aEvent?.button == 2) {
// right-click: do nothing

View File

@@ -68,7 +68,7 @@
<command id="Browser:ForwardOrForwardDuplicate" oncommand="BrowserCommands.forward(event);" disabled="true">
<observes element="Browser:Forward" attribute="disabled"/>
</command>
<command id="Browser:Stop" oncommand="BrowserStop();" disabled="true"/>
<command id="Browser:Stop" oncommand="BrowserCommands.stop();" disabled="true"/>
<command id="Browser:Reload" oncommand="if (event.shiftKey) BrowserCommands.reloadSkipCache(); else BrowserCommands.reload()" disabled="true"/>
<command id="Browser:ReloadOrDuplicate" oncommand="BrowserCommands.reloadOrDuplicate(event)" disabled="true">
<observes element="Browser:Reload" attribute="disabled"/>

View File

@@ -2634,7 +2634,7 @@ function HandleAppCommandEvent(evt) {
break;
case "Stop":
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true") {
BrowserStop();
BrowserCommands.stop();
}
break;
case "Search":
@@ -2677,10 +2677,6 @@ function HandleAppCommandEvent(evt) {
evt.preventDefault();
}
function BrowserStop() {
gBrowser.webNavigation.stop(Ci.nsIWebNavigation.STOP_ALL);
}
function loadOneOrMoreURIs(aURIString, aTriggeringPrincipal, aCsp) {
// we're not a browser window, pass the URI string to a new browser window
if (window.location.href != AppConstants.BROWSER_CHROME_URL) {

View File

@@ -33,7 +33,6 @@
"gBrowserInit",
"HandleAppCommandEvent",
"BrowserCommands",
"BrowserStop",
"kSkipCacheFlags",
"loadOneOrMoreURIs",
"openLocation",

View File

@@ -45,7 +45,7 @@ add_task(async function () {
null,
true
);
BrowserStop();
BrowserCommands.stop();
await browserStoppedPromise;
});
});

View File

@@ -125,7 +125,7 @@ add_task(async function () {
null,
true
);
BrowserStop();
BrowserCommands.stop();
await browserStoppedPromise;
is(
@@ -207,7 +207,7 @@ add_task(async function () {
null,
true
);
BrowserStop();
BrowserCommands.stop();
await browserStoppedPromise;
is(