* Lookup tab with given url
(lookupUrl, app)
| 53 | * Lookup tab with given url |
| 54 | */ |
| 55 | function 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 | } |