command.sys.mjs (778B)
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 import { Module } from "chrome://remote/content/shared/messagehandler/Module.sys.mjs"; 6 7 class CommandModule extends Module { 8 destroy() {} 9 10 /** 11 * Commands 12 */ 13 14 testInterceptModule() { 15 return "intercepted-value"; 16 } 17 18 async testInterceptAndForwardModule(params, destination) { 19 const windowGlobalValue = await this.messageHandler.handleCommand({ 20 moduleName: "command", 21 commandName: "testForwardToWindowGlobal", 22 destination, 23 }); 24 return "intercepted-and-forward+" + windowGlobalValue; 25 } 26 } 27 28 export const command = CommandModule;