summaryrefslogtreecommitdiffstats
path: root/toolkit/components/pdfjs/content/PdfjsChild.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/pdfjs/content/PdfjsChild.sys.mjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/pdfjs/content/PdfjsChild.sys.mjs')
-rw-r--r--toolkit/components/pdfjs/content/PdfjsChild.sys.mjs19
1 files changed, 8 insertions, 11 deletions
diff --git a/toolkit/components/pdfjs/content/PdfjsChild.sys.mjs b/toolkit/components/pdfjs/content/PdfjsChild.sys.mjs
index 0b5276ec12..b4162966dd 100644
--- a/toolkit/components/pdfjs/content/PdfjsChild.sys.mjs
+++ b/toolkit/components/pdfjs/content/PdfjsChild.sys.mjs
@@ -14,30 +14,27 @@
*/
export class PdfjsChild extends JSWindowActorChild {
- init(supportsFind) {
- if (supportsFind) {
+ init(aSupportsFind) {
+ if (aSupportsFind) {
this.sendAsyncMessage("PDFJS:Parent:addEventListener");
}
}
- dispatchEvent(type, detail) {
+ dispatchEvent(aType, aDetail) {
+ aDetail &&= Cu.cloneInto(aDetail, this.contentWindow);
const contentWindow = this.contentWindow;
const forward = contentWindow.document.createEvent("CustomEvent");
- forward.initCustomEvent(type, true, true, detail);
+ forward.initCustomEvent(aType, true, true, aDetail);
contentWindow.dispatchEvent(forward);
}
receiveMessage(msg) {
switch (msg.name) {
- case "PDFJS:Child:handleEvent": {
- let detail = Cu.cloneInto(msg.data.detail, this.contentWindow);
- this.dispatchEvent(msg.data.type, detail);
+ case "PDFJS:Child:handleEvent":
+ this.dispatchEvent(msg.data.type, msg.data.detail);
break;
- }
-
case "PDFJS:Editing":
- let data = Cu.cloneInto(msg.data, this.contentWindow);
- this.dispatchEvent("editingaction", data);
+ this.dispatchEvent("editingaction", msg.data);
break;
case "PDFJS:ZoomIn":
case "PDFJS:ZoomOut":