Window.print()

Sumário

Abre a janela de impressão para imprimir o documento atual.

Sintaxe

window.print() 

Notas

Começando com o  Chrome 46.0 este método é bloqueado dentro de um <iframe> a menos que seu atributo sandbox tem o valor allow-modal .

Especificação

Especificação Status Comentário
HTML Living Standard
The definition of 'print()' in that specification.
Padrão em tempo real

Compatibilidade entre Navegadores

Update compatibility data on GitHub
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.

Veja também