Patterns for dealing with browser restrictions on accessing the clipboard


Modern browsers restrict web application access to the clipboard for security reasons. While the user may paste content using standard keyboard shortcuts (Ctrl/Cmd+V), a web application cannot provide a “Paste” button that accesses the OS clipboard and pulls whatever it finds there into the page.

IE, surprisingly enough, handles this most gracefully, asking the user whether or not they want to allow the application to access the clipboard. The user’s decision is remembered for the length of the session.

It is possible to write an extension for Chrome that a user must install. This is complicated and problematic in many situations, but may be worth it to the user if they need to do a lot of pasting in the web app. It also, of course, requires additional development effort and maintenance. It may be possible to do the same for Firefox. I’m not sure about Safari.

Jama, a requirements management tool, pops a dialog when the paste button in their application is pressed, displaying the following message: “Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window. Please paste inside the following box using the keyboard (Ctrl/Cmd+V) and hit OK.” This is followed by a text area.

Has anyone else had to deal with this issue? Are there other patterns you are aware of?