Skip to content

Fix protocol-relative viewer file URLs - #21676

Closed
mjibulu wants to merge 1 commit into
mozilla:masterfrom
mjibulu:fix-20218-protocol-relative-url
Closed

mjibulu wants to merge 1 commit into
mozilla:masterfrom
mjibulu:fix-20218-protocol-relative-url

Conversation

@mjibulu

@mjibulu mjibulu commented Jul 31, 2026 •

Copy link
Copy Markdown

Summary

Resolve protocol-relative file parameters against the viewer location.

Problem

A value such as //host:port/document.pdf falls through to the fallback encoder, which percent-encodes the colon in the authority and prevents the PDF from loading.

Solution

Supply the viewer location as the URL base only for protocol-relative values. Absolute and ordinary relative URL handling remains unchanged.

Testing

  • Added integration coverage for a protocol-relative PDF URL
  • Confirmed the focused test fails before the fix
  • Confirmed the focused test passes after the fix
  • npx gulp lint
  • npx gulp typestest
  • npx gulp generic
  • Relevant unit/integration results recorded above

Fixes #20218

@codecov-commenter

codecov-commenter commented Aug 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.00%. Comparing base (7fc7072) to head (e2c8def).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21676   +/-   ##
=======================================
  Coverage   90.00%   90.00%           
=======================================
  Files         263      263           
  Lines       66854    66854           
=======================================
+ Hits        60173    60174    +1     
+ Misses       6681     6680    -1     
Flag Coverage Δ
browsertest 66.53% <ø> (-0.01%) ⬇️
integrationtest 69.36% <100.00%> (+<0.01%) ⬆️
unittest 57.83% <ø> (-0.01%) ⬇️
unittestcli 56.56% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@timvandermeij

timvandermeij commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

Closing since this got fixed via #21718 instead. Thank you for your contribution though!

This branch was previously deployed

1 inactive deployment
code-coverage — e2c8defc Deployed Aug 2, 2026 by mjibulu via ubuntu-latest / firefox #526
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]: When specifying a file in viewer.html, the file cannot be displayed unless the protocol is explicitly specified.

3 participants