MCPcopy
hub / github.com/philc/vimium / gotoPositionInTab

Function gotoPositionInTab

background_scripts/marks.js:79–83  ·  view source on GitHub ↗
({ tabId, scrollX, scrollY })

Source from the content-addressed store, hash-verified

77
78// Focus an existing tab and scroll to the given position within it.
79async 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.

Callers 2

gotoFunction · 0.85
focusOrLaunchFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected