aklinker1 / webext-core

Collection of essential libraries and tools for building web extensions
https://webext-core.aklinker1.io
MIT License
116 stars 13 forks source link

Messaging: Cannot create multiple messengers in the same context anymore #24

Closed aklinker1 closed 1 year ago

aklinker1 commented 1 year ago

Overview

I noticed this while working on #21 while updating the demo extension. You should be able to do this:

const messenger1 = defineExtensionMessaging();
const messenger2 = defineExtensionMessaging();

Messages sent to and from messenger1 should not trigger listeners for messenger2, and vice-versa.

Why is this important? Because each @webext-core/proxy-service sets up it's own listeners internally which should not effect any other proxy services or other messenger definitions.

Reproduction

Run the packages/messaging-demo extension, and press any of the buttons on the popup.

Todo

aklinker1 commented 1 year ago

Closed by https://github.com/aklinker1/webext-core/commit/71c654da9a0fde64f9ce7eb59bea650632a1fa0d