Is there a way to hit enter in chrome developer tools without it running the code? it would be so much more convenient to hit enter to go to next line instead of running the code

as title says.

I hoped in the developer tools on internet explorer at work and it would only run when you hit the play button and hitting enter took you to the next line. this is how it should be. but on chrome and firefox enter will run the code instead of going to the next line. its very annoying to forget to hit shift enter and run the code and then have a long as history list have code because of my forgetfulness

is there any way around this? I want to use chrome so i can have YDKJS right next to the console.

1 Like

i know about shift enter, but i keep forgetting to do it and it runs the code. on internet explorer there is a button to run the code rather than having to hit shift enter. that way enter skips to the next line. just wondering if this is possible with chrome as well

1 Like

I use node.js with some sync with browser (either gulp or webpack) and keep the browser window 1/2 of the screen with console open. And code in VS Code (aerlier it was Sublime Text 3).
I press Ctrl+S in editor and browser window refreshes. Useful.

1 Like

Hi @Tyrantt47

The chrome team released an update recently that has what they call smart return; when you open up a block and hit enter, it goes to the next line rather than running the code.

According to this post it’s on canary, however, I have it on my version of chrome which is running 55.0.2883.87 m.

If you have the same version, try writing out a block, but don’t close it then hit return, the behavior should be what you expect. When the block is closed, return will work as before.

function test() {
   // Code

Alternatively, you could just use snippets; Dev tools > Sources > Snippets. It’s like a sandbox where you can write small pieces of code and run them in the browser, it also allows you to use breakpoints for debugging.