Skip to content

A couple of small tweaks of the getPdfFilenameFromUrl helper#21222

Merged
timvandermeij merged 1 commit intomozilla:masterfrom
Snuffleupagus:getPdfFilenameFromUrl-tweaks
May 5, 2026
Merged

A couple of small tweaks of the getPdfFilenameFromUrl helper#21222
timvandermeij merged 1 commit intomozilla:masterfrom
Snuffleupagus:getPdfFilenameFromUrl-tweaks

Conversation

@Snuffleupagus
Copy link
Copy Markdown
Collaborator

@Snuffleupagus Snuffleupagus commented May 5, 2026

  • Shorten the getURL function slightly, by re-factoring the try-catch blocks.
  • Change how the decode function looks for a decoded ".pdf" name, to skip the regular expression matching when it's not needed and to allow re-using the already defined pdfRegex.

Smaller diff with https://github.com/mozilla/pdf.js/pull/21222/changes?w=1

 - Shorten the `getURL` function slightly, by re-factoring the try-catch blocks.
 - Change how the `decode` function looks for a decoded ".pdf" name, to skip the regular expression matching when it's not needed and to allow re-using the already defined `pdfRegex`.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.96%. Comparing base (a55cec4) to head (8fc5677).

Files with missing lines Patch % Lines
src/display/display_utils.js 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21222      +/-   ##
==========================================
- Coverage   55.97%   55.96%   -0.01%     
==========================================
  Files         218      218              
  Lines       59033    59033              
==========================================
- Hits        33041    33037       -4     
- Misses      25992    25996       +4     
Flag Coverage Δ
fonttest 8.67% <ø> (ø)
unittest 55.20% <62.50%> (-0.03%) ⬇️
unittestcli 55.72% <62.50%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me; thank you for flattening this code a bit!

@timvandermeij timvandermeij merged commit ac51bdf into mozilla:master May 5, 2026
22 checks passed
@Snuffleupagus Snuffleupagus deleted the getPdfFilenameFromUrl-tweaks branch May 5, 2026 20:53
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.

3 participants