input_stack: wrap an array instead of inherit from Array
[conkeror.git] / modules / extensions / dom-inspector.js
blobe93752c71af8a786e83ec5e910985ea2a3353c7b
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 in_module(null);
10 function open_dom_inspector () {
11     make_chrome_window("chrome://inspector/content/");
14 function inspect_dom_document (document) {
15     make_chrome_window("chrome://inspector/content/", document);
18 function inspect_dom_node (node) {
19     make_chrome_window("chrome://inspector/content/", node);
22 function inspect_javascript_object (obj) {
23     make_chrome_window("chrome://inspector/content/object.xul", obj);
26 interactive("inspector",
27     "Open the DOM Inspector in a new window.",
28     open_dom_inspector);
30 interactive("inspect-chrome",
31     "Inspect the chrome document for the current Conkeror window.",
32     function (I) { inspect_dom_document(I.window.document); });
34 interactive("inspect-page",
35     "Inspect the current content document.",
36     function (I) { inspect_dom_document(I.buffer.document); });
38 interactive("inspect-click",
39     "Inspect the target of the next mouse click.",
40     function (I) {
41         var window = I.window;
42         function handler (e) {
43             e.preventDefault();
44             e.stopPropagation();
45             window.removeEventListener("click", arguments.callee, true);
46             inspect_dom_node(e.target);
47         }
48         window.addEventListener("click", handler, true);
49         I.minibuffer.message("Click in this window to select the DOM node to inspect.");
50     });
52 provide("dom-inspector");