为什么网站会通过 onpaste="return false;" 来禁止粘贴?

4作者: gleenn7 个月前原帖
为什么网站要这样做?对于机器人等来说,这种保护措施难道不是微不足道的吗?或者说这只是为了让人们“再次确认”他们的输入?我觉得这实在令人恼火,因为我认为我更有可能正确输入一个复制粘贴的路由号或账户号,而不是手动输入任何内容。我们能不能达成一致,这种用户界面设计很糟糕,可能对正确的数据输入有害?我是不是漏掉了什么?出于沮丧,我有时甚至会打开开发者工具,出于愤怒删除这些元素上的属性。
查看原文
Why do websites do this? Isn't it trivial for bots etc to easily side-step any protection this might give? Or is it just to make people "double-check" their inputs? I find it completely maddening because I would assume I'm way more likely to correctly input a copy-pasted e.g. routing or account number than if I have to manually enter anything. Can we just agree this is terrible UI and is probably detrimental to correct data entry? What am I missing? In frustration I even sometimes open the dev tools and remove this attribute on elements out of spite.