paranext / paranext-core

Electron client, extension host, and C# library for Paranext
https://paranext.github.io/paranext-core/
MIT License
16 stars 2 forks source link

Create Electron protocol handler to block internet access when offline #473

Open tjcouch-sil opened 11 months ago

tjcouch-sil commented 11 months ago

As a high-security-needs user, I want Platform.Bible to guarantee that it will never touch the internet so I can be safe while using the product.

As an extension developer, I want Platform.Bible to give me a way to provide saved assets at arbitrary urls when Platform.Bible is offline so I can easily use the same code between some external webapp I made and the webapp adapted to an extension.


Since there are many ways to access the internet from the frontend and we want to be able to police all of them (and since we can't fully enforce a separate CSP in webviews from the renderer overall), let's implement an electron protocol handler that polices every internet request from the frontend.

Created as a result of #176

tjcouch-sil commented 11 months ago

This will not work naturally if we make a web version, but we can go with option 1 in a web scenario. However, we don't know how we would make an offline backup function work in the online setting with arbitrary urls due to security restrictions on protocol handlers and service workers. Hopefully the number of extensions that really need that as an option will be very minimal.

tjcouch-sil commented 10 months ago

Note: remember we need to police all protocols including https and ws