MCPcopy
hub / github.com/vitejs/vite / lookupTabWithUrl

Function lookupTabWithUrl

packages/vite/bin/openChrome.js:55–68  ·  view source on GitHub ↗

* Lookup tab with given url

(lookupUrl, app)

Source from the content-addressed store, hash-verified

53 * Lookup tab with given url
54 */
55function lookupTabWithUrl(lookupUrl, app) {
56 const windows = app.windows()
57 for (const window of windows) {
58 for (const [tabIndex, tab] of window.tabs().entries()) {
59 if (tab.url().includes(lookupUrl)) {
60 return {
61 targetTab: tab,
62 targetTabIndex: tabIndex + 1,
63 targetWindow: window,
64 }
65 }
66 }
67 }
68}

Callers 1

runFunction · 0.85

Calls 1

urlMethod · 0.80

Tested by

no test coverage detected