-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinspector.js
34 lines (29 loc) · 934 Bytes
/
inspector.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
var DEBUG = false;
var Inspector = {};
Inspector.log = function(message) {
chrome.devtools.inspectedWindow.eval("console.log('[montage-inspector] " + message + "');");
}
Inspector.debug = function(message) {
if (DEBUG) {
this.log.apply(this, arguments);
}
}
Inspector.debug("LOADED " + (new Date()));
Inspector.run = function(funktion, callback) {
chrome.devtools.inspectedWindow.eval("("+funktion.toString()+")()", callback);
}
;(function getRootComponent() {
Inspector.run(function() {
montageRequire.async("ui/component");
}, function() {
Inspector.run(function() {
return !!montageRequire("ui/component").__root__;
}, function(component) {
if (component) {
Inspector.log("WARNING: root component NOT found!");
} else {
Inspector.debug("root component found!");
}
});
});
})();