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
- return chrome.tabs.captureVisibleTab(windowId, options);
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
- return chrome.tabs.captureVisibleTab(windowId, options);
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, () => {
@@ -19,5 +19,5 @@
19
19
  "background": {
20
20
  "service_worker": "background.js"
21
21
  },
22
- "version_name": "0.6.0-alpha.13"
22
+ "version_name": "0.6.0-alpha.15"
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabctl",
3
- "version": "0.6.0-alpha.13",
3
+ "version": "0.6.0-alpha.15",
4
4
  "description": "CLI tool to manage and analyze browser tabs",
5
5
  "license": "MIT",
6
6
  "repository": {