3 ms·
I'm interested in your extension. I'm wondering if I could do something similar to force text encoding of pages into Japanese.
by msephton 1y ago
I'm interested in your extension. I'm wondering if I could do something similar to force text encoding of pages into Japanese.
- Arnavion 1y agoIf your Firefox supports sideloading extensions then making extensions that modify request or response headers is easy. All the API is documented in https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web... . My Anubis extension modifies request headers using `browser.webRequest.onBeforeSendHeaders.addListener()` . Your case sounds like modifying response headers which is `browser.webRequest.onHeadersReceived.addListener()` . Either way the API is all documented there, as is the `manifest.json` that you'll need to write to register this JS code as a background script and whatever permissions you need. Then zip the manifest and the script together, rename the zip file to "<id_in_manifest>.xpi", place it in the sideloaded extensions directory (depends on distro, eg /usr/lib/firefox/browser/extensions), restart firefox and it should show up. If you need to debug it, you can use the about:debugging#/runtime/this-firefox page to launch a devtools window connected to the background script.
- msephton 1y agoCheers! I'm in Safari so I'll see if there's a match.