Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Post Locked by Machavity
Notice added Wiki Answer by Machavity
Shorten (Flash is long dead).
Source Link
Mateen Ulhaq
  • 27.9k
  • 21
  • 121
  • 155

How do I copy text to the clipboard (multi-browser)?

A nice trick without using FlashRelated: How does Trello access the user's clipboard?

How do I copy text to the clipboard (multi-browser)?

A nice trick without using Flash: How does Trello access the user's clipboard?

How do I copy text to the clipboard (multi-browser)?

Related: How does Trello access the user's clipboard?

Shorten (remove non-working example).
Source Link
Mateen Ulhaq
  • 27.9k
  • 21
  • 121
  • 155

What is the best way toHow do I copy text to the clipboard (multi-browser)?

I have tried:

function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); clipboardHelper.copyString(text); } } 

But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined.

A nice trick without using Flash: How does Trello access the user's clipboard?

What is the best way to copy text to the clipboard (multi-browser)?

I have tried:

function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); clipboardHelper.copyString(text); } } 

But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined.

A nice trick without using Flash: How does Trello access the user's clipboard?

How do I copy text to the clipboard (multi-browser)?

A nice trick without using Flash: How does Trello access the user's clipboard?

Actually, it IS about Adobe's product (Flash) - about NOT using or relying on it - from the reference "I've got Flashblock installed, and the Firefox network tab shows no Flash movie loaded."
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

What is the best way to copy text to the clipboard (multi-browser)?

I have tried:

function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); clipboardHelper.copyString(text); } } 

But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined.

A nice trick without flashingusing Flash: How does Trello access the user's clipboard?

What is the best way to copy text to the clipboard (multi-browser)?

I have tried:

function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); clipboardHelper.copyString(text); } } 

But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined.

A nice trick without flashing: How does Trello access the user's clipboard?

What is the best way to copy text to the clipboard (multi-browser)?

I have tried:

function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); clipboardHelper.copyString(text); } } 

But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined.

A nice trick without using Flash: How does Trello access the user's clipboard?

OK, it does not seem to be about Adobe's product.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
Active reading [<https://en.wikipedia.org/wiki/Adobe_Flash>].
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
Post Reopened by Kaiido javascript
Post Closed as "Duplicate" by Cody Gray
Notice removed Reward existing answer by Grant Winney
Bounty Ended with Greg Lowe's answer chosen by Grant Winney
Notice added Reward existing answer by Grant Winney
Bounty Started worth 50 reputation by Grant Winney
Stack Exchange has an advanced revision history system: 'Edit' or 'Update' is unnecessary.
Source Link
Loading
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot
Loading
Rollback to Revision 9
Source Link
Taryn
  • 248.9k
  • 57
  • 374
  • 409
Loading
added 156 characters in body
Source Link
m87
  • 4.5k
  • 3
  • 18
  • 31
Loading
deleted 25 characters in body; edited title
Source Link
mikemaccana
  • 126.1k
  • 113
  • 442
  • 544
Loading
Improved title: http://meta.stackexchange.com/questions/10647/how-do-i-write-a-good-title
Link
user3094403
  • 6.4k
  • 11
  • 50
  • 56
Loading
edited tags
Link
Naftali
  • 146.5k
  • 41
  • 247
  • 304
Loading
As it deals with internet explorer's syntax error, i think it must be tagged
Link
Loading
added 153 characters in body
Source Link
Santiago Corredoira
  • 47.3k
  • 11
  • 54
  • 58
Loading
Question Protected by Mr. Alien
added 18 characters in body; edited title; added 1 characters in body
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
edited tags
Link
Abhishek B.
  • 5.2k
  • 14
  • 55
  • 94
Loading