screenshot.js (769B)
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 5 "use strict"; 6 7 const { Actor } = require("resource://devtools/shared/protocol.js"); 8 const { 9 screenshotSpec, 10 } = require("resource://devtools/shared/specs/screenshot.js"); 11 12 const { 13 captureScreenshot, 14 } = require("resource://devtools/server/actors/utils/capture-screenshot.js"); 15 16 exports.ScreenshotActor = class ScreenshotActor extends Actor { 17 constructor(conn) { 18 super(conn, screenshotSpec); 19 } 20 21 async capture(args) { 22 const browsingContext = BrowsingContext.get(args.browsingContextID); 23 return captureScreenshot(args, browsingContext); 24 } 25 };