5 ms·
I prefer window.prompt("Press Ctrl-C then Enter", text); I don't want sites to be able to randomly clear my clipboard.
by tyho 11y ago
I prefer
window.prompt("Press Ctrl-C then Enter", text);
I don't want sites to be able to randomly clear my clipboard.
- JoshTriplett 11y agoI don't mind sites being able to send data to the clipboard, as long as 1) they have explicit permission, and 2) they can only do so in response to a user action.
- ploxiln 11y agoBut if 2 is the only restriction, they could trick you into clicking something (anything anywhere on the page), and then silently access your clipboard.
- linksbro 11y ago>Access your clipboard There is no API for reading from the clipboard, just writing to it. The benefits of having a flashless copy/cut function greatly outweigh the off chance some random site will copy something stupid to your clipboard if you interact with it.
- deleted 11y ago[deleted]
- dsp1234 11y agoexecCommand[0] has a "paste" option, which pastes the content of the clipboard at the current insertion point. This allows for "reading" of the clipboard. This article doesn't mention "paste" specifically, but the footnote[1] in the "paste" section says: "[1] Before Firefox 41, clipboard capability needed to be enabled in the user.js preference file. See A brief guide to Mozilla preferences for more information. In Firefox 41 and later, clipboard capability are enabled by default in any event handler that is able to pop-up a window (semi-trusted scripts)." This footnote is not attached to any other command, and thus "paste" is singled out. This could just be a documentation error, or maybe they didn't want to highlight that paste was also being enabled. I don't have a FF v41 in order to test what the actual behavior is. [0] - https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand https://developer.mozilla.org/en-US/docs/Web/API/Document/ex...
- linksbro 11y ago"paste" is not enabled for non-trusted scripts on FF 41+. A extensions' scripts can use "paste" since they are trusted scripts; but a webpage's script cannot. I believe that footnote is a doc error, since copy/cut are enabled w/o user.js override on FF 41+. I don't know if there is any current plans to make "paste" available for all scripts - I don't think there would be because of the obvious concerns.
- mystor 11y agoThere are no plans to make "paste" available to scripts. User's clipboards can contain too much sensitive information.
- JoshTriplett 11y agoIn theory, Firefox could track if the current clipboard data was put there by the same origin, and allow paste if and only if so. That might be useful.
- userbinator 11y agoThe benefits of having a flashless copy/cut function greatly outweigh the off chance some random site will copy something stupid to your clipboard if you interact with it. While using Flash just for clipboard copying is not ideal, it seems easier to block Flash and stop sites from doing this (and other annoying things Flash is known for, like ads and autoplaying videos...) than blocking small parts of JavaScript APIs integrated into the browser.
- JoshTriplett 11y agoWhich is why both are required, and why there's no paste, just cut/copy.
- lukifer 11y agoI consider it an OS-level deficiency that clipboard copy is destructive by default. The fact that no major OS has multi-clipboard out of the box in 2015 is shameful.
- tomphoolery 11y agoEven with multiple registers in Vim, I still can't get my mind to think that way. I just link everything with the system clipboard because it's easier to deal with. How do you comprehend all of that hidden information in memory? To me, it seems like a useful feature if you do or can use it, but for most users it's just extra complexity.
- tyho 11y agoEven worse with vim is there are operations like delete which push to the register stack without you intending it, it makes it really difficult to keep track of where your stuff is without looking.
- hboon 11y agoOther than mapping the unnamed register to the system clipboard, I usually use a few specific registers — "a, "b for cut/copy and paste, and "q, "w for macros. Would be interesting to see how other vim users do it.
- giancarlostoro 11y agoBy major you mean Windows and Mac? I know Linux has had tools to do this for a long time (as far back as I can remember ever using KDE). Indeed it's very sad that Windows and Mac can't do what my cell phone can.
- lukifer 11y agoI mean by default. There are tools available for all platforms, but the user has to seek them out.
- _lce0 11y ago
- moron4hire 11y agoAnything involving modal dialogs is bad UX these days, especially considering the variety of platforms web code needs to run on. You don't have "CTRL+C" on a smartphone or tablet.
- y0ghur7_xxx 11y agoKDE has this out of the box, so I think you may refer to windows. I am using this with great pleasure http://www.outertech.com/en/clipboard-history http://www.outertech.com/en/clipboard-history :)