comlink icon indicating copy to clipboard operation
comlink copied to clipboard

PR: WebExtensions Port API to endpoint adapter

Open hackape opened this issue 5 years ago • 5 comments

I am authoring a web app backed by a chrome extension. Basically I'm using the extension's background page as a web worker equivalent.

Turns out it's trivial to convert the runtime.port API to comlink endpoint. So I write an adapter for it, thus this PR.

I wonder if you think this is worth including in the core lib, like with node-adapter, or think it's out of scope and prefer I publish an individual package.

hackape avatar Dec 10 '19 10:12 hackape

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

googlebot avatar Dec 10 '19 10:12 googlebot

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

googlebot avatar Dec 10 '19 10:12 googlebot

This provide a solution to #129

hackape avatar Dec 10 '19 10:12 hackape

chrome-extension-demo.zip

Attach an extension for demo.

hackape avatar Dec 10 '19 11:12 hackape

Yes it is not work in my case in browser with webextensions from there https://github.com/GoogleChromeLabs/comlink/issues/129 @felixfbecker maybe you know some workaround there?

maxbaluev avatar Aug 24 '23 17:08 maxbaluev