Spaces:
No application file
No application file
Update browser_automation_ui.html
Browse files
browser_automation_ui.html
CHANGED
|
@@ -242,11 +242,10 @@ All endpoints return { ok: true/false, data, error }
|
|
| 242 |
const out = await api('/browser/screenshot');
|
| 243 |
|
| 244 |
// Separate the big base64 string so we don’t dump it in the response box
|
| 245 |
-
const { b64, ...meta } = out;
|
| 246 |
document.getElementById('shotResp').textContent = JSON.stringify(meta, null, 2);
|
| 247 |
|
| 248 |
if (b64) {
|
| 249 |
-
alert("Your message here");
|
| 250 |
const dataUrl = `data:image/png;base64,${b64}`;
|
| 251 |
|
| 252 |
// Show thumbnail
|
|
@@ -256,7 +255,7 @@ All endpoints return { ok: true/false, data, error }
|
|
| 256 |
|
| 257 |
// Wire up & reveal the download button
|
| 258 |
const dl = document.getElementById('downloadBtn');
|
| 259 |
-
|
| 260 |
dl.style.display = 'inline-flex';
|
| 261 |
}
|
| 262 |
}
|
|
|
|
| 242 |
const out = await api('/browser/screenshot');
|
| 243 |
|
| 244 |
// Separate the big base64 string so we don’t dump it in the response box
|
| 245 |
+
const { screenshot: b64, ...meta } = out;
|
| 246 |
document.getElementById('shotResp').textContent = JSON.stringify(meta, null, 2);
|
| 247 |
|
| 248 |
if (b64) {
|
|
|
|
| 249 |
const dataUrl = `data:image/png;base64,${b64}`;
|
| 250 |
|
| 251 |
// Show thumbnail
|
|
|
|
| 255 |
|
| 256 |
// Wire up & reveal the download button
|
| 257 |
const dl = document.getElementById('downloadBtn');
|
| 258 |
+
dl.href = dataUrl;
|
| 259 |
dl.style.display = 'inline-flex';
|
| 260 |
}
|
| 261 |
}
|