Window.print()

Opens the Print Dialog to print the current document.

In most browsers, this method will block while the print dialog is open. However in more recent versions of Safari, it may return immediately.

Syntax

window.print()

Specification

Specification Status Comment
HTML Living Standard
The definition of 'print()' in that specification.
Living Standard

Browser Compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
printChrome Full support 1
Notes
Full support 1
Notes
Notes Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.
Edge Full support 12Firefox Full support 1IE Full support 5Opera Full support 6
Notes
Full support 6
Notes
Notes Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.
Safari Full support 1.1WebView Android Full support 1
Notes
Full support 1
Notes
Notes Starting with WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.
Chrome Android Full support 18
Notes
Full support 18
Notes
Notes Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.
Firefox Android No support No
Notes
No support No
Notes
Notes See bug 1247609.
Opera Android Full support 10.1
Notes
Full support 10.1
Notes
Notes Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.
Safari iOS Full support 1Samsung Internet Android Full support 1.0
Notes
Full support 1.0
Notes
Notes Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

Legend

Full support
Full support
No support
No support
See implementation notes.
See implementation notes.

See also