Click to Copy button error

Hi, I’m trying to implement a copy button in this project from a course I’m doing using the Clipboard API and it’s giving me an error “Uncaught (in promise) TypeError: navigator.clipboard.readText is not a function.” It says it only supports reading the clipboard in browser extensions, using the “clipboardRead” extension permission. I was wondering how to access that extension permission in Firefox? Even on CodePen I get a Not found error with a blank white page on the screen. I know that the document.execCommand() method is deprecated so that did not work at all for me before. I am using a Acer Chromebook with Linux Debian. This is the CodePen link to my code

Why are you trying to read from the clipboard if you’re just trying to implement a copy to clipboard button?

My mistake I figured out how to get it to work. I just edited my code pen to include the updated code. Thank you for your prompt and helpful response!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.