Steps to reproduce
Hello! I have a problem with communication based on runtime.connect between a content script and a background script of my test echo extension. I have published my code and extension package on github: https://github.com/alexeysidorov92/edge.echo.extension
Short description: the content script connects to the background script using browser.runtime.connect and sends a message via browser.runtime.Port object when “Submit” button is clicked. The background script receives the messsage, converts it to upper case and sends back. Then content script receives the modified message and displays it on the page.
This extension works fine when I add it to Edge using Load extension button as described in https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/adding-and-removing-extensions. So if you open the page https://alexeysidorov92.github.io/edge_echo.html you should see “HELLO FROM BACKGROUND SCRIPT” text in the received message field.
But there is a strange problem if this extension is installed from a package… The extension doesn’t work properly until I open the background page of this extension and reload the page…
So you can try to reproduce it:
- Install this extension from the package
- Open the page https://alexeysidorov92.github.io/edge_echo.html. The background script doesn’t work (received message field is empty) and this script doesn’t receive sent messages… Page reloading or turning off\on of the extension doesn’t help.
- Open background page of this extension https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/debugging-extensions. Then this page may be closed.
- Reload the page https://alexeysidorov92.github.io/edge_echo.html
- Extension starts to work properly…
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “James M.”
Changed Assigned To to “Akshay P.”
Changed Status to “Confirmed”
Changed Assigned To from “Akshay P.” to “Arif S.”