Closed Bug 104501 Opened 23 years ago Closed 22 years ago

[FIX][RFE]add pref to print via window.print() without printer dialog

Categories

(Core :: Printing: Output, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.1alpha

People

(Reporter: e_samios, Assigned: rods)

References

Details

Attachments

(1 file, 1 obsolete file)

We are building a database driven intranet application (a Point-of-Sale system).
Linux/Apache/mySQL/PHP on the server, Mozilla providing the GUI on all clients.
The application will print hundreds of reports (cash register receipts - the 
store sells hardware and prints A4 sized receipts) every day - all to the same 
printer.
I was going to use the javasacript "window.print()" command to fire off each 
report.
Unfortunately the print dialog box is opening every time.
I tested IE on Windows (obviously) and noticed that if you press the "Print" 
button on the toolbar, the print dialog box does not appear!
This gave me enough hope to believe that it may be possible with Mozilla - 
certainly if running windows, maybe on Linux.
If IE can do it...
I realise that this requirement is not universal, so I thought a flag in the 
preferences asking for "Print Dialog Confirmation" would be ideal.
All serious database reporting tools I have seen (such as Crystal Reports) have 
the ability to print without a dialog box - otherwise a database application 
would be bogged down.
Add this feature, and I believe the database guys will be very pleased.
It will give Mozilla a leg-up in the corporate intranet world.
If you built an information kiosk with a single attached printer, you would not 
want inexperienced users to be faced with a print dialog box - so even the non-
database guys could take advantage of this feature.
This is an enhancement bug. 
no dupes found -> marking new
Severity: major → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Summary: Print Dialog Box is killing my application! → [RFE]add pref to print via window.print() without printer dialog
Target Milestone: --- → mozilla1.1
Blocks: 125824
I would strongly recommend any such option should be (a) off by default and
(b) have some additional safeguards to limit the scope of servers allowed to
print without a dialog box.  Otherwise some malicious site could cause your
system to generate hundreds of pages of junk on the default printer with some
simple Javascript.
--> Rod.. seems to be a UI issue you might want to look into.
Assignee: dcone → rods
I think being able to turn off/on the Print Dialog and Print Progerss Dialog via
prefs would be a good idea for those need to do a lot of printing or automated
printing via JS.
Status: NEW → ASSIGNED
Target Milestone: mozilla1.1alpha → mozilla1.0.1
Attached patch patch (obsolete) — Splinter Review
Enables the Print and Progress dialogs to be turned on/ioff via the "Advanced"
prefs.
Comment on attachment 90504 [details] [diff] [review]
patch

r=dcone
Attachment #90504 - Flags: review+
Comment on attachment 90504 [details] [diff] [review]
patch

sr=alecf
though I wonder if we really want to expose this pref via the pref UI - this
has the potential to really cause havoc on a user's machine.
Attachment #90504 - Flags: superreview+
Target Milestone: mozilla1.0.1 → mozilla1.1alpha
No, we do not want UI for this -- the "Advanced" panel is not a catch-all!  The
Print button on the Navigator toolbar should bypass the dialog and print
immediately, for the user who prints often.  This is how both Internet Explorer
and Microsoft Word behave.
Attachment #90504 - Flags: needs-work+
I can't think of a reason for *anybody* but embeddors and people setting up
standalone machines (like kiosks or POS systems). I can think of no good reason
to put it into the preferences dialog.  I have no problem with this as a hidden
pref.

Unrelated side-note: This patch needs to be updated to apply to a recent tree.
All but one of the patches are offset, and one does not apply at all.
I find it highly doubtful that anyone using Mozilla as browser (as opposed to
the embedded use described here) would want to turn off confirmation; as Blake
pointed out, there's already the "Print" button for this purpose. This should be
a hidden pref, and should only be enabled by specific embedders. cc'ing mstoltz
to look at this; I know the patch is simple, but allowing arbitrary JS to do as
it pleases with the printer deserves a good going-over.
ok so now if i enable this pref and accidentally browse to a porn or ad page i
can experience printed ads spewing out of my printer without any prompts?

if an embedder wants this feature, they should get CAPS to support it on a per
site basis. I don't mind clicking on a link which grants approval to
printing.mycorp.com but, i don't want anyone to be at risk to random possibly
offensive or expensive (color ads) turning up in their office printing bin.

there should *not* be an app wide preference.

most embedders don't even support printing (i know the company i worked for
didn't), generic embedders (like galeon) certainly don't need this pref, and
anyone developing a custom embedding app should be able to replace the print
dialog with something that doesn't prompt.

as such, i think this should be wontfix. but if someone wants to propose a CAPS
version of this feature, i wouldn't object.
Ok, here is the same patch without the Prefs UI changes, this way any user who
is advanced enoughed to set their prefs manually can have this feature.
Attachment #90504 - Attachment is obsolete: true
Comment on attachment 92218 [details] [diff] [review]
patch without UI changes

bringing r and sr forward becuase no changes were made to the two reminaing
files in the diff
Attachment #92218 - Flags: superreview+
Attachment #92218 - Flags: review+
Summary: [RFE]add pref to print via window.print() without printer dialog → [FIX][RFE]add pref to print via window.print() without printer dialog
Please note the earlier bug report #61850 on quiet printing. 

When wishing to print a directory (or page selection list) from a XUL 
application, silent printing is essential.

Would a <PRINT/> XUL widget provide better security? The idea being that only a 
physical mouse click on a XUL print widget would be able of calling XUL based 
javascript printing routine(s).
I only ask because it seems that perhaps a XUL or XBL based widget could then 
intrinsically provide greater security priviledges, functionality, ease of use 
than the standard Mozilla pref and print dialog boxes

<PRINT iframe="iframeid' quiet='true' copies="2" orientation="landscape" />
fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
(In reply to comment #16)
> fixed

I posted instructions on how to make use of this at:

http://forums.mozillazine.org/viewtopic.php?t=48336
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: