summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-16 12:51:58 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-16 12:51:58 +0100
commit4d0da26e93885d22583a0c0207809c925c76f789 (patch)
treed431bdaab201b0bb9c10ee194cc8ea412d31a5b6
parentc91f6ba64930b9a0296b4b399bc19f1caa29a6f2 (diff)
downloadthemes-4d0da26e93885d22583a0c0207809c925c76f789.tar.gz
themes-4d0da26e93885d22583a0c0207809c925c76f789.tar.bz2
themes-4d0da26e93885d22583a0c0207809c925c76f789.zip
Restore findbar open hack in pdfjs viewer.mjs
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 <noreply@anthropic.com>
-rwxr-xr-xjs/pdfjs-5.2.133/web/viewer.mjs4
1 files changed, 4 insertions, 0 deletions
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)