Disable print commands in xul pages (was: Print and Print Preview on XUL pages like about:addons and about:config don't work and should be disabled)

NEW
Unassigned

Status

()

defect
9 years ago
6 months ago

People

(Reporter: martijn.martijn, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: not-ready, URL)

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
To reproduce, go to about:addons, then try to print or print preview.

Actual result:
You get "an unexpected error occured while printing" error dialog.

Expected result:
Print preview or a print dialog should come up or you shouldn't be able to print/print preview from the menu.
Wonder if we should just disable Print/Print Preview for all about: pages.
Keywords: uiwanted
It's a general problem for about: pages. So moving over to Core:Printing.
Component: Add-ons Manager → Print Preview
OS: Windows 7 → All
Product: Toolkit → Core
QA Contact: add-ons.manager → printing
Hardware: x86 → All
Summary: Can't print/print preview the add-ons manager → Can't print or print preview about: pages
Version: unspecified → 1.9.2 Branch
(Reporter)

Comment 3

9 years ago
It's not a general problem for about: pages, it's because the about: pages are xul documents.
Yep.  We have no support for printing XUL.
Let's take the consistent behavior and disable/fade out the print menu while in the add-ons manager, as we do for the Library, Download Manager, etc.
Keywords: uiwanted
Shall we move this bug back to Addons Manager and file a new one for the underlying issue? Or do we already have one on file?
This is really just a browser problem - the menu items (and commands in general) for printing (and possibly other commands too?) should be disabled for such about: pages.
Component: Print Preview → Menus
Product: Core → Firefox
QA Contact: printing → menus
Version: 1.9.2 Branch → Trunk

Comment 8

9 years ago
Most pages listed on about:about work, just the XUL pages like about:addons and about:config don't.
Summary: Can't print or print preview about: pages → Print and Print Preview on XUL pages like about:addons and about:config don't work and should be disabled
(In reply to comment #8)
> Most pages listed on about:about work, just the XUL pages like about:addons and
> about:config don't.

I think printing should also be disabled for pages that can print but make no sense to print. eg, printing about:blank is never going to be useful; neither is saving it.
Unless, that about:blank page has content...

It's not a matter of "sense".  We should disable print for pages that we cannot print - meaning any xul page (not just about/chrome).
Assignee: nobody → mano
Status: NEW → ASSIGNED
Summary: Print and Print Preview on XUL pages like about:addons and about:config don't work and should be disabled → Disable print commands in xul pages (was: Print and Print Preview on XUL pages like about:addons and about:config don't work and should be disabled)
Duplicate of this bug: 578850

Comment 12

9 years ago
Support for printing about pages and especially about:config not only should but MUST be available. It is essential for many of the tasks I would do if I could print that page.
ametedinov@gmail.com : Please avoid useless comments.  If you want to be able to print XUL pages (that includes about:config), look for that bug on that.  This one is just about disabling the UI commands for pages which cannot be printed.
Attachment #463352 - Flags: ui-review?(faaborg) → ui-review+
Comment on attachment 463352 [details] [diff] [review]
the patch

>+    if (content.document && mimeTypeIsTextBased(content.document.contentType)) {
>+      this.isImage.removeAttribute('disabled');
>+      if (content.document instanceof XULDocument)
>+        this.isPrintable.setAttribute('disabled', 'true');
>+      else
>+        this.isPrintable.removeAttribute('disabled');
>+    }
>+    else {
>+      this.isImage.setAttribute('disabled', 'true');
>+      this.isPrintable.removeAttribute('disabled');
>+    }

This wrongly disables printing for standalone images.

nits: s/updateBroadcasters/_updateBroadcasters/ and double quotes instead of single quotes?
Attachment #463352 - Flags: review?(dao) → review-
Comment on attachment 463352 [details] [diff] [review]
the patch

Ugh, I misread the code, there shouldn't be a problem with images. Maybe rename isPrintable to printCommands, as printCommands.removeAttribute("disabled") etc. better matches natural language...
Attachment #463352 - Flags: review- → review+
Duplicate of this bug: 597617
Attachment #463352 - Flags: approval2.0? → approval2.0+
Comment on attachment 463352 [details] [diff] [review]
the patch

Never landed.
Attachment #463352 - Flags: approval2.0+ → approval2.0-
This doesn't apply cleanly on trunk any more.
Whiteboard: not-ready

Comment 20

2 years ago
I am seeing this bug. 

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 ID:20170918210324

There is a patch for this. Can it be checked and fixed?
> There is a patch for this.

Which doesn't apply on trunk, right?  See comment 19.

Comment 22

2 years ago
(In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from comment #21)
> > There is a patch for this.
> 
> Which doesn't apply on trunk, right?  See comment 19.

Perhaps someone can update it so it DOES apply correctly. Thanks.
Assignee: asaf → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.