You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-devtools-extensions/src/checkForDuplicateInstallations.js
+83-71Lines changed: 83 additions & 71 deletions
Original file line number
Diff line number
Diff line change
@@ -14,98 +14,75 @@ import {
14
14
EXTENSION_INSTALL_CHECK_MESSAGE,
15
15
EXTENSION_INSTALLATION_TYPE,
16
16
INTERNAL_EXTENSION_ID,
17
-
EXTENSION_NAME,
17
+
LOCAL_EXTENSION_ID,
18
18
}from'./constants';
19
19
20
+
constUNRECOGNIZED_EXTENSION_WARNING=
21
+
'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. '+
22
+
'Please make sure you only have a single version of the extension installed or enabled. '+
23
+
'If you are developing this extension locally, make sure to build the extension using the `yarn build:<browser>:local` command.';
// TODO: Show warning in UI of extension that remains enabled
83
-
consterrorMessage=
84
-
'React Developer Tools: You are running multiple installations of the React Developer Tools extension, which will conflict with this development build of the extension. '+
85
-
'In order to prevent conflicts, this development build of the extension will be disabled. In order to continue local development, please disable or uninstall '+
86
-
'any other installations of the extension in your browser.';
87
-
chrome.devtools.inspectedWindow.eval(
88
-
`console.error("${errorMessage}")`,
89
-
);
90
-
console.error(errorMessage);
91
-
callback(true);
92
-
}else{
93
-
callback(false);
94
-
}
95
-
});
59
+
// If this is the local extension (i.e. built locally during development),
60
+
// always keep this one enabled. Other installations disable themselves if
61
+
// they detect the local build is installed.
62
+
callback(false);
96
63
break;
97
64
}
98
65
99
66
// If this extension wasn't built locally during development, we can't reliably
100
67
// detect if there are other installations of DevTools present.
101
68
// In this case, assume there are no duplicate exensions and show a warning about
102
69
// potential conflicts.
103
-
constwarnMessage=
104
-
'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. '+
105
-
'Please make sure you only have a single version of the extension installed or enabled. '+
106
-
'If you are developing this extension locally, make sure to build the extension using the `yarn build:<browser>:local` command.';
0 commit comments