Debian package: Add support for xulrunner 18
[conkeror.git] / modules / extensions / dom-inspector.js
blob43e393926371f321fad1caf2b2c5048e86064440
1 /**
2  * (C) Copyright 2008 Jeremy Maitin-Shepard
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 function open_dom_inspector () {
9     make_chrome_window("chrome://inspector/content/");
12 function inspect_dom_document (document) {
13     make_chrome_window("chrome://inspector/content/", document);
16 function inspect_dom_node (node) {
17     make_chrome_window("chrome://inspector/content/", node);
20 function inspect_javascript_object (obj) {
21     make_chrome_window("chrome://inspector/content/object.xul", obj);
24 interactive("inspector",
25     "Open the DOM Inspector in a new window.",
26     open_dom_inspector);
28 interactive("inspect-chrome",
29     "Inspect the chrome document for the current Conkeror window.",
30     function (I) { inspect_dom_document(I.window.document); });
32 interactive("inspect-page",
33     "Inspect the current content document.",
34     function (I) { inspect_dom_document(I.buffer.document); });
36 interactive("inspect-click",
37     "Inspect the target of the next mouse click.",
38     function (I) {
39         var window = I.window;
40         function handler (e) {
41             e.preventDefault();
42             e.stopPropagation();
43             window.removeEventListener("click", arguments.callee, true);
44             inspect_dom_node(e.target);
45         }
46         window.addEventListener("click", handler, true);
47         I.minibuffer.message("Click in this window to select the DOM node to inspect.");
48     });
50 provide("dom-inspector");