Z
Z
Ziggy Pop2011-06-14 12:00:54
JavaScript
Ziggy Pop, 2011-06-14 12:00:54

Is it possible to change the clipboard in the browser using JavaScript?

It is required by means of JavaScript to replace the contents of the clipboard when copying from the site. Are there working solutions? So far I have only found an option with adding some thread of text to the existing one. And you need to additionally carry out some manipulations with the text.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
pietrovich, 2011-06-14
@pietrovich

JavaScript only won't work, browsers don't allow you to manipulate your godfather's clipboard. you will either have to increase the powers for individual resources, or smoke bamboo. It is possible to try through a flash drive on the same page, controlled by javascript. Previously, access to the clipboard from the flash was free, I don’t know how things are now, maybe they have already closed the shop ...

H
hf35, 2011-06-14
@hf35

No need to torture the clipboard. Access to it is severely restricted
. Write a script that randomly fills the text with invisible nonsense.

I
Iskander Giniyatullin, 2011-06-14
@rednaxi

and how then some scripts add to the text for example

just when selected, an invisible block is added to the end
jemand.ru/dobavlenie-ssylki-na-istochnik-pri-kopirovanii-teksta/
It seems that somewhere on Habré this or a similar script was laid out

O
OlegTar, 2011-08-08
@OlegTar

document.body.oncopy = function (e) {
    var e = e || window.event;
    e.returnValue = false;
    if (e.preventDefault) {
  e.preventDefault();
    }
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question