# “不安全 JavaScript 尝试发起导航”

**URL:** https://meta.discourse.org/t/unsafe-javascript-attempt-to-initiate-navigation/121940
**Category:** Support
**Created:** [2019年七月3日 02:37 UTC](https://meta.discourse.org/t/unsafe-javascript-attempt-to-initiate-navigation/121940 "2019-07-03T02:37:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Schmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_schmucker/32/124810_2.png) [@Mark\_Schmucker](https://meta.discourse.org/u/Mark_Schmucker)
#### Post date: [2019年七月3日 02:37 UTC](https://meta.discourse.org/t/unsafe-javascript-attempt-to-initiate-navigation/121940/1 "2019-07-03T02:37:34Z")

</div>

我在帖子中嵌入了一个 Typeform，用于让用户认证其是否符合某些资格。表单完成后有一个按钮可跳转到某个主题。该按钮之前一直正常工作，但最近失效了，报错如下：

> renderer.aa121ddee4aa58d14f43.js:13 不安全的 JavaScript 尝试从 URL 为 [我已移除 URL 名称] 的框架发起对来源为 ‘[https://forum.example.com](https://forum.example.com)’ 的框架的导航。尝试导航顶层窗口的框架处于沙箱模式，但未设置 ‘allow-top-navigation’ 或 ‘allow-top-navigation-by-user-activation’ 标志。

我意识到这可能是 Typeform 的问题，而非 Discourse，但 Discourse 似乎更有可能发生了变更。最近是否有影响此功能的更新？我的系统已是最新版本。

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2019年七月3日 09:18 UTC](https://meta.discourse.org/t/unsafe-javascript-attempt-to-initiate-navigation/121940/2 "2019-07-03T09:18:39Z")

</div>

你好，

起初我以为是 [Mitigate XSS Attacks with Content Security Policy](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243) 的问题，但我读得太快了。

这可能是 Typeform 的问题，请检查 Typeform 嵌入内容，看看是否有变化。

据我所知，`allow-top-navigation-by-user-activation` 是一项较新的功能，尚未被所有浏览器支持。

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2019年七月5日 09:18 UTC](https://meta.discourse.org/t/unsafe-javascript-attempt-to-initiate-navigation/121940/3 "2019-07-05T09:18:50Z")

</div>

此话题已在最后回复后 2 天自动关闭。不再接受新回复。
