Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  31] [ 3]  / answers: 1 / hits: 67585  / 10 Years ago, mon, march 3, 2014, 12:00:00

I 'waddled' by the Console in Chrome on Facebook today.

Surprisingly I got this message in the console.



Now my question is:
How is this possible?

I know that there are a few 'exploit' methods for the console, but how can you make such font formatting in the console? (and is it console.log?)


More From » html

 Answers
62

Yes, you can format the console.log() with something like this:



console.log(%cExtra Large Yellow Text with Red Background, background: red; color: yellow; font-size: x-large);


Note the %c preceding the text in the first argument and the style specifications in the second argument. The text will look like your example.



See Google's Styling Console Output with CSS or FireBug's Console Documentation for more details.



The documentation links also include some other neat tricks like including object links in a console log as well.


[#72186] Sunday, March 2, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
darrylm

Total Points: 499
Total Questions: 131
Total Answers: 108

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;