Вот исходный код, в котором я хочу поменять одно действие
Например, вместо действия "blank" - перемотку в конец страницы, либо просто на достаточно большой интервал.
Это реально вообще?
_executeCommand: function(aCommand, aDOMWindow) {
var msg = "";
var BrowserApp = this._window.BrowserApp;
switch (aCommand) {
case "back":
BrowserApp.selectedBrowser.goBack();
break;
case "forward":
BrowserApp.selectedBrowser.goForward();
break;
case "reload":
BrowserApp.selectedBrowser.reload();
break;
case "blank":
BrowserApp.addTab("about:blank");
msg += " (" + BrowserApp.tabs.length + ")";
break;
case "close":
if (BrowserApp.tabs.length == 1)
BrowserApp.loadURI("about:blank");
else
BrowserApp.closeTab(BrowserApp.selectedTab);
msg += " (" + BrowserApp.tabs.length + ")";
break;
case "prevtab":
var tabIds = BrowserApp.tabs.map(function(tab) tab.id);
var curPos = tabIds.indexOf(BrowserApp.selectedTab.id);
var lastPos = tabIds.length - 1;
var prevPos = curPos - 1 >= 0 ? curPos - 1 : lastPos;
BrowserApp.selectTab(BrowserApp.getTabForId(tabIds[prevPos]));
msg += " (" + (prevPos + 1) + "/" + (lastPos + 1) + ")";
break;
case "nexttab":
window.scrollBy(0,1000);
msg += " (scroll)";
break;
case "search":
this._window.scrollBy(0,1000);
msg += " (scroll)";
break;
default:
alert("Error: unknown command: " + aCommand);
return;
}
this._window.NativeWindow.toast.show(this._getString(aCommand) + msg, "short");
},
config: function() {
var title = this._getString("name") + " - " + this._getString("config");
var directions = ["left", "right", "up", "down"];
var ret = {};
Services.prompt.select(
null, title, this._getString("config.direction"), directions.length,
directions.map(function(dir) ThreeFingerSwipe._getString(dir)), ret
);
var direction = directions[ret.value];
var commands = ["back", "forward", "reload", "blank", "close",
"prevtab", "nexttab", "search"];
var command = this._branch.getCharPref(direction);
commands.splice(commands.indexOf(command), 1);
commands.unshift(command);
var ret = {};
Services.prompt.select(
null, title, this._getString("config.command"), commands.length,
commands.map(function(cmd) ThreeFingerSwipe._getString(cmd)), ret
);
command = commands[ret.value];
this._branch.setCharPref(direction, command);
command = this._branch.getCharPref(direction);
var msg = this._getString("config.done") + "\n\n" +
this._getString(direction) + " : " + this._getString(command);
Services.prompt.alert(null, title, msg);
},