1 | const inspectorCommands = require('./InspectorBackendCommands');
|
2 | import * as debuggerDomains from '.';
|
3 | import { attachDOMInspectorEventCallbacks, attachDOMInspectorCommandCallbacks } from './devtools-elements';
|
4 | let DOMDomainDebugger = class DOMDomainDebugger {
|
5 | constructor() {
|
6 | this.events = new inspectorCommands.DOMDomain.DOMFrontend();
|
7 | this.commands = {};
|
8 | attachDOMInspectorEventCallbacks(this.events);
|
9 | attachDOMInspectorCommandCallbacks(this.commands);
|
10 |
|
11 |
|
12 | this.enable();
|
13 | }
|
14 | get enabled() {
|
15 | return this._enabled;
|
16 | }
|
17 | enable() {
|
18 | if (debuggerDomains.getDOM()) {
|
19 | throw new Error('One DOMDomainDebugger may be enabled at a time.');
|
20 | }
|
21 | else {
|
22 | debuggerDomains.setDOM(this);
|
23 | }
|
24 | this._enabled = true;
|
25 | }
|
26 | |
27 |
|
28 |
|
29 | disable() {
|
30 | if (debuggerDomains.getDOM() === this) {
|
31 | debuggerDomains.setDOM(null);
|
32 | }
|
33 | this._enabled = false;
|
34 | }
|
35 | getDocument() {
|
36 | const domNode = this.commands.getDocument();
|
37 | return { root: domNode };
|
38 | }
|
39 | removeNode(params) {
|
40 | this.commands.removeNode(params.nodeId);
|
41 | }
|
42 | setAttributeValue(params) {
|
43 | throw new Error('Method not implemented.');
|
44 | }
|
45 | setAttributesAsText(params) {
|
46 | this.commands.setAttributeAsText(params.nodeId, params.text, params.name);
|
47 | }
|
48 | removeAttribute(params) {
|
49 | throw new Error('Method not implemented.');
|
50 | }
|
51 | performSearch(params) {
|
52 | return null;
|
53 | }
|
54 | getSearchResults(params) {
|
55 | return null;
|
56 | }
|
57 | discardSearchResults(params) {
|
58 | return;
|
59 | }
|
60 | highlightNode(params) {
|
61 | return;
|
62 | }
|
63 | hideHighlight() {
|
64 | return;
|
65 | }
|
66 | resolveNode(params) {
|
67 | return null;
|
68 | }
|
69 | };
|
70 | DOMDomainDebugger = __decorate([
|
71 | inspectorCommands.DomainDispatcher('DOM'),
|
72 | __metadata("design:paramtypes", [])
|
73 | ], DOMDomainDebugger);
|
74 | export { DOMDomainDebugger };
|
75 |
|
\ | No newline at end of file |