logoalt Hacker News

jdlshoretoday at 3:16 PM4 repliesview on HN

The “hidden until found” feature surprised me. What’s the use case for something like that?


Replies

dspilletttoday at 4:48 PM

It won't be an intended use case, but it might be a convenient place to put poisoned content for the “benefit” of scrapers…

Though humans will accidentally find it too, so using a details tag with appropriate summary as a warning would be more friendly than just hidden content. It'll still get opened, but the user at least has a way of closing it again afterwards.

Also before using it I'd want to check what old UAs including accessibility tools tend to do when they hit a value that they don't recognise for the hidden="" attribute - would what they don't recognise as a valid value result in defaulting to the content being hidden or visible/read/other?

dofmtoday at 3:31 PM

Looks like it's basically like a one way show-hidden mechanism, but the browser's built-in search will pop it open on matches.

So you could use it for additional notes, things like "view pricing terms" or "show exclusions" on product listings — stuff people need to read only when they need to read it — without it being hidden from them if they search for it.

wvbdmptoday at 3:55 PM

Pretty cool! I’ve been using <details> for this. One example would be a collapsible tree hierarchy of our organization that you can CTRL+F and still find collapsed teams and people. Or an accordion, or anything collapsible, really.

seki285today at 3:37 PM

One thing that comes to mind is JS-less image preview, clicking on an image thumbnail reveals the full preview.

show 1 reply