4 ms·
The ability of Javascript to alter the "copy" contents is, like the ability to disable zoom, something that's nearly always used against the user and the usabil
by pjc50 6y ago
The ability of Javascript to alter the "copy" contents is, like the ability to disable zoom, something that's nearly always used against the user and the usability and accessibility of the site. Such as appending disclaimers and copyright notices to strings.
- elpescado 6y agoThe problem is that the same medium (HTML) is used for "documents" and "applications". Programmatic access to clipboard, zoom etc is legitimate for "HTML applications" like Google Docs/Maps but unnecessary for "HTML documents", along with virtually all scripting.
- pavel_lishin 6y agoIn a more perfect world, browsers would require websites to ask permission before allowing access to the copy/paste buffer.
- sam_goody 6y agoExcept that the ability to copy is extremely useful. And creating more popup-approval fatigue doesn't help anyone. You are a super-user, so it might be the git clone URL of a really long commit. That "click to copy" button on github is really useful. The same scenario exists from Grandma, and she will click the popup or give up in frustration - neither of which is good. IMO, sites should be able to have access to the copy buffer but not to the paste. Paste should be available to the user with ctrl+P. Definitely not perfect, but more mitigable.
- pavel_lishin 6y agoI don't think the putative Grandma has much need for copy-and-paste functionality from websites. And yes, there would be fatigue, and me-the-super-user would globally block those popups from coming up. It's honestly not worth it. I would miss it maybe once a month, which is about how often I get annoyed by something messing with it. Maybe a middle ground would be allowing websites to _insert_ things into the buffer, but not _modifying_ the buffer. (Though of course, they could just inspect what's highlighted on the page, and then flat out insert that plus their garbage, except I'd argue that I don't think they need to know what I've got highlighted, then you'd point out that that would break Google Docs, and I'd suggest another popup, and you'd say that Grandma can't handle the fatigue, etc., etc.)
- pjc50 6y agoI'd quite like to see a three-way partition between "dumb document" (DOM frozen after load, possibly no processing at all), "smart document" (DOM APIs only, possibly plus classical HTML form submission), and "actual application". Ideally with a way of telling which is which before loading it. I don't realistically expect this to happen. The stupid thing about AMP is that it's trying to push sites back into the "document" box, but only so that they can be monetized more effectively by Google...
- divbzero 6y agoIt would be great if this could be enforced with browser permissions. Allow Gmail to run as an application in your browser? [Deny] [Allow] [Always Allow]
- rozab 6y agoI recently had to download an image attachment from Gmail. The download button didn't work and the context menu (the proper route for saving an image) had been disabled. I had to go into Dev tools to get it. The internet is broken.
- lioeters 6y agoFunny to see this. Just yesterday, I copied some selected text from a browser, and pasted into a terminal - big mistake. The clipboard contained junk (basically advertising) with numerous new lines. Fortunately, none of it did anything, but it was a good learning experience that I cannot trust the browser to copy the selected text as is. The very annoying thing was that the text was copied from a website with code snippets, in this specific case, some terminal commands to run. And they hijacked the clipboard so the commands are corrupted when copied and pasted. That's so asinine.. Allowing client-side JavaScript to alter clipboard content like this is a security vulnerability. What if a page suggested copying and pasting some text in a terminal, then replaced the clipboard contents with arbitrary commands. I can imagine some exceptions, like "Copy to clipboard" functionality, but there's gotta be a reasonable solution. Now that I know about this vulnerability, I have to copy & paste anything into an editor first, to make sure that it's what I actually selected and copied.