mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: remove DevTools legacy UI patching (#40331)
This commit is contained in:
@@ -573,10 +573,11 @@ describe('chrome extensions', () => {
|
||||
|
||||
const showLastPanel = () => {
|
||||
// this is executed in the devtools context, where UI is a global
|
||||
const { UI } = (window as any);
|
||||
const tabs = UI.InspectorView.instance().tabbedPane.tabs;
|
||||
const { EUI } = (window as any);
|
||||
const instance = EUI.InspectorView.InspectorView.instance();
|
||||
const tabs = instance.tabbedPane.tabs;
|
||||
const lastPanelId = tabs[tabs.length - 1].id;
|
||||
UI.InspectorView.instance().showPanel(lastPanelId);
|
||||
instance.showPanel(lastPanelId);
|
||||
};
|
||||
devToolsWebContents.executeJavaScript(`(${showLastPanel})()`, false).then(() => {
|
||||
showPanelTimeoutId = setTimeout(show, 100);
|
||||
|
||||
@@ -297,10 +297,11 @@ describe('<webview> tag', function () {
|
||||
const showPanelIntervalId = setInterval(function () {
|
||||
if (!webContents.isDestroyed() && webContents.devToolsWebContents) {
|
||||
webContents.devToolsWebContents.executeJavaScript('(' + function () {
|
||||
const { UI } = (window as any);
|
||||
const tabs = UI.InspectorView.instance().tabbedPane.tabs;
|
||||
const { EUI } = (window as any);
|
||||
const instance = EUI.InspectorView.InspectorView.instance();
|
||||
const tabs = instance.tabbedPane.tabs;
|
||||
const lastPanelId: any = tabs[tabs.length - 1].id;
|
||||
UI.InspectorView.instance().showPanel(lastPanelId);
|
||||
instance.showPanel(lastPanelId);
|
||||
}.toString() + ')()');
|
||||
} else {
|
||||
clearInterval(showPanelIntervalId);
|
||||
|
||||
Reference in New Issue
Block a user