Greasemonkey 将 Readonly 从 True 更改为 False
尝试将当前设置为只读的网站文本输入字段更改为 false。原因是它有一个“上传”按钮,您可以在其中浏览到计算机上的文件,然后点击上传。我只想在脚本中设置路径,但由于文本字段是只读的,所以我不能。
trying to change a websites text entry field that is currently set to read only to false. The reason being it has an 'Upload" button where you browse to the file on your computer then hit upload. I just want to set the path in a script but since the text field is read only i cannot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
文件
输入与文本字段不同。更改文本字段文本以显示文件路径不会神奇地使您的浏览器上传关联的文件。事实上,如果这可以用 Javascript 实现,那么这将是一个巨大的安全漏洞。A
file
input is not the same as a textfield. Changing the textfield text to display the file path won't magically make your browser upload the associated file. In fact, if this were doable with Javascript, it would be a huge security hole.听起来您正在描述
。如果是这样,您将无法通过 JavaScript 操作其值。这是一个安全风险,JavaScript 不允许这样做。
It sounds like you're describing an
<input type="file">
. If so, you can't manipulate its value via JavaScript. It's a security risk and JavaScript won't allow it.