I am using chrome.extension.onRequest.addListener, I see that I am calling sendResponse with no arguments (=> sendResponse(); ), Sometimes I get an error like this:
Error: Attempting to use a disconnected port object
Must I call sendResponse, or I can remove this function if I am not expecting to get a response from the background?
The documentation says:
This “at most once” sort of indicates that sending a response is optional. While I won’t be able to get you an official confirmation, I checked the source code of my extension and there are several messages where
sendResponseisn’t being called – so far (after a year of heavy use) no issues.