Browse Source

Prune

Refs:
- https://www.electronjs.org/docs/latest/api/protocol
- https://github.com/electron/electron/issues/39031
- https://github.com/electron/electron/issues/38749
Manav Rathi 1 year ago
parent
commit
720e84ba1f
1 changed files with 8 additions and 6 deletions
  1. 8 6
      desktop/src/main.ts

+ 8 - 6
desktop/src/main.ts

@@ -113,6 +113,7 @@ const setupRendererServer = () => serveNextAt(rendererURL);
 const registerPrivilegedSchemes = () => {
     protocol.registerSchemesAsPrivileged([
         {
+            // Taken verbatim from next-electron-server's code (index.js)
             scheme: "ente",
             privileges: {
                 standard: true,
@@ -125,14 +126,15 @@ const registerPrivilegedSchemes = () => {
         {
             scheme: "stream",
             privileges: {
-                // standard: true,
+                // TODO(MR): Remove the commented bits if we don't end up
+                // needing them by the time the IPC refactoring is done.
+
+                // Prevent the insecure origin issues when fetching this
                 // secure: true,
-                // supportFetchAPI: true,
-                standard: true,
-                secure: true,
-                allowServiceWorkers: true,
+                // Allow the web fetch API in the renderer to use this scheme.
                 supportFetchAPI: true,
-                corsEnabled: true,
+                // Allow it to be used with video tags.
+                // stream: true,
             },
         },
     ]);