I have an iframe that’s rendering some content. I want to programmatically change the iframe’s src attribute. However I don’t want this change to affect the browser’s history.
My initial attempt is this, but this is causing the browser (Firefox) to add history entries when changing the src:
get previewUrl(): SafeString {
return htmlSafe(`...`);
}
<iframe src={{this.previewUrl}} />
See also something this question from 2 decades ago: javascript - Reload an IFRAME without adding to the history - Stack Overflow