barebrowse 0.7.1 → 0.9.0
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/CHANGELOG.md +213 -0
- package/LICENSE +202 -21
- package/NOTICE +8 -0
- package/README.md +37 -10
- package/barebrowse.context.md +43 -18
- package/cli.js +114 -3
- package/mcp-server.js +272 -68
- package/package.json +2 -2
- package/src/bareagent.js +33 -0
- package/src/chromium.js +115 -5
- package/src/consent.js +3 -8
- package/src/daemon.js +13 -0
- package/src/index.js +429 -132
- package/src/network-idle.js +62 -0
- package/src/stealth.js +87 -6
package/src/daemon.js
CHANGED
|
@@ -39,6 +39,7 @@ export async function startDaemon(opts, outputDir, initialUrl) {
|
|
|
39
39
|
if (opts.proxy) args.push('--proxy', opts.proxy);
|
|
40
40
|
if (opts.viewport) args.push('--viewport', opts.viewport);
|
|
41
41
|
if (opts.storageState) args.push('--storage-state', opts.storageState);
|
|
42
|
+
if (opts.downloadPath) args.push('--download-path', opts.downloadPath);
|
|
42
43
|
|
|
43
44
|
const child = spawn(process.execPath, args, {
|
|
44
45
|
detached: true,
|
|
@@ -77,6 +78,7 @@ export async function runDaemon(opts, outputDir, initialUrl) {
|
|
|
77
78
|
proxy: opts.proxy,
|
|
78
79
|
viewport: opts.viewport,
|
|
79
80
|
storageState: opts.storageState,
|
|
81
|
+
downloadPath: opts.downloadPath,
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
// Console log capture
|
|
@@ -208,6 +210,17 @@ export async function runDaemon(opts, outputDir, initialUrl) {
|
|
|
208
210
|
return { ok: true };
|
|
209
211
|
},
|
|
210
212
|
|
|
213
|
+
async reload({ ignoreCache }) {
|
|
214
|
+
await page.reload({ ignoreCache: !!ignoreCache });
|
|
215
|
+
return { ok: true };
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
async downloads() {
|
|
219
|
+
// Snapshot the array — callers want a static view at the moment of
|
|
220
|
+
// the request, not a reference that mutates under them.
|
|
221
|
+
return { ok: true, value: page.downloads.map((d) => ({ ...d })) };
|
|
222
|
+
},
|
|
223
|
+
|
|
211
224
|
async drag({ fromRef, toRef }) {
|
|
212
225
|
await page.drag(String(fromRef), String(toRef));
|
|
213
226
|
return { ok: true };
|