Skip to content

Commit 3deca65

Browse files
committed
Change devtools install message on file: URLs
1 parent 856eb72 commit 3deca65

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/renderers/dom/ReactDOM.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@ if (__DEV__) {
7878
if ((navigator.userAgent.indexOf('Chrome') > -1 &&
7979
navigator.userAgent.indexOf('Edge') === -1) ||
8080
navigator.userAgent.indexOf('Firefox') > -1) {
81+
// Firefox does not have the issue with devtools loaded over file://
82+
var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 &&
83+
navigator.userAgent.indexOf('Firefox') === -1;
8184
console.debug(
82-
'Download the React DevTools for a better development experience: ' +
85+
'Download the React DevTools ' +
86+
(showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') +
87+
'for a better development experience: ' +
8388
'https://fb.me/react-devtools'
8489
);
8590
}

0 commit comments

Comments
 (0)