From 087d3c8496f932f1e6d3260de79353ca19a75cfe Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Sat, 14 Dec 2024 15:15:17 +0100 Subject: [PATCH] fix --- userscript.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/userscript.js b/userscript.js index 11dd3ea..0936759 100644 --- a/userscript.js +++ b/userscript.js @@ -62,11 +62,14 @@ function clickExportOnAllDocuments(allDocuments) { setTimeout(() => { doc.dispatchEvent(event); // Then get the context menu to click on "Export" after short delay - let exportButton = document.getElementById("exportPdfButton"); - exportButton.click(); - // Click out of context menu to allow other context menu to pop - let outer = document.getElementById("fullScreenModalDismissibleArea"); - outer.click(); + setTimeout(() => { + let exportButton = document.getElementById("exportPdfButton"); + exportButton.click(); + // Click out of context menu to allow other context menu to pop + let outer = document.getElementById("fullScreenModalDismissibleArea"); + outer.click(); + }, 100); }, 500*i); + i += 1; }) } \ No newline at end of file