mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +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 => {
|
this._internalEvents.set("pagesdestroy", async event => {
|
||||||
await this._dispatchPageClose(this._pdfViewer.currentPageNumber);
|
await this._dispatchPageClose(this._pdfViewer.currentPageNumber);
|
||||||
|
|
||||||
|
await this._scripting?.dispatchEventInSandbox({
|
||||||
|
id: "doc",
|
||||||
|
name: "WillClose",
|
||||||
|
});
|
||||||
|
|
||||||
this._closeCapability?.resolve();
|
this._closeCapability?.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue