Connects to user's running Brave via Chrome DevTools Protocol to automate ChatGPT interaction. Uses puppeteer-core to open a tab, send the prompt, wait for response, and extract the result. No cookies, no separate profiles, no copy/paste. Just connects to the browser where the user is already logged in. One-time setup: relaunch Brave with --remote-debugging-port=9222 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
675 B
JavaScript
24 lines
675 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.StringWriter = void 0;
|
|
const stream_1 = require("stream");
|
|
class StringWriter extends stream_1.Writable {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.buf = Buffer.alloc(0);
|
|
}
|
|
_write(chunk, _, callback) {
|
|
if (chunk instanceof Buffer) {
|
|
this.buf = Buffer.concat([this.buf, chunk]);
|
|
callback(null);
|
|
}
|
|
else {
|
|
callback(new Error("StringWriter expects chunks of type 'Buffer'."));
|
|
}
|
|
}
|
|
getText(encoding) {
|
|
return this.buf.toString(encoding);
|
|
}
|
|
}
|
|
exports.StringWriter = StringWriter;
|