Feat: Implement (add) a JavaScript window.printpreview() method




11 years ago
8 years ago


(Reporter: scunliffe, Unassigned)



Firefox Tracking Flags

(Not tracked)




11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071008 Firefox/
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071008 Firefox/

There are many circumstances when calling window.print() on a page is handy when developing web based applications, to (for example) print only the contents of a frame (say an SVG map).

However, this circumvents the print preview screen, which provides the much needed scaling, portrait/landscape options etc. (e.g. I often scale a print as desired, then print only pages 3-5)

To be honest, the method name can be whatever you want, or become an overloaded version of .print()

window.print( boolean showPreview );

Either way, designers could take advantage of this new method, and provide the end users with a choice.

function printWindow( winObj ){
  var msg = 'Would you like to preview your print request?';
  } else {

Reproducible: Always

Steps to Reproduce:
1. No steps - Feature Request
Actual Results:  
No JavaScript .printpreview() functionality available

Expected Results:  
Some level of JavaScript .printpreview() functionality

Comment 1

11 years ago
Note that Firefox on Mac doesn't have a print preview feature like Firefox on Windows.  Instead, the Print dialog has a Preview button, which acts like "Print to PDF" followed by showing the result in Preview.app.

Also note that Gecko has had memory safety bugs that only show up in print preview mode, so we can't let sites just put you in print preview mode.

Comment 2

11 years ago
Hmm, didn't know about the memory issue...  However if the user can do a print preview on any site, I'm guessing that solving the mem issue is something that can/should be done in parallel, rather than be a stumbling block for a feature like this?

I'm not a big Mac user, so I don't know this, but does Safari have a print preview button/feature from the menu?

I suppose if the OS of the browser doesn't directly support a print preview option, "upgrading" the call to a .print() wouldn't be too out of place (and in the Mac scenario, would provide that print preview option)
This is a mass search for bugs that are in the Firefox General component, are UNCO, and have not been changed for 1000 days and have an unspecified version. 

Reporter, can you please update to Firefox 3.6.10, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the bug, please update this bug. If the issue is gone, please set the resolution to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
Whiteboard: [CLOSEME 2010-11-01]
Component: General → General
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → general
Hardware: x86 → All
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.