mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
[Editor] Add a very basic and incomplete workaround for issue #15780
The main issue is due to the fact that an editor's parent can be null when we want to serialize it and that lead to an exception which break all the saving/printing process. So this incomplete patch fixes only the saving/printing issue but not the underlying problem (i.e. having a null parent) and doesn't bring that much complexity, so it should help to uplift it the next Firefox release.
This commit is contained in:
parent
cdd39ec69e
commit
9af89381cd
6 changed files with 147 additions and 23 deletions
|
@ -100,3 +100,21 @@ async function waitForEvent(page, eventName, timeout = 30000) {
|
|||
]);
|
||||
}
|
||||
exports.waitForEvent = waitForEvent;
|
||||
|
||||
const waitForStorageEntries = async (page, nEntries) => {
|
||||
await page.waitForFunction(
|
||||
n => window.PDFViewerApplication.pdfDocument.annotationStorage.size === n,
|
||||
{},
|
||||
nEntries
|
||||
);
|
||||
};
|
||||
exports.waitForStorageEntries = waitForStorageEntries;
|
||||
|
||||
const waitForSelectedEditor = async (page, selector) => {
|
||||
await page.waitForFunction(
|
||||
sel => document.querySelector(sel).classList.contains("selectedEditor"),
|
||||
{},
|
||||
selector
|
||||
);
|
||||
};
|
||||
exports.waitForSelectedEditor = waitForSelectedEditor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue