IndexedDB shared between windows? #222
Replies: 3 comments 6 replies
-
Some more context: There are three packages: main, renderer and worker. I suspect the issue is the wahy Vite starts up renderer and worker windows -- probably separate processes in node terms -- but I am no expert! |
Beta Was this translation helpful? Give feedback.
-
As far as I know, the chrome engine is responsible for share of states. So for the state of your windows to be synchronized, its must work on one origin and one session. I tried to reproduce your example but did not encounter a problem. The only time the state of the windows was out of sync was when one of them opened as Try opening two identical windows with same url. const options = { ... }
mainWindow = new BrowserWindow(options)
mainWindow2 = new BrowserWindow(options)
...
await mainWindow.loadURL(pageUrl)
await mainWindow2.loadURL(pageUrl) By default, things like |
Beta Was this translation helpful? Give feedback.
-
Just managed to get this to work (without resorting to Workers: https://www.electronjs.org/docs/tutorial/multithreading). Approach (in case it helps others):
(Where Renderer and Worker windows have differing
That seems to work well. |
Beta Was this translation helpful? Give feedback.
-
Context:
Problem:
IndexedDB is different for renderer window and additional window.
Expected:
IndexedDB should be the same/shared between all windows within application.
FYI, this is how electron-forge "works" -- all windows share the same IndexedDB instance/
Make sense?
Beta Was this translation helpful? Give feedback.
All reactions