tabctl 0.6.0-alpha.13 → 0.6.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -163,7 +163,12 @@
|
|
|
163
163
|
if (format === "jpeg") {
|
|
164
164
|
options.quality = quality;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
try {
|
|
167
|
+
return await chrome.tabs.captureVisibleTab(windowId, options);
|
|
168
|
+
} catch {
|
|
169
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
170
|
+
return chrome.tabs.captureVisibleTab(windowId, options);
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
async function getPageMetrics(tabId, timeoutMs, deps) {
|
|
169
174
|
const result = await deps.executeWithTimeout(tabId, timeoutMs, () => {
|
|
@@ -155,7 +155,15 @@ async function captureVisible(windowId, format, quality) {
|
|
|
155
155
|
if (format === "jpeg") {
|
|
156
156
|
options.quality = quality;
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
// Retry once after a short delay — headless Chrome on Windows can fail the
|
|
159
|
+
// first readback when the compositor hasn't fully initialised.
|
|
160
|
+
try {
|
|
161
|
+
return await chrome.tabs.captureVisibleTab(windowId, options);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
165
|
+
return chrome.tabs.captureVisibleTab(windowId, options);
|
|
166
|
+
}
|
|
159
167
|
}
|
|
160
168
|
async function getPageMetrics(tabId, timeoutMs, deps) {
|
|
161
169
|
const result = await deps.executeWithTimeout(tabId, timeoutMs, () => {
|