micro-app icon indicating copy to clipboard operation
micro-app copied to clipboard

fix: iframe realod caused by the history.go method call

Open keuby opened this issue 11 months ago • 0 comments

在 iframe 沙箱中调用 history.go 方法,如果传入的不是非0的数字,浏览器会执行 location.reload,导致 iframe 重新加载,iframe 沙箱就挂了。

因此劫持 history.go 方法,如果传入的不是非0的数字,就代理到基座应用到 location.reload 方法,达到和独立运行时,执行history.go(0) 会刷新页面相同的行为表现。

keuby avatar Feb 29 '24 11:02 keuby