Questions tagged [clipboarddata]

Questions dealing with editing and using clipboard data.

Questions dealing with editing and using clipboard data. eg: Storing a string in the Windows clipboard.

165 questions
41
votes
6 answers

Copy current URL to clipboard

Not sure why this has been so difficult for me today, but for some reason I cannot seem to get it to copy the current URL to the clipboard. Overall, I'm looking for a way to do it without needing to create some hidden text elements. This is what I'm…
ultraloveninja
  • 1,969
  • 5
  • 27
  • 56
30
votes
5 answers

event.clipboardData.setData in copy event

I have looked at many posts but could not find a clear current answer to the following two questions as it seems standards and browser support has been constantly changing. Is it a legal operation according to the standard to change the clipboard…
kofifus
  • 17,260
  • 17
  • 99
  • 173
30
votes
2 answers

Paste the Image from System in Html page using javascript

Hi i am creating an web chat application in that i want user can copy paste the image from desktop or can paste directly the screen shot but i am unable to achieve it. I used following code: $("#dummy").on("paste",function(event){ var items =…
pareshm
  • 4,874
  • 5
  • 35
  • 53
23
votes
2 answers

Get text from clipboard using GetText - avoid error on empty clipboard

I'm using code like this to get text from off the Clipboard. Dim DataObj As New MSForms.DataObject DataObj.GetFromClipboard myString = DataObj.GetText I use error handling to get the past the case where the Clipboard is empty, and everything is…
Roy
  • 653
  • 2
  • 11
  • 20
15
votes
1 answer

Read and Write to the clipboard

I have this snippet on Windows (VS2017 Community) on Unity 5.6: public static void setClipboardStr(string str) { try { if (Clipboard.ContainsText()) { // ...doesn't matter if true or false - // from…
dylanh724
  • 948
  • 1
  • 12
  • 29
15
votes
5 answers

how to get clipboard data in angular JS

I was actually looking to get the content of clipboard using angular JS to simulate a copy paste thing.
Tasneem Hyder
  • 170
  • 1
  • 1
  • 7
14
votes
4 answers

Modify Clipboard content after copy event: JavaScript, jQuery

My requirement: When user copy some content from my web page, with text some HTML tags and carriage retun also gets copied. I need to modify the copied content in clipboard i.e. removing carriage retunn and HTML tags. What I have tried so far: I…
Geeky Ninja
  • 6,002
  • 8
  • 41
  • 54
11
votes
2 answers

Get image (using paste) from the browser

There are two ways to copy an image through the browser (for example chrome), the copy image and the copy address of the image. When I copy the image address and paste it using my paste Image button, I can get the image copied from the base64…
John w.
  • 511
  • 1
  • 5
  • 18
10
votes
2 answers

how to get animated gif image from browser clipboard api?

I am testing the following code, and when I copy an animated gif and paste it to web page, I see image/png in the console - instead of image/gif as expected. Why? document.onpaste = function(event) { …
9
votes
2 answers

Pasting from a file browser and HTML5 Clipboard API

I'm trying to add an image paste function to my web application, using the standard routine: $('textarea').on('paste', function (ev) { var clipboardData = ev.originalEvent.clipboardData; $.each(clipboardData.items, function (i, item) { …
NikitaBaksalyar
  • 2,414
  • 1
  • 24
  • 27
8
votes
0 answers

Paste file into web page from Windows explorer

I'm trying to paste a file from Windows Explorer into a web page. When accessing event.clipboardData items, files and types are all empty. If I take a screenshot (Ctrl+PrintScrn) or copy a plain text and then paste into the web page, items and types…
Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
8
votes
3 answers

Can I Get the Source Range Of Excel Clipboard Data?

If the Clipboard contains an Excel Worksheet Range, you can access that Range's Data with the DataObject Object Can you also find the actual Source Range (ie Worksheet, Row & Column) of that Data? Alternatively, can you find the Last Copied Range,…
mikebinz
  • 370
  • 1
  • 4
  • 17
8
votes
1 answer

Clipboard history in Eclipse

Is there a plugin available in Eclipse that shows all recently copied items in clipboard like this one https://github.com/kemayo/sublime-text-2-clipboard-history for sublime editor
GoodSp33d
  • 6,252
  • 4
  • 35
  • 67
7
votes
0 answers

JS : Get clipboard data on Click (not on Paste)

How can I get the clipboard data on click on a button.. not on pasting into textarea. Something like this :
var seeClipBoard = function() { var…
user3134277
  • 347
  • 4
  • 14
6
votes
2 answers

Intercept Paste data in JavaScript

I got the following code from Intercept paste event in Javascript. I need to get it before it is pasted, otherwise i lose the "\n" characters i need to save. It works great to intercept clipboard data for one element with an id. I need it to work on…
wibberding
  • 815
  • 3
  • 10
  • 17
1
2 3
10 11