1
0
Fork 0
firefox/mobile/shared/actors/GeckoViewPrintDelegateParent.sys.mjs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

35 lines
1 KiB
JavaScript

/* 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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { GeckoViewActorParent } from "resource://gre/modules/GeckoViewActorParent.sys.mjs";
export class GeckoViewPrintDelegateParent extends GeckoViewActorParent {
constructor() {
super();
this._browserStaticClone = null;
}
set browserStaticClone(staticClone) {
this._browserStaticClone = staticClone;
}
get browserStaticClone() {
return this._browserStaticClone;
}
clearStaticClone() {
// Removes static browser element from DOM that was made for window.print
this.browserStaticClone?.remove();
this.browserStaticClone = null;
}
printRequest() {
if (this.browserStaticClone != null) {
this.eventDispatcher.sendRequest({
type: "GeckoView:DotPrintRequest",
canonicalBrowsingContextId: this.browserStaticClone.browsingContext.id,
});
}
}
}