Skip to content

Commit 500a03f

Browse files
vidortegDevtools-frontend LUCI CQ
authored andcommitted
Open Rehydrated Devtools session in tab or window
This CL changes the current behavior for when opening an Enhanced Trace in the Performance Panel. Before: A new window will always open when the user opens a saved Enhanced Trace After: If the Devtools are in docked mode, new session will spawn on a new tab. If the Devtools are in undocked mode, new session will spawn on a new window. Bug: 432043264 Change-Id: I4bc33ab482cde0a5a1f6e544b4bfd3be46fb0ee5 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6897346 Reviewed-by: Connor Clark <[email protected]> Commit-Queue: Vidal Diazleal <[email protected]>
1 parent 426a0a6 commit 500a03f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,12 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
16771677
hostWindow.removeEventListener('message', onMessageHandler);
16781678
}
16791679
hostWindow.addEventListener('message', onMessageHandler);
1680-
rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');
1680+
1681+
if (this.isDocked()) {
1682+
rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ '_blank', 'noopener=false,popup=false');
1683+
} else {
1684+
rehydratingWindow = hostWindow.open(pathToLaunch, /* target: */ undefined, 'noopener=false,popup=true');
1685+
}
16811686
}
16821687

16831688
async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise<void> {
@@ -1688,6 +1693,10 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
16881693
this.loader = await TimelineLoader.loadFromURL(url, this);
16891694
}
16901695

1696+
private isDocked(): boolean {
1697+
return UI.DockController.DockController.instance().dockSide() !== UI.DockController.DockState.UNDOCKED;
1698+
}
1699+
16911700
private updateMiniMap(): void {
16921701
if (this.#viewMode.mode !== 'VIEWING_TRACE') {
16931702
this.#minimapComponent.setData(null);

0 commit comments

Comments
 (0)