Skip to content

Disable colors in Edge and Internet Explorer#489

Merged
TooTallNate merged 1 commit into
debug-js:masterfrom
ibc:disable-colors-in-edge-and-ie
Aug 24, 2017
Merged

Disable colors in Edge and Internet Explorer#489
TooTallNate merged 1 commit into
debug-js:masterfrom
ibc:disable-colors-in-edge-and-ie

Conversation

@ibc

@ibc ibc commented Aug 20, 2017

Copy link
Copy Markdown
Contributor

Fixes #417

Both Internet Explorer and Edge report "AppleWebKit" in their User-Agent, so the current useColors() function in src/browser.js returns true (check my rationale about this here. But in fact, Edge and Internet Explorer do not support colors in the console.

This PR checks whether the browser is Edge/IE and, if so, makes useColors() return false.

NOTE: A good project for detecting browsers is bowser. In includes nice examples of how the User-Agent of many browsers looks like.

@ibc

ibc commented Aug 20, 2017

Copy link
Copy Markdown
Contributor Author

NOTE: I will be able to test my fork tomorrow Monday and will confirm here that it works (I hope).

@coveralls

coveralls commented Aug 20, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+2.6%) to 75.325% when pulling 61852ef on ibc:disable-colors-in-edge-and-ie into 13e1d06 on visionmedia:master.

@ibc ibc changed the title Disable colors in Edge and Internet Explorer (fixes #417) Disable colors in Edge and Internet Explorer (fixes https://github.com/visionmedia/debug/issues/417) Aug 20, 2017
@ibc ibc changed the title Disable colors in Edge and Internet Explorer (fixes https://github.com/visionmedia/debug/issues/417) Disable colors in Edge and Internet Explorer Aug 20, 2017
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+2.6%) to 75.325% when pulling 0e47511 on ibc:disable-colors-in-edge-and-ie into 13e1d06 on visionmedia:master.

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+2.6%) to 75.325% when pulling 0e47511 on ibc:disable-colors-in-edge-and-ie into 13e1d06 on visionmedia:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+2.6%) to 75.325% when pulling 0e47511 on ibc:disable-colors-in-edge-and-ie into 13e1d06 on visionmedia:master.

@ibc

ibc commented Aug 21, 2017

Copy link
Copy Markdown
Contributor Author

Hi, I'm just using my fork in Edge. It works. Obviously, the Edge support for %o in console.log("foo:%o", foo) is not very cool (it prints two lines, etc). But at least, with my PR logger() behaves similar to console.log() in Edge.

And we get rid of the ugly %ccheckEmail%c +0ms color: lightseagreen color stuff.

I hope you merge it.

@ibc

ibc commented Aug 24, 2017

Copy link
Copy Markdown
Contributor Author

Please authors, any feedback/comment about this PR?

debug module does not properly work in IE/Edge. This PR fixes that. Please, don't leave this PR open forever.

@TooTallNate TooTallNate merged commit b3ea123 into debug-js:master Aug 24, 2017
@TooTallNate

Copy link
Copy Markdown
Contributor

Merged, thank you!

@ibc

ibc commented Aug 24, 2017

Copy link
Copy Markdown
Contributor Author

THANKS!!! Finally I can remove my debug fork from the package.json of many projects :)

@ibc

ibc commented Aug 24, 2017

Copy link
Copy Markdown
Contributor Author

Well, not so fast, I should wait for a new release in NPM :)

@TooTallNate

TooTallNate commented Aug 24, 2017 via email

Copy link
Copy Markdown
Contributor

@freewil

freewil commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

Awesome, thanks! 👍

@ibc

ibc commented Aug 24, 2017

Copy link
Copy Markdown
Contributor Author

top top top!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants