Open mtlehtin opened 4 years ago
The issue seems to be related with historyApi. When the iframe's URL is applied by window.location.href
it changes the history stack and causes the issue. When the URL is applied by window.location.replace
without affecting the history the back-button works as intended.
This change seems the fix this issue. I'm not sure if there are any harmful side-effects with that solution.
<body onload="window.location.replace('${this.src}'); parent.postMessage('${this.iframeLoadedMessage}', '*')"></body>
I experience same issue and created PR based on the suggested solution https://github.com/officert/vue-friendly-iframe/pull/23
When clicking the back-button in Firefox, the browser will replace the url and content of the iframe with the parent's url and content. Issue can be easily reproduced in vue-friendly-iframe's documentation and demo -site.
Issue exists at least with Firefox 68.3.0, 70, 72.0.1.
Steps to reproduce:
Screenshot:
Discussion elsewhere:
https://stackoverflow.com/questions/5259154/firefox-back-button-vs-iframes https://stackoverflow.com/questions/2245883/browser-back-acts-on-nested-iframe-before-the-page-itself-is-there-a-way-to-av