Search code examples
javascriptinternet-explorerclipboarddata

Not able to copy the clipboard data using javascript


One of the clients have the set the "Disabled" for the setting - "Allow Programmatinc clipboard access". And hence, the below line of code which is for copying a text into clipboard is not working - window.clipboardData.setData('Text', 'copied programmatically');

is there any workaround for this client without changing his IE settings/preferencess?


Solution

  • 1) Request the client to add our site(application developer/owner) to the trusted sites or a different zone. 2) And set the setting - "Allow Programmatinc clipboard access" specific to this site using the Registry Entry:

    • Go to Registry entry.
    • Add the application site to a different zone - lest us say "6"
    • And set the setting "Allow Programmatinc clipboard access" equvalent dw-word is 1407 for this zone.