Hacker News new | ask | show | jobs
by a_c 969 days ago
Love it!

I used https://vite-plugin-web-extension.aklinker1.io/guide/ before to have cross browser extension support. If you don't mind I could take a look to add firefox support (no guarantee)

6 comments

As a follow up, the algorithm that powers this makes use of the chrome.devtools.network API. Specifically it passes the Request object that is in the HAR 1.2 archive format.

So if you can pass the equivalent of that in Firefox/other browsers to the insert method and switch things up a bit, it should be relatively straightforward. I will think about pulling out the core logic into its own lib.

https://developer.chrome.com/docs/extensions/reference/devto...

https://developer.chrome.com/docs/extensions/reference/devto...

https://github.com/AndrewWalsh/openapi-devtools/blob/main/sr...

Indeed I have issue here. Firefox maintain a library for unified extension API https://github.com/mozilla/webextension-polyfill

Their type definition for HAR request isn't exported https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast...

So I can't drop in replace the type on https://github.com/AndrewWalsh/openapi-devtools/blob/main/sr...

Also the polyfill has a promise based API rather than a callback, which I don't yet know if there is a workaround
Hey absolutely please do, thank you!
This would be excellent
There's also Plasmo which provides some abstractions over the browsers: https://github.com/PlasmoHQ/plasmo
Are devtools extensions/panels standardized?
Do you mean the devtool protocol[1]? I didn't follow the space so have no knowledge on it. On the other hand there seem to be a polyfilled API on chrome.devtools.network.Request which OP's extension uses extensively https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast...

[1] https://chromedevtools.github.io/devtools-protocol/

I'd love to see FF support on this.