Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clis/chatgpt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2565,10 +2565,10 @@ export async function getChatGPTVisibleImageUrls(page) {
const heading = (turn?.querySelector('h4')?.innerText || '').toLowerCase();
if (/you said|你说/.test(heading)) return true;
if (/chatgpt|assistant|助手/.test(heading)) return false;
const openButtonLabel = (img.closest('button[aria-label^="Open image:"]')?.getAttribute('aria-label') || '').toLowerCase();
const openButtonLabel = (img.closest('button[aria-label^="Open image:"], button[aria-label^="打开图片:"]')?.getAttribute('aria-label') || '').toLowerCase();
const previewText = [alt, openButtonLabel].join(' ');
return /\.(png|jpe?g|webp|gif|heic|heif)(?:\b|$)/i.test(previewText)
|| /ref-|reference|参考|upload|uploaded|attachment/.test(previewText);
|| /ref-|reference|参考|上传|upload|uploaded|attachment/.test(previewText);
};

const imgs = Array.from(document.querySelectorAll('img')).filter(img =>
Expand Down
2 changes: 1 addition & 1 deletion src/daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function unregisterExtensionConnection(ws: WebSocket): void {

// ─── HTTP Server ─────────────────────────────────────────────────────

const MAX_BODY = 1024 * 1024; // 1 MB — commands are tiny; this prevents OOM
const MAX_BODY = 32 * 1024 * 1024; // 32 MB — allows base64 image payloads (chatgpt image upload fallback); prevents OOM

function readBody(req: IncomingMessage): Promise<string> {
return new Promise((resolve, reject) => {
Expand Down