Add a PDF entry point in about:pdf
Categories
(Firefox :: PDF Viewer, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: calixte, Assigned: calixte)
Details
Attachments
(4 files, 1 obsolete file)
The design spec is still a WIP:
https://www.figma.com/design/rsS3P88qV1XovaVwssmIHf/PDF.js--Null-state?node-id=245-6478&p=f&t=QIgJ9CjbrxIFXCCK-0
The idea is have a page about:pdf we can use as an entry point for the pdf viewer.
| Assignee | ||
Comment 1•5 months ago
|
||
Registers about:pdf as a privileged-about page that lets users drop or
pick a local PDF and have it open in Firefox's PDF.js viewer. On Windows,
the page also offers to set Firefox as the default PDF handler when it
isn't already.
The page itself is sandboxed content (URI_SAFE_FOR_UNTRUSTED_CONTENT)
and bridges to chrome via a RemotePage actor pair (AboutPDFChild /
AboutPDFParent) for file validation, navigation, and the
ShellService.setAsDefaultPDFHandler call.
| Assignee | ||
Comment 2•4 months ago
|
||
moz-promo sets display: flex on :host, which overrides the default
[hidden] handling, so setting the hidden attribute or property on a
moz-promo had no effect. Add an explicit :host([hidden]) rule so
consumers can hide it.
| Assignee | ||
Comment 3•4 months ago
|
||
Add the markup, styles, script and strings for the about:pdf landing
page: a drop zone and file picker for opening a local PDF in the built-in
viewer, and a promo (hidden by default) offering to set Firefox as the
default PDF handler.
The page is wired up to chrome and registered as an about: page in a
follow-up commit; on its own it is not yet reachable.
| Assignee | ||
Comment 4•4 months ago
|
||
Register about:pdf as a privileged-about page pointing at the landing
page, and add the AboutPDF JSWindowActor pair that bridges the sandboxed
content to chrome. The parent validates a dropped/picked file (file
scheme, .pdf extension, existence and %PDF- header) before navigating
the top browsing context to it, and, on Windows, exposes whether Firefox
can be set as the default PDF handler and performs that change.
Allow the page to call the RPM helpers it needs and to read/write the
promo dismissal pref.
| Assignee | ||
Comment 5•4 months ago
|
||
Cover page rendering and the drop zone, the AboutPDFParent file
validation and navigation logic, and the promo dismissal flow (including
persistence of the dismissal pref).
https://hg.mozilla.org/mozilla-central/rev/71ccc32d8010
https://hg.mozilla.org/mozilla-central/rev/17ba3bddaa21
https://hg.mozilla.org/mozilla-central/rev/ec244662c5cb
https://hg.mozilla.org/mozilla-central/rev/7f377d7a30e9
Updated•4 months ago
|
Updated•4 months ago
|
Description
•