Falcon does this. https://addons.mozilla.org/en-US/firefox/addon/falcon_extens...
This is all pretty clever and a reasonable implementation imo. I'm not sure what better way there could be using web extensions (that support FTS) - the only thing I could think of is a WASM SQLite module.
https://github.com/CennoxX/falcon#transparent-installation
As for Firefox, you can right-click the "Add to Firefox" button and save and inspect the extension.