Sitemap

Dark patterns with the HTML 5.2 <dialog> tag and Chrome for fun and profit

3 min readJan 31, 2018

--

Press enter or click to view image in full size
I couldn’t find a really good image for this story, so here is a stock hacker photo instead.

I’ve added some additional comments to this post based on some feedback. As some have pointed out, you could really do this with any piece of the DOM and JavaScript — and they are correct. My suggestion is that however for something like a modal which is designed to focus user interaction you would have to ship something like jQuery or Bootstrap. This is now a feature in the platform and as such I think should be used responsibly (but I doubt it will — I’m sure we’ll soon see it being used for those annoying SIGN UP FOR MY NEWSLETTER popups). My main feature request would be to implement a global state like isThereAlreadyAModalOpen ? and disallow any future showModalcalls to avoid flooding the browser with dialogs and to have a way to always guarantee their closing, but I have been working on a solution for that below.

--

--

Tane Piper
Tane Piper

Written by Tane Piper

Senior Software Leader @ IKEA — Digital Acceleration and Data Transformation