6 ms·
New in Chrome 120 back button detection
- clementmas 3y agoI wish I'll be able to use the CloseWatcher API to replace my history API hack to close dialogs. As always, we're now waiting for browser support
- akersten 3y agoThe <details> name attribute example doesn't actually use the name attribute? Am I missing something?
- masswerk 3y agoI noticed this, as well. AI-generated code? (It's hard to imagine a human setting up that code and forgetting about the very thing they are attempting to demonstrate.)
- bastawhiz 3y agoI noticed the same thing. I believe it's all unintentional omission.
- clementmas 3y agoThey added it in the YouTube video but forgot it in the post https://youtu.be/oqCsXbsuvM0 https://youtu.be/oqCsXbsuvM0
- 0xfab1 3y agoMaybe it's inferred with the built-in Large Language Markup
- millzlane 3y agoI thought I was missing something. But then I came looking for confirmation. Does this mean I may have what it takes to make it in webdev?
- snailmailman 3y agoDoes this mean websites can now hijack android’s OS-level back button? In addition to hijacking the browser level one? I hate when I hit back, but instantly redirect to the same page. This is so frustrating when it happens. And it happens even on major sites. (Microsoft’s official community “answers” forums have given me this issue lately. Fills up search results and then traps you there)
- candiddevmike 3y agoI'm seeing this a lot with news sites, they'll redirect your back press to a page screen with bunch of click bait headline/images. Some of them are pretty disturbing at first glance, seems like they're trying to get shocking images in front of you to keep you engaged. I think they're trying to fight against news aggregators but it's such a shitty idea. The funny/sad thing is the folks adding this functionality are probably reading my comment. You should be ashamed of yourselves.
- derekp7 3y agoA more evil version of this is detecting which news aggregator sent you there, then making that clickbait page look like the source aggregator. I've seen this with the news feed from Chrome on Android, clicking on a store then going back I thought I was back on the news feed but the stories just didn't look right.
- Zuiii 3y agoThis could totally be used for phishing, right? Open a link in gmail -> go to nasty site -> press back and see google login page that's actually still the nasty site. Browsers should prevent cross origin sites from seeing where the visitor came from (i.e. clear referrer). Also, why doesn't the back button disable any automatic (non-user initiated) redirects on pages loaded that way? Seems like an obvious fix to the history loops we keep seeing.
- sroussey 3y ago
- tuatoru 3y agoYet another reason to use something other than Chrome.
- ggregoire 3y ago> CloseWatcher API > Chrome 120 brings the solution with CloseWatcher, a new API for directly listening and responding to close requests. > watcher.addEventListener("close", () => document.querySelector("#sidebar").classList.remove("open")); Couldn't they add an HTML attribute onCloseRequest? Slightly related, I wish there was an attribute "onClickOutside" so we could close modals and dropdown menus without manually adding an event listener on the window and checking if the click wasn't inside the element.
- domenicd 3y agoThe issue with a single global event handler is discussed here: https://github.com/WICG/close-watcher#a-single-event https://github.com/WICG/close-watcher#a-single-event If you use popover="", you get the kind of functionality you're discussing for free. For <dialog>, the discussion is in progress and reaching a conclusion: https://github.com/whatwg/html/issues/9373 https://github.com/whatwg/html/issues/9373
- chrismorgan 3y agoI don’t think I ever like accordions where you can only have one item open at a time. So often I just want to open them all, and probably wish you hadn’t collapsed them in the first place. Well, at least if people start doing it this way I can make a simple user script to just remove name attributes from <details> elements.
- rasz 3y ago>Permission policy violation reports How about my User Agent working for me instead? and doing exactly what I want and not some web page?