mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't suggest downloading React DevTools inside Chrome extension (#10359)
This commit is contained in:
@@ -825,17 +825,20 @@ if (__DEV__) {
|
||||
navigator.userAgent.indexOf('Edge') === -1) ||
|
||||
navigator.userAgent.indexOf('Firefox') > -1
|
||||
) {
|
||||
var showFileUrlMessage = window.location.protocol.indexOf('http') === -1;
|
||||
console.info(
|
||||
'%cDownload the React DevTools ' +
|
||||
'for a better development experience: ' +
|
||||
'https://fb.me/react-devtools' +
|
||||
(showFileUrlMessage
|
||||
? '\nYou might need to use a local HTTP server (instead of file://): ' +
|
||||
'https://fb.me/react-devtools-faq'
|
||||
: ''),
|
||||
'font-weight:bold',
|
||||
);
|
||||
const protocol = window.location.protocol;
|
||||
// Don't warn in exotic cases like chrome-extension://.
|
||||
if (/^(https?|file):$/.test(protocol)) {
|
||||
console.info(
|
||||
'%cDownload the React DevTools ' +
|
||||
'for a better development experience: ' +
|
||||
'https://fb.me/react-devtools' +
|
||||
(protocol === 'file:'
|
||||
? '\nYou might need to use a local HTTP server (instead of file://): ' +
|
||||
'https://fb.me/react-devtools-faq'
|
||||
: ''),
|
||||
'font-weight:bold',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user