Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
109
rated 0 times [  114] [ 5]  / answers: 1 / hits: 13992  / 3 Years ago, fri, may 7, 2021, 12:00:00

I have this code for paste:




navigator.clipboard.readText().then(
clipText => document.querySelector(#Note).innerText += clipText);




But It has this error:



Uncaught TypeError: navigator.clipboard.readText is not a function



help me to solve this bug


More From » php

 Answers
3

I'm guessing you are testing it in Firefox, in that case:



Firefox only supports reading the clipboard in browser extensions, using the "clipboardRead" extension permission.



https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#browser_compatibility


[#1386] Wednesday, April 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tayaw

Total Points: 749
Total Questions: 88
Total Answers: 86

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
tayaw questions
;