Files
mattgodbolt-molty 3eaf982a9c Don't rewrite the URL in embedded mode; fixes iframe embeds regressing to the front page
ensureUrlIsNotOutdated() replaces the URL with httpRoot ("/") once the
layout state diverges from the state recorded after load. That behaviour
exists so an outdated shortlink path (/z/...) doesn't linger in the
address bar, but since #8166 started running the shared state-tracking in
embedded mode too, it also fired inside /e iframes: the first edit (or
any state churn) silently rewrote the iframe's URL to "/" with no hash.

Browsers that restore an iframe's session-history URL when the parent
page reloads (Firefox does) then loaded the full site instead of the
embed: the default language example plus the privacy-policy popup, since
cookies are unreadable in a cross-site iframe.

Skip the rewrite entirely in embedded mode, and add Cypress coverage for
embeds: the intended code loads, the /e#state URL survives state
changes, and the "Edit on Compiler Explorer" link still tracks edits
(the behaviour #8166 added).

Fixes #8896

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 16:32:52 -05:00
..
2025-10-28 09:45:26 +01:00
2026-06-02 12:19:29 -05:00
2026-06-02 12:19:29 -05:00
2026-07-02 18:26:35 +01:00
2026-06-02 12:19:29 -05:00
2025-07-28 10:34:46 -05:00
2025-04-24 12:10:37 -05:00