mirror of
https://github.com/debug-js/debug.git
synced 2026-01-25 16:42:28 +00:00
browser: add Firebug color support
This commit is contained in:
parent
79b75ad626
commit
8bed009c84
14
browser.js
14
browser.js
@ -30,11 +30,19 @@ var colors = [
|
||||
var prevColor = 0;
|
||||
|
||||
/**
|
||||
* Currently only WebKit-based Web Inspectors are known
|
||||
* to support "%c" CSS customizations.
|
||||
* Currently only WebKit-based Web Inspectors and the Firebug
|
||||
* extension (*not* the built-in Firefox web inpector) are
|
||||
* known to support "%c" CSS customizations.
|
||||
*
|
||||
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
||||
*/
|
||||
|
||||
var useColors = 'WebkitAppearance' in document.documentElement.style;
|
||||
var useColors =
|
||||
// is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
('WebkitAppearance' in document.documentElement.style) ||
|
||||
// is firebug? http://stackoverflow.com/a/398120/376773
|
||||
(window.console && (console.firebug || (console.exception && console.table)));
|
||||
|
||||
|
||||
/**
|
||||
* Select a color.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user