mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
45adfbf2c8
--HG-- extra : rebase_source : 98337b6a8c07d05e8c961a452dd05a7d75c3c60b
63 lines
1.7 KiB
JavaScript
63 lines
1.7 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
|
|
|
this.EXPORTED_SYMBOLS = [ ];
|
|
|
|
Cu.import("resource:///modules/devtools/gcli.jsm");
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
|
|
"resource:///modules/HUDService.jsm");
|
|
|
|
/**
|
|
* 'console' command
|
|
*/
|
|
gcli.addCommand({
|
|
name: "console",
|
|
description: gcli.lookup("consoleDesc"),
|
|
manual: gcli.lookup("consoleManual")
|
|
});
|
|
|
|
/**
|
|
* 'console clear' command
|
|
*/
|
|
gcli.addCommand({
|
|
name: "console clear",
|
|
description: gcli.lookup("consoleclearDesc"),
|
|
exec: function Command_consoleClear(args, context) {
|
|
let window = context.environment.contentDocument.defaultView;
|
|
let hud = HUDService.getHudByWindow(window);
|
|
// hud will be null if the web console has not been opened for this window
|
|
if (hud) {
|
|
hud.jsterm.clearOutput();
|
|
}
|
|
}
|
|
});
|
|
|
|
/**
|
|
* 'console close' command
|
|
*/
|
|
gcli.addCommand({
|
|
name: "console close",
|
|
description: gcli.lookup("consolecloseDesc"),
|
|
exec: function Command_consoleClose(args, context) {
|
|
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab
|
|
HUDService.deactivateHUDForContext(tab);
|
|
}
|
|
});
|
|
|
|
/**
|
|
* 'console open' command
|
|
*/
|
|
gcli.addCommand({
|
|
name: "console open",
|
|
description: gcli.lookup("consoleopenDesc"),
|
|
exec: function Command_consoleOpen(args, context) {
|
|
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab
|
|
HUDService.activateHUDForContext(tab);
|
|
}
|
|
});
|