blob: e1bb17f3fb5e36fb5fe1621a3c91f8417a5659d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
'use strict';
const { Cu } = require('chrome');
const { when: unload } = require('unload');
try {
// Starting with FF 23, gcli.jsm moved to another location
Cu.import("resource://gre/modules/devtools/gcli.jsm");
} catch(e) {
try {
Cu.import("resource:///modules/devtools/gcli.jsm");
} catch(e) {
console.error("Unable to load gcli.jsm");
}
}
function addCommand(cmd) {
let name = cmd.name;
gcli.addCommand(cmd);
unload(gcli.removeCommand.bind(gcli, name));
}
exports.addCommand = addCommand;
exports.removeCommand = gcli.removeCommand;
|