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

Disable colors in Edge and Internet Explorer #489

Merged
merged 1 commit into from
Aug 24, 2017
Merged

Disable colors in Edge and Internet Explorer #489

merged 1 commit into from
Aug 24, 2017

Conversation

ibc
Copy link
Contributor

@ibc ibc commented Aug 20, 2017

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
Copy link
Contributor Author

ibc commented Aug 20, 2017

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

@coveralls
Copy link

coveralls commented Aug 20, 2017

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

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

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

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
Copy link
Contributor Author

ibc commented Aug 21, 2017

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
Copy link
Contributor Author

ibc commented Aug 24, 2017

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
Contributor

Merged, thank you!

@ibc
Copy link
Contributor Author

ibc commented Aug 24, 2017

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

@ibc
Copy link
Contributor Author

ibc commented Aug 24, 2017

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

@TooTallNate
Copy link
Contributor

TooTallNate commented Aug 24, 2017 via email

@freewil
Copy link
Contributor

freewil commented Aug 24, 2017

Awesome, thanks! 👍

@ibc
Copy link
Contributor Author

ibc commented Aug 24, 2017

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