mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #13056 from Snuffleupagus/Doc-WillClose
Dispatch a "Doc/WillClose" event, when scripting is enabled, when closing the document
This commit is contained in:
commit
ba76dd4000
1 changed files with 5 additions and 0 deletions
|
@ -128,6 +128,11 @@ class PDFScriptingManager {
|
|||
this._internalEvents.set("pagesdestroy", async event => {
|
||||
await this._dispatchPageClose(this._pdfViewer.currentPageNumber);
|
||||
|
||||
await this._scripting?.dispatchEventInSandbox({
|
||||
id: "doc",
|
||||
name: "WillClose",
|
||||
});
|
||||
|
||||
this._closeCapability?.resolve();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue