From 4d0da26e93885d22583a0c0207809c925c76f789 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Tue, 16 Jun 2026 12:51:58 +0100 Subject: Restore findbar open hack in pdfjs viewer.mjs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When #search= hash is present, open the findbar UI and populate the find field before dispatching findfromurlhash — standard pdfjs only highlights silently without showing the bar. Co-Authored-By: Claude Sonnet 4.6 --- js/pdfjs-5.2.133/web/viewer.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/pdfjs-5.2.133/web/viewer.mjs b/js/pdfjs-5.2.133/web/viewer.mjs index e457033..a48f460 100755 --- a/js/pdfjs-5.2.133/web/viewer.mjs +++ b/js/pdfjs-5.2.133/web/viewer.mjs @@ -1169,6 +1169,10 @@ class PDFLinkService { if (params.has("search")) { const query = params.get("search").replaceAll('"', ""), phrase = params.get("phrase") === "true"; + if (query) { + PDFViewerApplication.findBar.open(); + PDFViewerApplication.findBar.findField.value = query; + } this.eventBus.dispatch("findfromurlhash", { source: this, query: phrase ? query : query.match(/\S+/g) -- cgit v1.3