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()
Specifications
Specification |
---|
HTML Standard (HTML) # printing |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
print |
1
Starting with Chrome 46, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
12 |
1 |
5 |
6
Starting with Opera 33, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
1.1 |
1
Starting with WebView 46, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
18
Starting with Chrome 46, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
No
See bug 1247609.
|
10.1
Starting with Opera 33, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
1 |
1.0
Starting with Samsung Internet 5.0, this method is blocked inside an
<iframe> unless its sandbox attribute has the value allow-modals . |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/print