(readHandler, writeHandler)
| 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]; |
no test coverage detected