Add a "Print selection only" menu item to the context menu when there is a selection
Categories
(Toolkit :: Printing, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox83 | --- | fixed |
People
(Reporter: stefan.bach, Assigned: emilio)
References
Details
(Whiteboard: [print2020_v83][old-ui-])
Attachments
(1 external file)
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
Updated•24 years ago
|
Updated•21 years ago
|
Comment 5•20 years ago
|
||
Updated•18 years ago
|
Comment 9•17 years ago
|
||
Comment 11•17 years ago
|
||
Comment 13•16 years ago
|
||
Updated•15 years ago
|
Comment 14•14 years ago
|
||
Comment 17•8 years ago
|
||
Comment 18•6 years ago
|
||
Mark, from the platform side, this should be supported by FrameLoader.printPreview now. You'd create a separate browser element for the selection print preview document, and do something like this when first creating the selection print preview document:
// Clone and get the selection from the original print preview document:
let originalPreviewBrowserWindowID = <get this>;
settings.printRange = Ci.nsIPrintSettings.kRangeSelection;
let {
totalPageCount,
} = await selectionPreviewBrowser.frameLoader.printPreview(
settings, originalPreviewBrowserWindowID);
Comment 20•6 years ago
|
||
Emilio, I believe what's described in comment 18 is Fission compatible. Let me know if you see issues with that.
| Assignee | ||
Comment 21•6 years ago
|
||
I don't think so, specially if the selected text is in the OOP iframe. I don't think that works at all right now.
Comment 22•6 years ago
|
||
We should bump this to P1 given it's one of our two highest-priority features for 83. That said, it sounds like per comment 21 a checkbox is still not an easy option.
| Assignee | ||
Comment 23•6 years ago
|
||
I'll try to prototype something, even though maybe not a checkbox... :-)
Comment 24•6 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #21)
I don't think so, specially if the selected text is in the OOP iframe. I don't think that works at all right now.
If we had a field on BrowsingContext to indicate which BrowsingContexts have a selection, we could do a depth first traversal of them and select the first with a selection (or maybe something smarter [in future], such as preferring the first with a selection that is on-screen). We could then clone that BrowsingContext into a second print preview browser, setting Ci.nsIPrintSettings.kRangeSelection on the settings object that we pass when making the clone.
| Assignee | ||
Comment 25•6 years ago
|
||
Is there an objection to making this work more like how "View selection source" works? Seems very similar to that feature.
Comment 26•6 years ago
|
||
By which you mean it would require using the context menu? Yeah, mainly that it's not very discoverable, and we wouldn't have parity with Chrome's much more discoverable checkbox in the print UI.
Comment 27•6 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #24)
If we had a field on BrowsingContext to indicate which BrowsingContexts have a selection
If it matters, we could set this field only for static clone docs (i.e. during the original clone).
| Assignee | ||
Comment 28•6 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #26)
By which you mean it would require using the context menu? Yeah, mainly that it's not very discoverable, and we wouldn't have parity with Chrome's much more discoverable checkbox in the print UI.
I disagree with this argument FWIW. I didn't even know Chrome had such a feature, because you need to select before printing (which if you don't know the feature exists, you never do). Otherwise you'll never see the checkbox.
A context menu item seems much more discoverable to me, because it's where most of the other selection actions are, but maybe it's just me.
| Assignee | ||
Comment 29•6 years ago
|
||
In fact, Chrome has a context menu > Print entry, when you have selected text.
| Assignee | ||
Comment 30•6 years ago
|
||
(well, and when you don't, but it defaults to "Print selection only" when there's a selection)
| Assignee | ||
Comment 31•6 years ago
|
||
This allows to use the feature from the context menu and is very
straight-forward.
This has the benefit of working with fission (as print from the focused
frame) and so on.
Making a checkbox on the UI on top of this is doable, but it is a lot
more complex (requires a bunch of both front-end and platform work)
because undoing this implies restoring the DOM which "print selection"
removes.
I think the context menu entry is very useful regardless of whether we
add a checkbox to undo it, and other browsers (with smaller context
menus) seem to agree.
Updated•6 years ago
|
| Assignee | ||
Comment 32•6 years ago
|
||
This is partial in the sense that it doesn't implement the actual checkbox to undo it. I think it's worth landing regardless, but let me know if you disagree.
In any case bug 1668767 should unblock most of the other work (I think we should be able to make the front-end work with that, modulo fission-compat, which is platform work).
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
| bugherder | ||
Comment 36•6 years ago
|
||
Changing the bug title to reflect what was actually implemented for this bug report.
I've spun off bug 1670122 to cover adding a "Print selection only" checkbox in the new print UI.
Updated•2 years ago
|
Description
•