Implement and expose window.print
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(Webcompat Priority:P1, relnote-firefox 114+, firefox111 disabled, firefox112 disabled, firefox113 disabled, firefox114 fixed)
People
(Reporter: agi, Assigned: olivia)
References
(Blocks 3 open bugs)
Details
(Keywords: webcompat:platform-bug, Whiteboard: [android-print][geckoview:m109][geckoview:m110][geckoview:m111][geckoview:m112][geckoview:m113])
Attachments
(1 file)
GeckoView does not implement window.print
.
mdn: https://developer.mozilla.org/en-US/docs/Web/API/Window/print
Updated•5 years ago
|
Any updates on this? IIRC there was actually a 'print page' button in the menue in firefox android - don't know why this was removed. I would like to use Firefox for this feature and not fallback to other apps or browsers like Chrome, which supports calling androids print dialogue. It's required not just for printing on a printer but also to pdf to store a file or page.
![]() |
||
Comment 2•3 years ago
|
||
See https://github.com/mozilla-mobile/fenix/issues/13214
window.print is sorely needed from a webcompat point of view.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Looks like all the blockers on this are fixed now. I await the final resolution. :-)
Comment 4•3 years ago
|
||
Chris, any feel who would be picking this up? This has become a webcompat risk area to be solved.
Comment 5•3 years ago
|
||
(In reply to Frank Griffith Jr from comment #4)
Chris, any feel who would be picking this up? This has become a webcompat risk area to be solved.
Do you have any examples of sites with webcompat issues due to window.print
? I'm surprised that pages or users want to print from a phone. :)
Comment 6•3 years ago
|
||
Let's consider for Fenix 109, since this bug is Webcompat Priority P1.
Do you have any examples of sites with webcompat issues due to window.print?
I found an example here: https://github.com/mozilla-mobile/fenix/issues/13214
Comment 7•3 years ago
|
||
The severity field for this bug is set to S3. However, this bug has a P1 WebCompat priority.
:cpeterson, could you consider increasing the severity of this web compatibility bug?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Should we implement window.print
using "Save as PDF" (bug 1780639) instead of calling Android print APIs?
Updated•3 years ago
|
Updated•3 years ago
|
Comment 9•3 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #8)
Should we implement
window.print
using "Save as PDF" (bug 1780639) instead of calling Android print APIs?
It's my understanding (from a cursory look at code I barely understood, so may be wrong but no one's contradicted me yet) that the Android print API requires one to generate a PDF document, so it's been my expectation while #1780639 has rumbled onward that this bug would build on that work, but not in the way you seem to be suggesting.
Apologies if I misread your intent, but I take it to be suggesting that window.print() simply routes straight to Save as PDF, not providing any capability to print to real printers (or external software pseudo-printers) available to the device through the Android API.
If that's the case I personally don't consider that to satisfy the expectations of window.print. In an earlier comment above, you expressed incredulity that anyone would be printing from a phone anyway, but on that topic I refer you then to this comment from your Customer Experience Team[1].
Of course it will be nice to at last have some roundabout method of achieving what other browsers and applicable Android apps can do natively, but it would be a mistake to think that users will settle for this when the proper, OS-level printing use case and interest is a bit more extensive than you may appreciate.
[1] https://github.com/mozilla-mobile/fenix/issues/10217#issuecomment-1299157823
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 10•2 years ago
|
||
This bug implements and opens window.print() for Android in Nightly.
Adds "GeckoView:DotPrintRequest" and "GeckoView:DotPrintFinish" events.
GeckoView:DotPrintRequest requests a PDF of the current window.print
page for Android to print. GeckoView:DotPrintFinish releases the static
browser clone created by window.print. PDF generation was additionally
adjusted to get the expected canonical browser context when printing
iframes.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 11•2 years ago
|
||
Holding for bug 1812149 and Nightly 113 to start before landing.
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
bugherder |
Comment 14•2 years ago
|
||
I assume this is something we want to call out for the release notes? Please set the relnote-firefox? flag and fill out the form.
Assignee | ||
Comment 15•2 years ago
|
||
I think so for Nightly release notes for now - it is set behind a nightly preference, but if QA and everything goes well, the preference will be set to enabled fully in bug 1809922.
Release Note Request (optional, but appreciated)
[Why is this notable]:
The JavaScript call window.print()
is now supported on Android in Nightly. This means Firefox on Android can now print website content that provides a print button that utilizes window.print()
. For example, a website with a recipe that has a "Print" button will now prepare the recipe to print as expected. (Note - This change did not add a print option to the Firefox browser menu, it allows JavaScript web page content print buttons to work.)
[Suggested wording]:
(Nightly only) Websites that use window.print() can now be printed on Android.
or
(Nightly only) Window.print() is now supported on Android.
[Links (documentation, blog post, etc)]:
MDN link - https://developer.mozilla.org/en-US/docs/Web/API/Window/print
Updated•2 years ago
|
Comment 16•2 years ago
|
||
I added a note to the Firefox 113 Nightly release notes.
Comment 17•2 years ago
|
||
Given bug 1809922, tagging the note to ride the trains when 113 goes to Beta next week.
Comment 18•2 years ago
|
||
Pushed back to 114 due to some quality issues which weren't able to be addressed in time for 113.
https://hg.mozilla.org/releases/mozilla-release/rev/484eaf4a9552
Updated•11 months ago
|
Description
•