mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Change devtools install message on file: URLs
This commit is contained in:
@@ -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'
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user