Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / toolkit / actors / AutoplayParent.sys.mjs
blob3e9f807b3a47e80cc51291e1f3860c08d273c38a
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 export class AutoplayParent extends JSWindowActorParent {
7   receiveMessage(aMessage) {
8     let topBrowsingContext = this.manager.browsingContext.top;
9     let browser = topBrowsingContext.embedderElement;
10     let document = browser.ownerDocument;
11     let event = document.createEvent("CustomEvent");
12     event.initCustomEvent("GloballyAutoplayBlocked", true, false, {
13       url: this.documentURI,
14     });
15     browser.dispatchEvent(event);
16   }