Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
import { ActorManagerParent } from "resource://gre/modules/ActorManagerParent.sys.mjs";
let attributionActorRegister = null;
let attributionActorUnregister = null;
/**
* Fission-compatible JSWindowActor implementations.
* Detailed documentation of these options is in dom/docs/ipc/jsactors.rst,
*/
const JSWINDOWACTORS = {
Attribution: {
},
child: {
esModuleURI:
events: {
FirefoxConversionNotification: { capture: true, wantUntrusted: true },
},
},
allFrames: true,
onAddActor(register, unregister) {
attributionActorRegister = register;
attributionActorUnregister = unregister;
},
},
};
export const NewTabActorRegistry = {
init() {
ActorManagerParent.addJSWindowActors(JSWINDOWACTORS);
},
/**
* Registers the Attribution actor.
* Called by NewTabAttributionFeed when attribution is enabled.
*/
registerAttributionActor() {
if (attributionActorRegister) {
attributionActorRegister();
}
},
/**
* Unregisters the Attribution actor.
* Called by NewTabAttributionFeed when attribution is disabled.
*/
unregisterAttributionActor() {
if (attributionActorUnregister) {
attributionActorUnregister();
}
},
};