【问题标题】:Why <form action="index.html"> changes on <form action="about:blank"> in Google Chrome?为什么 <form action="index.html"> 在 Google Chrome 中的 <form action="about:blank"> 发生变化?
【发布时间】:2013-07-18 09:39:36
【问题描述】:

使用此代码创建文件 index.html:

<html> 
<body>
<form action="index.html" method="post">
<textarea name="content">
</textarea><br>
<input type="submit" value="submit">
</form>
</body>
</html>

在谷歌浏览器中打开这个文件。 在 textarea 中输入此文本

action="index.html"

然后按提交按钮。 打开开发者工具(按 Ctrl+Shift+I)并看到这个

<html> 
<body>
<form action="about:blank" method="post">
<textarea name="content">
</textarea><br>
<input type="submit" value="submit">
</form>
</body>
</html>

为什么将 action="index.html" 替换为 action="about:blank"

问题仅存在于 Google Chrome,当前版本 28.0.1500.72 m。

【问题讨论】:

    标签: html google-chrome textarea


    【解决方案1】:

    问题是来自 chrome 的 XSS 过滤器。它会在它认为是注射的形式上更改 action,对于 about:blank(除其他外)

    尝试发送X-XSS-Protection: 0 标头来禁用它。

    所以,它不是错误,而是一个特性。

    在此处了解更多信息:https://code.google.com/p/chromium/issues/detail?id=83503

    【讨论】:

      猜你喜欢
      • 2012-01-13
      • 2019-07-05
      • 2010-10-18
      • 1970-01-01
      • 1970-01-01
      • 2016-09-04
      • 2021-09-20
      • 2015-05-14
      • 1970-01-01
      相关资源
      最近更新 更多