@@ -27,9 +27,9 @@ exports.colors = [
2727] ;
2828
2929/**
30- * Currently only WebKit-based Web Inspectors and the Firebug
31- * extension (*not* the built-in Firefox web inpector ) are
32- * known to support "%c" CSS customizations.
30+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
31+ * and the Firebug extension (any Firefox version ) are known
32+ * to support "%c" CSS customizations.
3333 *
3434 * TODO: add a `localStorage` variable to explicitly enable/disable colors
3535 */
@@ -38,7 +38,10 @@ function useColors() {
3838 // is webkit? http://stackoverflow.com/a/16459606/376773
3939 return ( 'WebkitAppearance' in document . documentElement . style ) ||
4040 // is firebug? http://stackoverflow.com/a/398120/376773
41- ( window . console && ( console . firebug || ( console . exception && console . table ) ) ) ;
41+ ( window . console && ( console . firebug || ( console . exception && console . table ) ) ) ||
42+ // is firefox >= v31?
43+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
44+ ( navigator . userAgent . toLowerCase ( ) . match ( / f i r e f o x \/ ( \d + ) / ) && parseInt ( RegExp . $1 , 10 ) >= 31 ) ;
4245}
4346
4447/**
@@ -70,7 +73,7 @@ function formatArgs() {
7073 if ( ! useColors ) return args ;
7174
7275 var c = 'color: ' + this . color ;
73- args = [ args [ 0 ] , c , '' ] . concat ( Array . prototype . slice . call ( args , 1 ) ) ;
76+ args = [ args [ 0 ] , c , 'color: inherit ' ] . concat ( Array . prototype . slice . call ( args , 1 ) ) ;
7477
7578 // the final "%c" is somewhat tricky, because there could be other
7679 // arguments passed either before or after the %c, so we need to
0 commit comments