devtools console: copy is not a function while on youtube

左心房为你撑大大i 提交于 2021-02-20 10:21:04

问题


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(myVariable)



来源:https://stackoverflow.com/questions/62212958/devtools-console-copy-is-not-a-function-while-on-youtube

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!