0

I want to put javascript code into android's browsers apps from clipboard. It works fine, but chrome always deletes word "javascript:" from pasted data. For example: instead of javascript:(function(){ it paste only (function(){. How can I paste JS without auto-deleting?

Anton Kashpor
  • 1,075
  • 2
  • 13
  • 32

1 Answers1

0

Possible reason for your problem. Google doesn't support access to clipboard using Chrome anymore.

You can try this trick though:

function copyToClipboard(text) {
  window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
}

Source

Community
  • 1
  • 1
Ojonugwa Jude Ochalifu
  • 23,935
  • 25
  • 104
  • 122