<

Allowing Access to the Windows Clipboard

Published on
28,367 Points
22,067 Views
3 Endorsements
Last Modified:
Approved
Community Pick
Do you ever get that "Do you want to allow this web page to access your clipboard?" pop-up message in Windows Explorer?
Internet Explorer's clipboard warningThis happens when a script on the page executes a sequence like:
var s="new clipboard text!";
window.clipboardData.setData('Text', s );

Open in new window

The pop-up is a security enhancement added to Internet Explorer starting with IE 7.  There is a setting under Tools/Internet Options/Security that lets you disable the warning, but the default setting is "Prompt" and I highly recommend that you leave it that way.

Why?  Because there are web sites that will read the contents of your clipboard to learn personal information (who among us hasn't copied-and-pasted a password at one time or another?) and there are many websites that will try to delete the contents of your clipboard (e.g., as a really stupid attempt to prevent you from copying images) and, worst of all, there are known exploits involving drag-and-drop operations that can get your computer infected with a virus or Trojan horse.

So leaving the setting at Prompt will warn you that something nefarious is going on in some script on that page, and you can cancel the operation and avoid that site in the future.

However...
There are times when allowing a page to access your clipboard can be convenient.  For instance, in the article Some EE-useful JavaScripts for the IE Context Menu, I provided some scripts that might save you some time and effort in posting here at Experts-Exchange.  One of the scripts copies text to the clipboard, and thus triggers the security warning.  That makes that particular script slightly less convenient to use.

Fortunately, it is possible to set IE with specific security settings when accessing specific websites; all you need to do is include EE as one of your trusted sites, and then modify the security settings for trusted sites.

1) Navigate to any web page on the trusted site
2) Select the IE menu item Tools/Internet Options
3) Click the Security tab
4) Click the Trusted Sites zone (it has a green checkmark icon)
5) Click Sites
6) Verify that the "Add this website" box has the domain name of the site you trust.
7) If the "Require server verification for (https) for all sites on this zone" checkbox is checked, clear it.
8) Click Add and then Close
Adding a "Trusted Site"
That site is now trusted, but you also need to change the settings for trusted sites.  We are going to change just the one setting that relates to clipboard access.

1) Back in the Internet Options/Security dialog, verify that Trusted Sites is still highlighted.
2) Click the Custom level... button.
3) Scroll down to the Scripting section near the bottom (Tip: press S a few times).
4) Change Allow Programmatic clipboard access to Enable
5) Click OK and also OK the Internet Options dialog.
Allow clipboard access at trusted sites.
That's all there is to it.  Now when you are viewing any page on that site, you will not be prompted with the "Do you want to allow this web page to access your clipboard?" warning.

Obvious, But Obligatory Warning:

!!! If you don't trust a site, don't put it on your Trusted Sites list !!!

Note to EE Article Authors:
Putting Experts-Exchange on your "Trusted Sites" list will avoid an irritating prompt that appears in the "Write Your Article" page when you click the "Create Hyperlink" button in the article editing window.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If you liked this article and want to see more from this author,  please click the Yes button near the:
      Was this article helpful?
label that is just below and to the right of this text.   Thanks!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
3
Comment
Author:DanRollins
1 Comment
 
LVL 18

Expert Comment

by:Ravi Agrawal
I voted yes. Nice Article.

Ravi.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Join & Write a Comment

This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month