MCPcopy
hub / github.com/osnr/TabFS / routeForTab

Function routeForTab

extension/background.js:317–323  ·  view source on GitHub ↗
(readHandler, writeHandler)

Source from the content-addressed store, hash-verified

315
316(function() {
317 const routeForTab = (readHandler, writeHandler) => makeRouteWithContents(async ({tabId}) => {
318 const tab = await browser.tabs.get(tabId);
319 return readHandler(tab);
320
321 }, writeHandler ? async ({tabId}, buf) => {
322 await browser.tabs.update(tabId, writeHandler(buf));
323 } : undefined);
324
325 const routeFromScript = code => makeRouteWithContents(async ({tabId}) => {
326 return (await browser.tabs.executeScript(tabId, {code}))[0];

Callers 1

background.jsFile · 0.85

Calls 1

makeRouteWithContentsFunction · 0.85

Tested by

no test coverage detected