devtools console: copy is not a function while on youtube
问题 I know that I can use copy() function on the console to add content to the clipboard. When I am on any other page copy('test') works. When I am on youtube I get: Uncaught TypeError: copy is not a function How can I fix this. E.g. Is there a way to prevent a site from overriding specific functions using devtools? Strangely on firefox copy() works on youtube, so could this be a chrome bug? 回答1: Run this in console: document.querySelector('#copy').remove(); Then use copy() as normal, e.g. copy