mirror of
https://github.com/facebook/react.git
synced 2026-02-23 20:23:02 +00:00
[DevTools] Feature detect sources panel (#33987)
I broke Firefox DevTools extension in #33968. It turns out the Firefox has a placeholder object for the sources panel which is empty. We need to detect the actual event handler.
This commit is contained in:
committed by
GitHub
parent
4f34cc4a2e
commit
3082604bdc
@@ -111,7 +111,7 @@ function createBridge() {
|
||||
chrome.devtools.panels.elements.onSelectionChanged.removeListener(
|
||||
onBrowserElementSelectionChanged,
|
||||
);
|
||||
if (sourcesPanel) {
|
||||
if (sourcesPanel && sourcesPanel.onSelectionChanged) {
|
||||
currentSelectedSource = null;
|
||||
sourcesPanel.onSelectionChanged.removeListener(
|
||||
onBrowserSourceSelectionChanged,
|
||||
@@ -124,7 +124,7 @@ function createBridge() {
|
||||
chrome.devtools.panels.elements.onSelectionChanged.addListener(
|
||||
onBrowserElementSelectionChanged,
|
||||
);
|
||||
if (sourcesPanel) {
|
||||
if (sourcesPanel && sourcesPanel.onSelectionChanged) {
|
||||
sourcesPanel.onSelectionChanged.addListener(
|
||||
onBrowserSourceSelectionChanged,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user