diff --git a/app/src/main/assets/viewer.js b/app/src/main/assets/viewer.js index 0e04afa..280015d 100644 --- a/app/src/main/assets/viewer.js +++ b/app/src/main/assets/viewer.js @@ -210,6 +210,7 @@ function loadDocument() { } loadingTask.promise.then(function (newDoc) { + channel.onLoaded(); pdfDoc = newDoc; channel.setNumPages(pdfDoc.numPages); pdfDoc.getMetadata().then(function (data) { diff --git a/app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java b/app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java index 6e96173..f8250c7 100644 --- a/app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java +++ b/app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java @@ -202,6 +202,10 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader showPasswordPrompt(); } + @JavascriptInterface + public void onLoaded() { + } + @JavascriptInterface public String getPassword() { return mEncryptedDocumentPassword != null ? mEncryptedDocumentPassword : "";