ProgressDelegateChild.sys.mjs (906B)
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 { GeckoViewActorChild } from "resource://gre/modules/GeckoViewActorChild.sys.mjs"; 6 7 export class ProgressDelegateChild extends GeckoViewActorChild { 8 // eslint-disable-next-line complexity 9 handleEvent(aEvent) { 10 debug`handleEvent: ${aEvent.type}`; 11 switch (aEvent.type) { 12 case "DOMContentLoaded": // fall-through 13 case "MozAfterPaint": // fall-through 14 case "pageshow": { 15 // Forward to main process 16 const target = aEvent.originalTarget; 17 const uri = target?.location.href; 18 this.sendAsyncMessage(aEvent.type, { 19 uri, 20 }); 21 } 22 } 23 } 24 } 25 26 const { debug, warn } = ProgressDelegateChild.initLogging("ProgressDelegate");