Skip to content

Commit 361542c

Browse files
author
Juan Tejada
committed
Only show DevTools warning about unrecognized build in Chrome
1 parent e5f486b commit 361542c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/react-devtools-extensions/src/checkForDuplicateInstallations.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import {
1717
LOCAL_EXTENSION_ID,
1818
} from './constants';
1919

20+
const IS_CHROME = getBrowserName() === 'Chrome';
21+
2022
const UNRECOGNIZED_EXTENSION_ERROR =
2123
'React Developer Tools: You are running an unrecognized installation of the React Developer Tools extension, which might conflict with other versions of the extension installed in your browser. ' +
2224
'Please make sure you only have a single version of the extension installed or enabled. ' +
@@ -76,14 +78,17 @@ export function checkForDuplicateInstallations(callback: boolean => void) {
7678
break;
7779
}
7880
case 'unknown': {
79-
// If we don't know how this extension was built, we can't reliably detect if there
80-
// are other installations of DevTools present.
81-
// In this case, assume there are no duplicate exensions and show a warning about
82-
// potential conflicts.
83-
console.error(UNRECOGNIZED_EXTENSION_ERROR);
84-
chrome.devtools.inspectedWindow.eval(
85-
`console.error("${UNRECOGNIZED_EXTENSION_ERROR}")`,
86-
);
81+
// TODO: Support duplicate extension detection in other browsers
82+
if (IS_CHROME) {
83+
// If we don't know how this extension was built, we can't reliably detect if there
84+
// are other installations of DevTools present.
85+
// In this case, assume there are no duplicate exensions and show a warning about
86+
// potential conflicts.
87+
console.error(UNRECOGNIZED_EXTENSION_ERROR);
88+
chrome.devtools.inspectedWindow.eval(
89+
`console.error("${UNRECOGNIZED_EXTENSION_ERROR}")`,
90+
);
91+
}
8792
callback(false);
8893
break;
8994
}

0 commit comments

Comments
 (0)