Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console color updates for Chrome, Firefox, and Internet Explorer too. #534

Merged
merged 2 commits into from Oct 27, 2015

Conversation

pmw57
Copy link
Contributor

@pmw57 pmw57 commented Oct 27, 2015

Using blanket via web browsers currently results in the ANSI color codes not being supported by their consoles.

This is a fix for both Chrome and Firefox, along with optionally Internet Explorer too.

Details on the Chrome and Firefox console colors are found at http://developer.chrome.com/devtools/docs/console-api#consolelogobject-object and https://getfirebug.com/wiki/index.php/Console.log

Whereas with Internet Explorer we can use console.info and console.error to obtain a suitable display on its console.

Chrome and Firefox provide console colors via CSS style formatting.

Chrome started mimicking Firebug's %c option around 3 years ago:
http://trac.webkit.org/changeset/130941

Details on how to use console colors are found at
http://developer.chrome.com/devtools/docs/console-api#consolelogobject-object
and https://getfirebug.com/wiki/index.php/Console.log
As setting the colors on IE's console is not an option, we can use
console.info for good messages, and console.error for errors.

As Internet Explorer only returns info about its console when the dev
tools are active, it can be helpful to have the console open before
loading the page. Either that, or you can reload the page after opening
the console.
alex-seville added a commit that referenced this pull request Oct 27, 2015
Console color updates for Chrome, Firefox, and Internet Explorer too.
@alex-seville alex-seville merged commit e9360d0 into alex-seville:master Oct 27, 2015
@alex-seville
Copy link
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants