@lightcone-ai/daemon 0.9.19 → 0.9.21
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.
- package/package.json +1 -1
- package/src/browser-login.js +6 -1
package/package.json
CHANGED
package/src/browser-login.js
CHANGED
|
@@ -184,7 +184,7 @@ export class BrowserLoginSession {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
async screenshot() {
|
|
187
|
-
const result = await this.send('Page.captureScreenshot', { format: 'jpeg', quality: 50, clip: { x: 0, y: 0, width: 800, height: 900, scale: 0.75 } },
|
|
187
|
+
const result = await this.send('Page.captureScreenshot', { format: 'jpeg', quality: 50, clip: { x: 0, y: 0, width: 800, height: 900, scale: 0.75 } }, 10_000);
|
|
188
188
|
return result.data;
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -194,12 +194,17 @@ export class BrowserLoginSession {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
_startPolling(connection) {
|
|
197
|
+
let _screenshotInProgress = false;
|
|
197
198
|
this._screenshotTimer = setInterval(async () => {
|
|
199
|
+
if (_screenshotInProgress) return;
|
|
200
|
+
_screenshotInProgress = true;
|
|
198
201
|
try {
|
|
199
202
|
const screenshot = await this.screenshot();
|
|
200
203
|
connection.send({ type: 'browser:screenshot', platform: this._platform, screenshot });
|
|
201
204
|
} catch (err) {
|
|
202
205
|
console.error(`[BrowserLogin][${this._platform}] Screenshot error:`, err.message);
|
|
206
|
+
} finally {
|
|
207
|
+
_screenshotInProgress = false;
|
|
203
208
|
}
|
|
204
209
|
}, SCREENSHOT_INTERVAL_MS);
|
|
205
210
|
|