WebDriverDocumentInsertedActor.sys.mjs (1166B)
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 let registered = false; 6 7 /** 8 * Register the DocumentInserted actor that will propagate 9 * initial-document-element-inserted notifications from content processes to the 10 * parent process. 11 */ 12 export function registerWebDriverDocumentInsertedActor() { 13 if (registered) { 14 return; 15 } 16 17 ChromeUtils.registerProcessActor("WebDriverDocumentInserted", { 18 kind: "JSProcessActor", 19 parent: { 20 esModuleURI: 21 "chrome://remote/content/shared/js-process-actors/WebDriverDocumentInsertedParent.sys.mjs", 22 }, 23 child: { 24 esModuleURI: 25 "chrome://remote/content/shared/js-process-actors/WebDriverDocumentInsertedChild.sys.mjs", 26 observers: ["initial-document-element-inserted"], 27 }, 28 includeParent: true, 29 }); 30 registered = true; 31 } 32 33 export function unregisterWebDriverDocumentInsertedActor() { 34 if (!registered) { 35 return; 36 } 37 ChromeUtils.unregisterProcessActor("WebDriverDocumentInserted"); 38 registered = false; 39 }