In web development, the copy to clipboard function is often implemented. This function is very practical, but due to security issues, browser restrictions become increasingly strict, and the implementation methods become increasingly limited. By default, Firefox cannot directly operate the clipboard using JavaScript. You must enable relevant settings. It is impossible to achieve cross-browser clipboard only through javascript technology. Currently, the common advantage is to use javascript‑flash flash, and the general stream processing method is _clipboard.swf, which is the earliest implementation in foreign countries (the famous clipboard copy solution: http://www.jeffothy.com/weblog/clipboard-copy ). However, it is very feasible. _clipboard.swf is invalid in the new flash10, because flash10 specifies that the clipboard can be started only after actual operations (such as mouse clicking) are performed on the SWF. The SwF of the _clipboard.swf method is hidden. You can use JavaScript to operate the flash clipboard. Obviously, no actual user operation is performed on the SWF.
To address this problem, a new method has recently emerged outside China, and a javascript library zero clipboard has been built specifically. It contains a Flash video and a javascript interface, this flash is transparent (not hidden) and users will not notice its existence. This flash is covered by a DOM element, such as a button or Div. When you click this Dom, you actually click this flash, this action on flash can enable the flash clipboard. This is actually a clickjacking.
Demo page: http://bowser.macminicolo.net /~ Jhuckaby/zeroclipboard/
Zero clipboard project home: http://code.google.com/p/zeroclipboard/