Skip to content
Merged
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
10 changes: 9 additions & 1 deletion src/static/js/ace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ const eventFired = async (obj, event, cleanups = [], predicate = () => true) =>
cleanup();
resolve();
};
const errorCb = () => {
const errorCb = (evt) => {
// Ignore error events from browser extension scripts — they are unrelated
// to Etherpad and should not block editor initialization.
// See https://github.com/ether/etherpad-lite/issues/6802
const src = evt?.target?.src || evt?.filename || '';
if (/^(moz|chrome|safari)-extension:\/\//.test(src)) {
debugLog('Ace2Editor.init() ignoring error from browser extension:', src);
return;
}
const err = new Error(`Ace2Editor.init() error event while waiting for ${event} event`);
debugLog(`${err} on object`, obj);
cleanup();
Comment on lines +53 to 64
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Missing regression test 📘 Rule violation ☼ Reliability

This PR changes production error-handling behavior to ignore browser-extension errors but does not
add/update an automated regression test to ensure the bug cannot be reintroduced. Without a test, a
future refactor could revert this behavior and CI would not catch it.
Agent Prompt
## Issue description
A bug fix was made to ignore error events/exceptions originating from browser extensions, but there is no automated test that would fail if this behavior were reverted.

## Issue Context
The change prevents extension-injected script errors (e.g., `chrome-extension://`, `moz-extension://`, `safari-extension://`) from blocking editor/pad loading.

## Fix Focus Areas
- src/static/js/ace.ts[53-66]
- src/static/js/pad_utils.ts[399-425]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — browser extension errors are inherently untestable in Playwright (no real extensions in headless browsers). The regex filter is simple and defensive.

Expand Down
7 changes: 7 additions & 0 deletions src/static/js/pad_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,13 @@ class PadUtils {
if (err.name != null && msg !== err.name && !msg.startsWith(`${err.name}: `)) {
msg = `${err.name}: ${msg}`;
}

// Ignore errors from browser extensions — they are unrelated to Etherpad
// and should not block the pad from loading.
// See https://github.com/ether/etherpad-lite/issues/6802
const source = url || err.stack || '';
if (/^(moz|chrome|safari)-extension:\/\//.test(source)) return;

const errorId = randomString(20);

const errorKey = `${type}:${msg}:${url}:${linenumber}`;
Expand Down
Loading