Change devtools install message on file: URLs

This commit is contained in:
Tay Yang Shun
2015-12-11 00:48:53 +08:00
parent 856eb72b4f
commit 3deca65a89
+6 -1
View File
@@ -78,8 +78,13 @@ if (__DEV__) {
if ((navigator.userAgent.indexOf('Chrome') > -1 &&
navigator.userAgent.indexOf('Edge') === -1) ||
navigator.userAgent.indexOf('Firefox') > -1) {
// Firefox does not have the issue with devtools loaded over file://
var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 &&
navigator.userAgent.indexOf('Firefox') === -1;
console.debug(
'Download the React DevTools for a better development experience: ' +
'Download the React DevTools ' +
(showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') +
'for a better development experience: ' +
'https://fb.me/react-devtools'
);
}