Popover API
developer.chrome.com
developer.chrome.com
In about 3 years we will finally have a popover-blocker that eliminates these annoying "subscribe to my newsletter" and "5% off now" popovers.
And in 10 years we invent a "slideontop" element, which will have the same functionality.
There are certainly differences. Accessibility, tab functionality, semantics. But most importantly, browsers can sensibly position these to flow away from the edge of the screen when the containing element is at the edge of the viewport (previously with CSS you'd have to choose a direction, and would need Javascript to position anything based on the element's place in the viewport)
Of course everyone is free to cheer for it. I, for one, refrain from celebrating.
Also, this change will make it easier to make a popover-blocker than it was before.
*##[popover]
That uBlock Origin rule will block any HTML element with a 'popover' attribute. I just tested and can confirm that popovers never display for me now. This is a simple type of ad–block rule that will even work in manifest v3.If blocking popovers is really what you want, you should be celebrating that they're now clearly indicated in the markup. Instead of figuring out the particular incantation to block a popover on some site, you can block them easily per-site or everywhere. If anything, intrusive popover usage will be limited because of how easy they are to block. Ad displayers will end up avoiding them.
Of course, I don't think you actually want to do this. There's many uses of popovers that aren't intrusive. But I'm really struggling to see how this makes anything worse.
This is probably the sort of person who disabled JavaScript and went around telling people their site doesn't work without JavaScript instead of enabling JavaScript.
Anyway, this is Chrome-only for now, so unless Safari implements this, it can't become mainstream.
But there are very few situations where you'd need a modal.
And right there you lose the elderly crowd who will never learn how to use tabs and barely understand the back button.
Strong personal bias but modals always felt like a huge sign of weakness, a narrowing of complex situations to make UI design easier/simpler, but not necessarily better.
If those are the only differences I do not understand why they need to invent an entirely new API for this. Why not add options to dialog.showModal? In my experience, light-dismiss also makes sense for many dialogs.
I really want to have great, accessible dialogs and popups. But after dialogs were added to chrome in 2014 it took 8 years until there were also available in firefox and safari. I do not want to have to wait for that long again.
The problems with dialog were so numerous that no one wanted them as specified. At one point Chrome suggested that `dialog` spec should be removed. [0]
But then a curious thing happened: browsers decided to remove alert/confirm/prompt with zero replacement for their functionality [1]. Once again, Chrome was the first to announce this, with an insanely short deadline.
After an outcry (and an outrage) this was rolled back, and literally within months `dialog` with no changes and all the issues intact and unsolved landed in all major browsers.
[0] https://github.com/whatwg/html/pull/4184#issuecomment-440405...
Having recently been working with popup menus inside a virtualised infinity scroll, with an impossible z-index stack, that makes my heart sing. Potentially no more somewhat ugly Vue Teleport or React Portal hacks!
Some other limitations of the checkbox hack compared to this new `popover` attribute:
* doesn't support closing a popover by pressing the ESC key, something interfaces that can overlap other content should support * doesn't support closing by clicking anywhere outside the popover
Safari and Edge preview builds are supporting popover as well. Mozilla has indicated they’re “positive” on it. Still might be a long time before it’s generally usable but it is in the standard.
Everything old is new again :( arghhh popups
https://github.com/WebKit/standards-positions/issues/74
Hmm. I wish some other ones got as warm of a reception as this one.
Progressive enhancement should be the default, not rejecting APIs because they're not available everywhere. Especially in this case because there's a polyfill...
Users will see a page that only works in Chrome, and a few more users and devs will move over.
And the Chrome team will become ever more entrenched in their belief that they control the web, and Google will faithfully look to use that power against us.
Google already tried to move the web to their servers with AMP. They are not on your side.