Skip to Content
Platform.Ontology

Open the print dialog

Opens the system print dialog for the page, no click required in most browsers.

Does something on your deviceThings a page can doDevice outputWeb browsersWhile you use it

In one line

Can open your print window, without a click in most browsers

Opens the system print dialog for the page, no click required in most browsers.

A site can ask to print itself or a hidden frame. It cannot choose a printer or print silently, and it cannot read what the person does in the dialog.

What it can and can't do

What the user does: Nothing in most cases. It happens when the page runs a print command, or you tap Print.

It can

  • Open the print dialog for the current page
  • Format the page for print with its own print styles
  • Let you save the page as a PDF from the print window

It cannot

  • Print without you pressing Print in the dialog
  • Pick a printer or change the settings for you
  • See what printer you use or what your printer is called
  • Print in the background after you leave the page

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported122015-07-29None
FirefoxSupported12004-11-09None
SafariSupported1.12003-10-24None
Safari on iPhoneSupported12007-06-29All iOS browsers use WebKit
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIwindow.print(); beforeprint/afterprint events; @media print
Browser compat keysapi.Window.print
api.Window.beforeprint_event
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsOne-shot
How to take it backNothing to revoke (no permission is stored)
Inside an iframeSandboxed frames need allow-modals; cross-origin frames print only their own content

Typical flow

  1. Script calls window.print()
  2. Browser opens print preview
  3. afterprint fires when the dialog closes

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • Blocks the page until the dialog is dismissed in most browsers
  • Cannot print silently, choose the printer, or read the print result (no kiosk printing without enterprise policy)
  • Chrome ignores print() in sandboxed iframes lacking allow-modals
  • Repeated print() calls are not rate limited in the spec; Chrome limits when the tab is in the background
  • Page cannot read the printed output or the printer list

The story

What it is

A page can open your print window, usually without asking.

For you

A receipt or ticket page may open the print box by itself. You can always cancel it. Nothing prints until you confirm.

For makers

Makers use it for receipts, tickets and reports, so you get a clean paper version in one step. Print style sheets also let one page look right on screen and on paper.

Where you see it

TypeExampleApps
travelAfter booking, a boarding pass page opens the print box so you can print it.Ryanair, Booking.com
bankingA statement page offers a print button with a layout cleaned for paper.None named
shoppingAn order confirmation has a Print receipt button.Amazon
educationA school portal prints a certificate or a worksheet.None named
productivityAn online document tool prints a neat version without the toolbars.Google Docs
enterpriseA warehouse tool prints shipping labels as soon as an order is packed.None named

Risks

  • Surprise print dialogs
  • Printing private data

Good uses and abuse

Legitimate uses

  • Receipts
  • Invoices
  • Tickets

Known abuse

  • Print dialog spam
  • Distraction loops

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2023-01, Chrome 112: Print from sandboxed iframes requires allow-modals

Sources

How well checked: Based on official documentation.

On this page