Meet Styled Logging, the Console text-styling feature born from the Firebug plugin 14 years ago
The giant 'STOP' message in the TH AI Passport website's Developer Console left many people puzzled — it's actually Styled Logging, a feature that dates back to the Firebug plugin in 2012
Recently, many Thai internet users may have been startled when they opened the Developer Console (a developer tool hidden inside the browser) while visiting the government's TH AI Passport website and saw a large, prominent 'STOP' message. Many only just learned that the console can display beautifully formatted text like this, but in reality, this feature has been available to developers for over a decade.
The feature is called Styled Logging — formatting text in the Console using CSS (the language that defines web page styles) via the console.log command, using the %c specifier before the text followed by CSS values such as text color, font size, or background color. For example, console.log("%cmessage", "color: red; font-size: 20px;") will instantly display large red text in the console.
Going back to 2006, browsers didn't have built-in Developer Consoles like they do today. Joe Hewitt, a former Netscape software engineer and co-founder of the Firefox project, created Firebug as an add-on plugin that let developers debug (find and fix errors) websites directly from the browser. Later, in 2012, Firebug version 1.11 added Styled Logging via %c, supporting multiple CSS styles within a single log — the starting point that made this feature widely known.
Major browsers then gradually incorporated it into their own tools. Firefox included Styled Console Logs as a built-in feature starting with version 31 in 2014, while Chrome, Edge, and Safari also support it. Today, %c has been standardized in the WHATWG Console Specification.
In the case of the TH AI Passport website, displaying a large warning message in the console is a technique websites commonly use to warn general users against pasting unfamiliar code into the console, as they could be tricked into running harmful commands. So if you see a message like this, there's no need to panic — just don't copy code from anywhere and paste it at a stranger's suggestion, and you'll be safe.
Many Thais encountered this technique for the first time through a government website. Understanding Styled Logging helps people realize that console warning messages are a safeguard against scammers tricking users into pasting malicious code — not a sign that something is wrong with the website.