Safari and chrome javascript console multiline

Firebug has a multi-line feature in its console tool. Is there a way to get this functionality using the debugger tool in Safari / Chrome?

+62
javascript debugging browser
Mar 17 '10 at 19:33
source share
10 answers

Shift-Enter on Windows enables multi-line writing where Option-Enter works on a Mac.

A more fully-functional editor is working.

+133
Jan 26 2018-11-11T00:
source share

I recommend this:

  • Write debugger; and press Enter on the console tab
  • This will lead you to the Sources tab; if not, make sure the debugger breakpoints are active.
  • Now you can write whatever you want on the Sources tab, which acts like a full IDE with features like new line and indent
  • Select any part of your code to run and right-click, select Evaluate in console
+16
Feb 27 '13 at 5:19
source share

http://code.google.com/p/chromium/issues/detail?id=35487

Not yet.

UPDATE : The status of the problem I'm connected to is now "fixed."

+12
Mar 17 '10 at 19:38
source share

Try pressing the option (shift in Windows) at the same time as returning. Inserts a new line on a Mac.

+10
Jul 23 '10 at 20:12
source share

For Google Chrome you can use Sources >> Snippets >> + New Snippet in the Developer Console .

enter image description here

After you have written your multi-line code , you can execute it using button enter image description here or using Ctrl + Enter as indicated by button .

This is similar to a text editor that has many keyboard shortcuts that you can find in Settings >> Shortcuts in the " Text Editor

enter image description here

Good luck.

+9
Mar 25 '17 at 5:49
source share

Shift + Enter works in the Chrome browser. I am using ubuntu 12.04 as my operating system. Thanks to Mr. Bester and Sam Dutton for their contributions.

+5
Jan 23 '13 at 11:46
source share

It's just ... put a semicolon between your multi-lines and it will work in the console.

for example

if you have html like this

 <div id="test">This is a test statement</div> 

You can paste the following into the console and it will work

 var ourTest = document.getElementById('test'); alert(ourTest.innerHTML); 

I hope this helps.

+2
Dec 23 '10 at 8:24
source share

There is a cool chrome extension https://chrome.google.com/webstore/detail/bigconsole/klommbdmeefgobphaflhmnieheipjajm

It just adds another tab called BigConsole and allows you to execute multi-line code

0
Aug 04 '17 at 5:52 on
source share

You can use the Chrome extension called "BigConsole", I find it very convenient.

0
Jul 10 '19 at 19:10
source share

Try using notepad (or something else) and then copy / paste to the console, works for me !!!!

-one
Oct 21 2018-10-10T00:
source share



All Articles