inspector.js (1782B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 "use strict"; 5 6 const { 7 Arg, 8 RetVal, 9 generateActorSpec, 10 } = require("resource://devtools/shared/protocol.js"); 11 12 const inspectorSpec = generateActorSpec({ 13 typeName: "inspector", 14 15 events: { 16 "color-picked": { 17 type: "colorPicked", 18 color: Arg(0, "string"), 19 }, 20 "color-pick-canceled": { 21 type: "colorPickCanceled", 22 }, 23 }, 24 25 methods: { 26 getWalker: { 27 request: { 28 options: Arg(0, "nullable:json"), 29 }, 30 response: { 31 walker: RetVal("domwalker"), 32 }, 33 }, 34 getPageStyle: { 35 request: {}, 36 response: { 37 pageStyle: RetVal("pagestyle"), 38 }, 39 }, 40 getCompatibility: { 41 request: {}, 42 response: { 43 compatibility: RetVal("compatibility"), 44 }, 45 }, 46 getHighlighterByType: { 47 request: { 48 typeName: Arg(0), 49 }, 50 response: { 51 highlighter: RetVal("nullable:customhighlighter"), 52 }, 53 }, 54 getImageDataFromURL: { 55 request: { url: Arg(0), maxDim: Arg(1, "nullable:number") }, 56 response: RetVal("imageData"), 57 }, 58 resolveRelativeURL: { 59 request: { url: Arg(0, "string"), node: Arg(1, "nullable:domnode") }, 60 response: { value: RetVal("string") }, 61 }, 62 pickColorFromPage: { 63 request: { options: Arg(0, "nullable:json") }, 64 response: {}, 65 }, 66 cancelPickColorFromPage: { 67 request: {}, 68 response: {}, 69 }, 70 supportsHighlighters: { 71 request: {}, 72 response: { 73 value: RetVal("boolean"), 74 }, 75 }, 76 }, 77 }); 78 79 exports.inspectorSpec = inspectorSpec;