-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbootstrap.js
50 lines (41 loc) · 1.68 KB
/
bootstrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* 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/. */
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyGetter(this, "osString", () =>
Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS);
XPCOMUtils.defineLazyGetter(this, "toolStrings", () =>
Services.strings.createBundle("chrome://memory-profiler/locale/strings.properties"));
XPCOMUtils.defineLazyGetter(this, "toolDefinition", () => ({
id: "memory-profiler",
ordinal: 41,
key: toolStrings.GetStringFromName("MemoryProfiler.commandkey"),
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
icon: "chrome://memory-profiler/skin/icon.png",
url: "chrome://memory-profiler/content/tool.xul",
label: toolStrings.GetStringFromName("MemoryProfiler.label"),
tooltip: toolStrings.GetStringFromName("MemoryProfiler.tooltip"),
isTargetSupported: function(target) {
return target.isLocalTab;
},
build: function(iframeWindow, toolbox) {
Cu.import("chrome://memory-profiler/content/panel.js");
let panel = new MemoryProfilerPanel(iframeWindow, toolbox);
return panel.open();
}
}));
function startup() {
gDevTools.registerTool(toolDefinition);
}
function shutdown() {
gDevTools.unregisterTool(toolDefinition);
Services.obs.notifyObservers(null, "startupcache-invalidate", null);
}
function install() {
}
function uninstall() {
}