Skip to content

Allow to have an URL as file parameter when loading the viewer#20027

Merged
timvandermeij merged 1 commit intomozilla:masterfrom
calixteman:issue20024
Jun 21, 2025
Merged

Allow to have an URL as file parameter when loading the viewer#20027
timvandermeij merged 1 commit intomozilla:masterfrom
calixteman:issue20024

Conversation

@calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman linked an issue Jun 21, 2025 that may be closed by this pull request
@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/161ca8a71177e38/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/b16e83dc7d2d35c/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/b16e83dc7d2d35c/output.txt

Total script time: 13.34 mins

  • Integration Tests: FAILED

@calixteman
Copy link
Contributor Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/d6a58f6a2102f54/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 1

Live output at: http://54.193.163.58:8877/98b0538821b3a96/output.txt

@calixteman calixteman requested a review from timvandermeij June 21, 2025 13:29
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/161ca8a71177e38/output.txt

Total script time: 29.79 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/d6a58f6a2102f54/output.txt

Total script time: 2.62 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/98b0538821b3a96/output.txt

Total script time: 6.95 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 032f80e into mozilla:master Jun 21, 2025
7 checks passed
@timvandermeij
Copy link
Contributor

Thank you!

@BowFarmer
Copy link

So how does this work in practice? I do a similar thing in my WordPress plugin, but what I do is rename and modify pdf.mjs and change
const url = src.url ? getUrlProp(src.url) : null;
to
const url = window.pdfurl;
What I pass in window.pdfurl is an encrypted url that looks something like this:
read-online?read_now=1&_wn=48da26be52&z=52&zti=1751844403&ep=U%2Fe%2FiHuRp2IFTr-etc-etc-etc-ZZZQ%3D%3D
The url is sent to my site, gets parsed and in the encrypted url is information to retrieve the pdf. The url and query strings make the url time sensitive and restricted to the signed in user.
I did all this because the way it worked before, anyone could see the full path to the pdf.
But now, I could just pass this url to pdf.mjs without needing to edit it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: http://mozilla.github.com/pdf.js/web/viewer.html down

4 participants