Setup:
A chrome.runtime.onMessage listener attached on the top frame which sends no response, and another listener attached on a frame which sends a response. The background page sends a message to the tab.
What happens:
The top frame listener is invoked and returns undefined. A response is returned to the background sendMessage call.
What should happen:
The listener on attached on a frame should be invoked after the top frame listener and checked for either a response or returning true with an intention to respond asynchronously and only then a response should be returned to the background page.
A chrome.runtime.onMessage listener attached on the top frame which sends no response, and another listener attached on a frame which sends a response. The background page sends a message to the tab.
What happens:
The top frame listener is invoked and returns undefined. A response is returned to the background sendMessage call.
What should happen:
The listener on attached on a frame should be invoked after the top frame listener and checked for either a response or returning true with an intention to respond asynchronously and only then a response should be returned to the background page.