Skip to content

ensure addListener takes a synchronous callback#406

Open
max-baz wants to merge 1 commit into
masterfrom
ensure-listener-synchronous
Open

ensure addListener takes a synchronous callback#406
max-baz wants to merge 1 commit into
masterfrom
ensure-listener-synchronous

Conversation

@max-baz
Copy link
Copy Markdown
Member

@max-baz max-baz commented May 22, 2026

Another potential improvement to help with #404

As per https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#sendresponse:

image

I'm reusing the same pattern used in:

// handle incoming messages
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
receiveMessage(message, sender, sendResponse);
// allow async responses after this function returns
return true;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant