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:
Tim van der Meij 2021-03-26 22:00:40 +01:00 committed by GitHub
commit ba76dd4000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
});