Skip to Content
Platform.Ontology

Popover and modal dialog

Shows overlays on top of everything on the page using the top layer.

Works without askingThings a page can doInterfaceWeb browsersWhile you use it

In one line

Can show a box over everything else on the page

Shows overlays on top of everything on the page using the top layer.

A site can draw modal dialogs and popovers above all other content, including iframes. They are page content, not browser UI, so well made fakes can mimic prompts.

What it can and can't do

What the user does: Nothing for most boxes. It happens when you tap a menu, a help bubble or Open details.

It can

  • Show a menu, tooltip or confirm box on top of the page
  • Dim and lock the page behind a modal box until you close it
  • Close the box when you press Esc or tap outside

It cannot

  • Cover things outside its own page, like the address bar or other tabs
  • Stop you leaving the tab or closing the browser
  • Show over another app on your phone or computer

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported1142023-05-30None
EdgeSupported1142023-06-02None
FirefoxSupported1252024-04-16None
SafariSupported172023-09-18None
Safari on iPhoneSupported172023-09-18All iOS browsers use WebKit
Chrome on AndroidSupported1142023-05-30None
Samsung InternetSupported23.02023-10-18None

How a site asks for it

API<dialog>.showModal(); popover attribute; showPopover(); closedby
Browser compat keysapi.HTMLElement.showPopover
api.HTMLDialogElement.showModal
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 lastsWhile open
How to take it backNothing to revoke (no permission is stored)
Inside an iframeTop layer belongs to each document; cannot cover browser UI

Typical flow

  1. Page calls showModal() or showPopover()
  2. Element enters top layer
  3. Light dismiss closes popovers

Data you get

Shape: none

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

Technical limits

  • No activation required to show a dialog or popover (activation required for fullscreen only)
  • Cannot draw outside the viewport or over the address bar and permission bubbles
  • popover=auto uses light dismiss; popover=manual does not
  • Support: dialog Chrome 37, Safari 15.4, Firefox 98; popover Chrome 114, Safari 17, Firefox 125

The story

What it is

A page can put a box on top of everything, using built in browser tools.

For you

Menus, tooltips and 'accept cookies' boxes sit neatly on top of the page, and keyboard and screen readers handle them better than home made versions.

For makers

Makers replace fragile custom code with built in pieces. It means fewer bugs, better accessibility and lighter pages, and it standardizes how consent banners and menus work.

Where you see it

TypeExampleApps
shoppingA product page opens a size chart as a modal that dims the page behind it.Nike, Zara
adsA cookie consent banner is drawn on top of the whole page by the site.None named
accessibilityA modal traps keyboard focus so someone using a screen reader cannot tab behind it.None named
gamesA browser game shows a pause menu on top of the playing field.None named
productivityA dropdown menu in a web app pops open above the rest of the page.GitHub, Notion
socialA photo viewer opens a lightbox over a feed.Instagram web

Risks

  • Consent banner tricks
  • Layering abuse

What the platform says

  • Google: Popover API. Chrome's blog says the Popover API lets developers show floating content above the rest of the page with little code.

Good uses and abuse

Legitimate uses

  • Modal forms
  • Menus and tooltips

Known abuse

  • Fake browser permission dialogs drawn inside the page
  • Overlay phishing

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility5 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-05, Chrome 114: Popover API ships
  • 2023-09, Safari 17: Popover API ships
  • 2024-04, Firefox 125: Popover API ships

Sources

How well checked: Based on official documentation.

On this page