MCPcopy Create free account
hub / github.com/msgbyte/tailchat / openInNewWindow

Function openInNewWindow

client/web/src/utils/window-helper.ts:30–57  ·  view source on GitHub ↗
(
  url: string,
  options: OpenInNewWindowOptions = {}
)

Source from the content-addressed store, hash-verified

28 * @param url 新窗口地址
29 */
30export function openInNewWindow(
31 url: string,
32 options: OpenInNewWindowOptions = {}
33) {
34 const width = options.width ?? 414;
35 const height = options.height ?? 736;
36 const top = options.top ?? (window.screen.height - height) / 2;
37 const left = options.left ?? (window.screen.width - width) / 2;
38
39 // 打开窗口
40 const win = window.open(
41 url,
42 `tailwindow#${windowIndex++}`,
43 buildWindowFeatures({
44 top,
45 left,
46 width,
47 height,
48 menubar: false,
49 toolbar: false,
50 location: false,
51 status: false,
52 resizable: true,
53 })
54 );
55
56 return win;
57}
58
59class PanelWindowManager {
60 private openedPanelWindows: Record<string, Window> = {};

Callers 1

openMethod · 0.85

Calls 2

openMethod · 0.80
buildWindowFeaturesFunction · 0.70

Tested by

no test coverage detected