({ tabId, scrollX, scrollY })
| 77 | |
| 78 | // Focus an existing tab and scroll to the given position within it. |
| 79 | async function gotoPositionInTab({ tabId, scrollX, scrollY }) { |
| 80 | const tab = await chrome.tabs.update(tabId, { active: true }); |
| 81 | chrome.windows.update(tab.windowId, { focused: true }); |
| 82 | chrome.tabs.sendMessage(tabId, { handler: "setScrollPosition", scrollX, scrollY }); |
| 83 | } |
| 84 | |
| 85 | // The tab we're trying to find no longer exists. We either find another tab with a matching URL and |
| 86 | // use it, or we create a new tab. |
no test coverage detected