html - Google Chrome 多次执行 HTML Import (Polymer)

标签 html google-chrome polymer google-chrome-devtools

我在 Google Chrome 中遇到问题。 包含的 html 导入被加载两次。

enter image description here

Chrome 向服务器发出 2 个请求,但导入文件中的 javascript 运行一次。结果它破坏了 CSRF 保护,因为每个请求都会生成两次 token ,而 Chrome 只会放置第一个带有过时 token 的文件内容。

只有在打开 DevTools 时才会出现这种情况。

检查 list 完成:

  1. 导入不重复
  2. Firefox 和 IE 发出一个请求
  3. 导入文件中的JS console.log:记录一次
  4. 启用和禁用缓存没有区别

最佳答案

这似乎是一个 issue在当前版本的 Chrome (51.0.2704.84) 中,它似乎已在 Chrome Canary (53.0.2766.0) 中修复,因为我自己尝试了一个简单的示例,并且“网络”选项卡中仅显示一个请求。

关于html - Google Chrome 多次执行 HTML Import (Polymer),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37793252/

相关文章:

html - 移动网站 101

php - 我想为响应式 bootstrap 3 模板显示相同的图像大小

javascript - 点击时更改颜色的铁图标

javascript - 两个Web组件之间的绑定(bind): Google map + geo-localisation

session - 如何在 Polymer 中使用 app-localstorage-document

html - 在没有rtmp的情况下在jwplayer上播放m3u8文件

html - 如何调整 google reCAPTCHA 的大小?

javascript - 在扩展程序中从 Chrome 获取文本输入

javascript - preventDefault() 当在 Chrome 中的文本区域内单击制表键时

html - Chrome 媒体中心 API