3 ms·
It should be easy to fix that with browser extension and small native program. Nobody wrote this yet?
by vbezhenar 2y ago
It should be easy to fix that with browser extension and small native program. Nobody wrote this yet?
- pjc50 2y agoWait, under what circumstances are browser extensions allowed to communicate with anything outside the browser?
- vbezhenar 2y agohttps://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web... But more generally you can just run webserver on 127.0.0.1 and interact with it from extension (although I didn't test this particular use-case, it works fine from website, but extension might have its own nuances).
- lxgr 2y agoThe latter poses some security problems, though, which the native messaging API avoids (e.g. random websites being able to connect to the native application and pretending to be your extension).
- vbezhenar 2y agoWhen random websites connect to your application, you can (and should) inspect Referer header and filter out unwanted ones.
- Macha 2y agohttps://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web... It was basically built so password manager extensions could communicate with password manager apps to do things like yubikey support etc. before browsers started handling webauthn
- dz0ny 2y agoOh wow, this is cool. Yep this would make USB Serial work on Firefox with a simple extension.
- Macha 2y agoExtension + a native program for the extension to talk to. The native program has to manage accessing the usb device and providing an interface to the browser extension.
- AshamedCaptain 2y agoYes, I have done this for (a fraction of) WebBluetooth. Albeit the extension API does not make it easy, and i don't know if you can implement the entire Web* API surface, but at least it is good enough for proofs of concept.