wb-browser-runtime 0.5.2 → 0.5.3
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/bin/wb-browser-runtime.js +11 -4
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ const SUPPORTS = [
|
|
|
49
49
|
];
|
|
50
50
|
|
|
51
51
|
const BB_BASE = "https://api.browserbase.com";
|
|
52
|
-
const VERSION = "0.5.
|
|
52
|
+
const VERSION = "0.5.3";
|
|
53
53
|
|
|
54
54
|
// --- Recording config -------------------------------------------------------
|
|
55
55
|
//
|
|
@@ -682,9 +682,16 @@ async function runVerb(page, verb, index, ctx) {
|
|
|
682
682
|
return `${selector} (${state})`;
|
|
683
683
|
}
|
|
684
684
|
case "screenshot": {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
// Relative paths resolve into $WB_ARTIFACTS_DIR so wb's main-loop
|
|
686
|
+
// `artifacts.sync()` picks them up and uploads to R2. Absolute paths
|
|
687
|
+
// are respected as-is (escape hatch for one-off local dumps).
|
|
688
|
+
const requested = a.path ?? `screenshot-${Date.now()}.png`;
|
|
689
|
+
const artifactsDir = (process.env.WB_ARTIFACTS_DIR || "").trim();
|
|
690
|
+
const full = path.isAbsolute(requested)
|
|
691
|
+
? requested
|
|
692
|
+
: path.join(artifactsDir || ".", requested);
|
|
693
|
+
await page.screenshot({ path: full, fullPage: !!a.full_page });
|
|
694
|
+
return `→ ${requested}`;
|
|
688
695
|
}
|
|
689
696
|
case "extract": {
|
|
690
697
|
// Pull structured rows out of the page. Each `field` entry is either:
|
package/package.json
CHANGED