@samitouri / QOS-React-2 / commits / 6ddf8de5ae

Look for devtools global hook

It doesn't exist yet, but it could. This also ensures we actually do our polyfill checks in *all* browsers, not just Chrome.

Paul O’Shannessy committed Oct 9, 2014 at 11:24 UTC 6ddf8de5aee5ea58a4f1b806c6c768d53cf5e2b4
1 file changed +11 -7
src/browser/ui/React.js
+11 -7
@@ -107,13 +107,17 @@ var React = {
107
108 if (__DEV__) {
109 var ExecutionEnvironment = require('ExecutionEnvironment');
110 - if (ExecutionEnvironment.canUseDOM &&
111 - window.top === window.self &&
112 - navigator.userAgent.indexOf('Chrome') > -1) {
113 - console.debug(
114 - 'If you haven\'t already, download the React DevTools for a better ' +
115 - 'development experience: http://fb.me/react-devtools'
116 - );
110 + if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
111 +
112 + // If we're in Chrome, look for the devtools marker and provide a download
113 + // link if not installed.
114 + if (navigator.userAgent.indexOf('Chrome') > -1 &&
115 + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
116 + console.debug(
117 + 'If you haven\'t already, download the React DevTools for a better ' +
118 + 'development experience: http://fb.me/react-devtools'
119 + );
120 + }
121
122 var expectedFeatures = [
123 // shims