chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { (async () => { // async code goes here // ... const result = await getSomething(); sendResponse(result); })(); // Important! Return true to indicate you want to send a response asynchronously return true; });