MCPcopy Index your code
hub / github.com/massCodeIO/massCode / getActiveTabCapture

Function getActiveTabCapture

integrations/clipper/src/popup.ts:168–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166}
167
168async function getActiveTabCapture(): Promise<PageCapturePayload> {
169 const [tab] = await chrome.tabs.query({ active: true, currentWindow: true })
170
171 if (!tab.id) {
172 throw new Error('No active tab found.')
173 }
174
175 const [response] = await chrome.scripting.executeScript<PageCapturePayload>({
176 func: getPageCaptureFromPage,
177 target: { tabId: tab.id },
178 })
179
180 if (!response.result) {
181 throw new Error('Could not read the active page.')
182 }
183
184 return {
185 ...response.result,
186 faviconUrl: tab.favIconUrl,
187 }
188}
189
190function readSettingsFromForm(): ExtensionSettings {
191 return {

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected