gildas-lormeau/SingleFile · warning · Error
SingleFile is already processing this page
Error message
SingleFile is already processing this page
What it means
The content script's capturePage refuses to start a capture when one is already in progress: either the module-level 'processing' flag is set or the bootstrap pageInfo reports processing. The ping interval is cleared and 'SingleFile is already processing this page' is thrown to prevent concurrent captures of the same page.
Source
Thrown at src/core/content/content.js:212
if (bootstrap) {
bootstrap.pageInfo.processing = false;
}
}
clearInterval(pingInterval);
}
async function capturePage(message) {
const pingInterval = setInterval(() => {
browser.runtime.sendMessage({ method: "ping" }).then(() => { });
}, 15000);
const options = message.options;
let selectionFound;
if (options.selected || options.optionallySelected) {
selectionFound = await ui.markSelection(options.optionallySelected);
}
if (processing || bootstrap && bootstrap.pageInfo.processing) {
clearInterval(pingInterval);
throw new Error("SingleFile is already processing this page");
}
options.visitDate = bootstrap ? bootstrap.pageInfo.visitDate : new Date();
if (options.optionallySelected && selectionFound) {
options.selected = true;
}
if (options.selected && !selectionFound) {
clearInterval(pingInterval);
throw new Error("No selected content found");
}
if (bootstrap) {
bootstrap.pageInfo.processing = true;
}
processing = true;
try {
return await processPage(options);
} finally {
processing = false;
if (bootstrap) {View on GitHub (pinned to 517fb7c5cf)
Solutions
- Wait for the current capture to finish before triggering another one.
- Reload the page to reset the content script's processing state if a previous capture hung.
- Avoid double-invoking: debounce capture triggers (button clicks, shortcuts, external messages).
- If it persists after reload, report a bug — a failed capture may not be clearing the flag.
Example fix
// before
button.onclick = () => capture();
// after
let busy = false;
button.onclick = async () => {
if (busy) return;
busy = true;
try { await capture(); } finally { busy = false; }
}; Defensive patterns
Strategy: retry
Try / catch
try {
await requestCapture();
} catch (e) {
if (e.message === 'SingleFile is already processing this page') {
await sleep(1000);
// retry once, or surface 'busy' state to the user
}
} Prevention
- Debounce capture triggers (buttons, shortcuts, external requests)
- Track capture-in-progress state in your integration and disable re-entry
- Reload the tab if a previous capture appears hung
When it happens
Trigger: Invoking capture (via shortcut, context menu, or external message) while a previous capture on the same tab is still running or hung without cleaning up its processing flag.
Common situations: User double-triggers capture (e.g. clicks the button twice or both a shortcut and an external request fire); a previous capture crashed leaving 'processing' stuck true; slow pages where capture takes a long time and the user retries.
Related errors
AI-assisted analysis of gildas-lormeau/SingleFile@517fb7c5cf (2026-09-01).
Data as JSON: /api/errors/e6a81a334d1ccbf4.
Report an issue: GitHub.