mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Use the string value of the field when calling the Format callback (bug 1889122)
This commit is contained in:
parent
25f6a0c139
commit
b643c0fcfb
6 changed files with 85 additions and 3 deletions
|
@ -58,6 +58,19 @@ class PDFScriptingManager {
|
|||
this.#eventBus = eventBus;
|
||||
this.#externalServices = externalServices;
|
||||
this.#docProperties = docProperties;
|
||||
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
|
||||
Object.defineProperty(this, "sandboxTrip", {
|
||||
value: () =>
|
||||
setTimeout(
|
||||
() =>
|
||||
this.#scripting?.dispatchEventInSandbox({
|
||||
name: "sandboxtripbegin",
|
||||
}),
|
||||
0
|
||||
),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setViewer(pdfViewer) {
|
||||
|
@ -258,6 +271,17 @@ class PDFScriptingManager {
|
|||
|
||||
const { id, siblings, command, value } = detail;
|
||||
if (!id) {
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("TESTING") &&
|
||||
command === "sandboxTripEnd"
|
||||
) {
|
||||
window.setTimeout(() => {
|
||||
window.dispatchEvent(new CustomEvent("sandboxtripend"));
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (command) {
|
||||
case "clear":
|
||||
console.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue