@swf2es/desktop 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +41 -1
  2. package/dist/main/air.d.ts +3 -3
  3. package/dist/main/air.d.ts.map +1 -1
  4. package/dist/main/air.js +17 -8
  5. package/dist/main/air.js.map +1 -1
  6. package/dist/main/case-paths.d.ts +12 -0
  7. package/dist/main/case-paths.d.ts.map +1 -0
  8. package/dist/main/case-paths.js +84 -0
  9. package/dist/main/case-paths.js.map +1 -0
  10. package/dist/main/connections.d.ts +20 -1
  11. package/dist/main/connections.d.ts.map +1 -1
  12. package/dist/main/connections.js +71 -8
  13. package/dist/main/connections.js.map +1 -1
  14. package/dist/main/main.js +80 -14
  15. package/dist/main/main.js.map +1 -1
  16. package/dist/main/network.d.ts +10 -0
  17. package/dist/main/network.d.ts.map +1 -1
  18. package/dist/main/network.js +111 -35
  19. package/dist/main/network.js.map +1 -1
  20. package/dist/main/proxy.d.ts +48 -0
  21. package/dist/main/proxy.d.ts.map +1 -0
  22. package/dist/main/proxy.js +402 -0
  23. package/dist/main/proxy.js.map +1 -0
  24. package/dist/main/sandbox.d.ts.map +1 -1
  25. package/dist/main/sandbox.js +2 -1
  26. package/dist/main/sandbox.js.map +1 -1
  27. package/dist/main/settings.d.ts +2 -0
  28. package/dist/main/settings.d.ts.map +1 -1
  29. package/dist/main/settings.js +4 -0
  30. package/dist/main/settings.js.map +1 -1
  31. package/dist/main/sockets.d.ts +4 -2
  32. package/dist/main/sockets.d.ts.map +1 -1
  33. package/dist/main/sockets.js +6 -4
  34. package/dist/main/sockets.js.map +1 -1
  35. package/dist/main/websocket-connections.d.ts +11 -0
  36. package/dist/main/websocket-connections.d.ts.map +1 -1
  37. package/dist/main/websocket-connections.js +72 -4
  38. package/dist/main/websocket-connections.js.map +1 -1
  39. package/dist/main/websockets.d.ts +3 -2
  40. package/dist/main/websockets.d.ts.map +1 -1
  41. package/dist/main/websockets.js +4 -3
  42. package/dist/main/websockets.js.map +1 -1
  43. package/package.json +7 -7
  44. package/src/main/air.ts +18 -8
  45. package/src/main/case-paths.ts +97 -0
  46. package/src/main/connections.ts +90 -8
  47. package/src/main/main.ts +105 -20
  48. package/src/main/network.ts +140 -37
  49. package/src/main/proxy.ts +497 -0
  50. package/src/main/sandbox.ts +2 -1
  51. package/src/main/settings.ts +5 -0
  52. package/src/main/sockets.ts +7 -4
  53. package/src/main/websocket-connections.ts +84 -4
  54. package/src/main/websockets.ts +4 -2
@@ -16,7 +16,8 @@ import {
16
16
  * connection made only where `permit` allows its URL, with `open` if
17
17
  * given. `log`, where given, is told each connection asked for, opened,
18
18
  * refused, failed and closed (--log-network), and with `data` what each
19
- * sends and receives too (--log-sockets).
19
+ * sends and receives too (--log-sockets), the connections' lines ending
20
+ * in `via`.
20
21
  */
21
22
  export function bridgeWebSockets(
22
23
  trusted: (event: IpcMainEvent) => boolean,
@@ -24,6 +25,7 @@ export function bridgeWebSockets(
24
25
  open: Opener | undefined,
25
26
  log: ((line: string) => void) | null = null,
26
27
  data = false,
28
+ via = "",
27
29
  ): void {
28
30
  const pages = new Map<WebContents, WebSocketConnections>();
29
31
 
@@ -85,7 +87,7 @@ export function bridgeWebSockets(
85
87
  // As the client will read it: what is said of it has nothing a terminal would act on.
86
88
  const href = new URL(url).href;
87
89
  const allowed = permit(href);
88
- log?.(webSocketLine(id, `${allowed ? "connecting to" : "refused"} ${href}`));
90
+ log?.(webSocketLine(id, `${allowed ? `connecting to ${href}${via}` : `refused ${href}`}`));
89
91
  if (allowed) {
90
92
  connections.connect(id, href, protocols);
91
93
  } else {