Solve the problem that Chrome 120 developer tools cannot paste code

New features in developer tools (Chrome 120)
https://developer.chrome.com/blog/new-in-devtools-120?hl=zh-cn

[Status]:
Added Self-XSS protection warning.
Unable to paste code in developer tools (DevTools) console smoothly.

Normally, the prompt window should pop up
, but currently Windows encounters a situation where it does not pop up. It is
completely impossible to click Allow to allow pasting of code.

Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yourself. This could allow attackers to steal your identity or take control of your computer. Please type ‘allow pasting’ below to allow pasting.

Insert image description here

[Solution 1]:
Directly enter allow pasting in the Console and press Enter to enable (right-click) copy and paste functions.
Insert image description here

[Solution 2]:
Click the gear on the upper right of DevTools (Settings)
Settings -> Experiments -> Filter Enter Past
-> Uncheck Show warning about Self-XSS when pasting
-> [X] Close
-> Reload DevTools (or close all Chrome pages and restart Chrome)

You can paste the code in the DevTools Console normally (Ctrl + V)
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_44816664/article/details/135213622