webextensions-examples
webextensions-examples copied to clipboard
Cannot send function call result: other side closed connection
When running the window-manipulator example and clicking e.g. on Create panel in the popup, the error
Cannot send function call result: other side closed connection
appears in the browser console and the statement console.log("The panel has been created") is not executed.
A similar looking error was referenced in the closed issue but the resolution suggested there (and accepted as a solution in Bug 1326044) is not applicable here.
I use Firefox 53.0.3 (64 bit) on Linux. I encountered this bug when writing a simple extension and a callback after the window is created is absolutely crucial for functionality.
My hypothesis would be that the default_popup page ceases to exist together with the promise resolution callback functions. I checked in my extension that if I eliminate the popup and listen to browser.browserAction.onClicked.addListener(handleClick) in a background script then the window creation promise callback is indeed called correctly. If this hypothesis would indeed be true it would very seriously cripple the webextension functionality using popup menus.
@andymckay , do you have any insight into this? In Firefox Nightly, I'm not seeing the Cannot send function call result: other side closed connection error reported here, but I can confirm that "The panel has been created" is not being logged.
If you disable popup autohide, then the message is reliably logged to the console. Which is weird, because the popup isn't being hidden in the other case.
The window manipulator example might be more robust if it used a background script to open panels.
No activity within the last three years, closing.