Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: debug-js/debug
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.3.5
Choose a base ref
...
head repository: debug-js/debug
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.3.6
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 27, 2024

  1. Avoid using deprecated RegExp.$1

    bluwy authored and Qix- committed Jul 27, 2024
    Copy the full SHA
    7956a45 View commit details
  2. 4.3.6

    Qix- committed Jul 27, 2024
    Copy the full SHA
    c33b464 View commit details
Showing with 4 additions and 2 deletions.
  1. +1 −1 package.json
  2. +3 −1 src/browser.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "debug",
"version": "4.3.5",
"version": "4.3.6",
"repository": {
"type": "git",
"url": "git://github.com/debug-js/debug.git"
4 changes: 3 additions & 1 deletion src/browser.js
Original file line number Diff line number Diff line change
@@ -125,14 +125,16 @@ function useColors() {
return false;
}

let m;

// Is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// Is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
// Double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}