s
Feb. 20, 2024, 1:21 a.m. |

Simon Willison's Weblog simonwillison.net

htmz


Astonishingly clever browser platform hack by Lean Rada.


Add this to a page:


<iframe hidden name=htmz onload="setTimeout(() => document.querySelector(this.contentWindow.location.hash || null)?.replaceWith(...this.contentDocument.body.childNodes))"></iframe>


Then elsewhere add a link like this:


<a href="/flower.html#my-element" target=htmz>Flower</a>


Clicking that link will fetch content from /flower.html and replace the element with ID of my-element with that content.


Via Hacker News

browser document element fetch flower hack hacker hash hidden html iframes javascript lean location null page platform via will

Software Engineer for AI Training Data (School Specific)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Python)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Tier 2)

@ G2i Inc | Remote

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US