by Kalabasa · 2y ago · 0 comments
There is no such technique. One way to distinguish is to pick a URL convention and modify the URL (before the hash) of the iframe URL. For example, add ?iframe=true to the URL, and then have the server check for that. Perhaps more usefully you could include information about the parent URL, e.g. url += '?parent=${document.referrer}'. Or something.
Edit: rather than a header, dynamically adding a query parameter to the URL of the element that was clicked would probably fit better with htmz's approach.
I just added an example using Sec-Fetch-Dest
https://github.com/Kalabasa/htmz/commit/6ad3a76be3ee755bb5e7...