TinyMCE copy and paste source code from clipboard

Solution 1:

I don't think you will be able to do what you want on most modern browsers.

If you try to use the built in Cut/Copy/Paste buttons in TinyMCE you see this for most browsers:

"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."

As the message from the editor states this is simply a limitation of what you can / cannot do directly via JavaScript in certain browsers.

Imagine what you could do if your arbitrary JavaScript could access the clipboard whenever it liked? "Bad people" don't play by the rules so what if (upon loading a web page) they had JavaScript that grabbed everything from the clipboard and sent it to their servers? Over time the browser manufacturers realized that direct access to the clipboard was "bad" ... by having the user type CRTL+C and CRTL+V you are effectively telling the browser you want it to access the clipboard.

IE11 does indeed allow access via legacy APIs but Edge at present does not support the clipboard APIs at all (at least not at the time I write this).