【发布时间】:2017-03-17 06:00:33
【问题描述】:
我有一个 reactjs 网站,它使用 react-router 和 browserHistory。
今天我发现了一个问题,我不知道如何解决这个问题。 问题是,当我的网站在 iframe 中打开时,例如在谷歌翻译页面中。每次单击链接时,我的网站中的导航不再起作用,它给了我这个错误:
Uncaught DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'https://www.mywebsite.com/page' cannot be created in a document with origin 'https://translate.googleusercontent.com' and URL 'https://translate.googleusercontent.com/translate_c?depth=2&hl=fr&prev=sear….com&sl=en&u=https://www.mywebsite.com/&usg=ALkJrhiWY47c812s4y3W0cS1VDZX0xRNqA'.
有谁知道我该如何“解决”这个问题?
顺便说一句,我已经使用最新版本的 Chrome 和 Firefox(都在 Windows 上)对此进行了测试
谢谢
【问题讨论】:
-
在不查看导致错误的代码的情况下帮助您并不容易。
标签: reactjs react-router browser-history