On Sun, Apr 10, 2011 at 11:30, Charles McCathieNevile <[email protected]>wrote:
> comments on a couple of timeless' comments. > > > On Sun, 10 Apr 2011 18:20:35 +0200, timeless <[email protected]> wrote: > >> Calling clearData() empties the system clipboard, or removes the specified >>> type of data from the clipboard. See HTML5 for details [HTML5]. >>> >> >> This has issues. If the user has inserted something the user cares >> about into the system clipboard, then allowing a web page to stomp on >> it is annoying. Something needs to protect the user from such web >> apps. >> > > Yes - should that comment be on HTML5 though, or alternatively is there a > reason not to copy it? I'm not sure the spec needs to go out of its way to guard against this. Typically, when writing to a clipboard, you'd clear all the data on the clipboard before writing the new data; otherwise, you might end up with text from one window, HTML from another, and a URL from a third. A page that wanted to stomp on user data could simply do something like event.clipboardData.setData('text/plain', ''). Daniel
