4 ms·
Love it! I used https://vite-plugin-web-extension.aklinker1.io/guide/ https://vite-plugin-web-extension.aklinker1.io/guide/ before to have cross browser extens
by a_c 3y ago
Love it!
I used https://vite-plugin-web-extension.aklinker1.io/guide/ 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)
- lucasyvas 3y agoThis would be excellent
- mrmagoo2 3y agoHey absolutely please do, thank you!
- parhamn 3y agoAre devtools extensions/panels standardized?
- a_c 3y agoDo 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/master/types/webextension-polyfill/namespaces/devtools_network.d.ts#L22 https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast... [1] https://chromedevtools.github.io/devtools-protocol/ https://chromedevtools.github.io/devtools-protocol/
- distortedsignal 3y agoI'd love to see FF support on this.
- mrmagoo2 3y agoAs 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/devtools_network/ https://developer.chrome.com/docs/extensions/reference/devto... https://developer.chrome.com/docs/extensions/reference/devtools_network/#type-Request https://developer.chrome.com/docs/extensions/reference/devto... https://github.com/AndrewWalsh/openapi-devtools/blob/main/src/lib/RequestStore.ts#L48 https://github.com/AndrewWalsh/openapi-devtools/blob/main/sr...
- a_c 3y agoIndeed I have issue here. Firefox maintain a library for unified extension API https://github.com/mozilla/webextension-polyfill https://github.com/mozilla/webextension-polyfill Their type definition for HAR request isn't exported https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webextension-polyfill/namespaces/devtools_network.d.ts#L22 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/src/lib/RequestStore.ts#L48 https://github.com/AndrewWalsh/openapi-devtools/blob/main/sr...
- a_c 3y agoAlso the polyfill has a promise based API rather than a callback, which I don't yet know if there is a workaround
- civilitty 3y agoThere's also Plasmo which provides some abstractions over the browsers: https://github.com/PlasmoHQ/plasmo https://github.com/PlasmoHQ/plasmo