Is it possible to allow users to “upload” a wasm file to the extension (put that in storage and ideally simply access it with a local extension URL) and then use this within the extension?
My extension has an optional function that works with a .wasm file. But because it is optional and not all users will need it I don’t want to distribute it by default. (also because it is rather big)
Addons doesn’t have access to files on user drive. Except maybe in the “downloads” folder with a downloads permission…
Otherwise user would have to load through the “input” element. But still, can you even serialize a wasm and save it in the store and then load and execute it? I have doubts.
Maybe “fetch” it from a server, but that would probably be a remote code execution violation…
Indeed I was thinking about some “upload” through some file input and store it locally in browser storage.
If base64 encoded or similar this should also work for wasm files, no?
I’d like to avoid the fetch() because of the potential remote code execution violation - though I am still not sure if this is one or not. (right now it works)
And I don’t want to include the wasm file in the extension because it is optional and not all users need it.