I am creating my first Electron app and I got the first page of the form done. Now this app is not a SPA, so I have about 3-4 different pages, and page leads to another.
To allow proper code organization I want to keep a separate Preload file for each client facing page, unfortunately I am not able to get this right.
I've tried setting the Preload file again on the BrowserWindow object (Yes, I want to use only one instance of the BrowserWindow and load all my files there), but that doesn't work. I still get the functions from the old preload only.
There's a method called setPreloads on the session object of the WebContents, but that doesn't seem to work either as my ContextBridge doesn't have the new functions even then.
What is a good solution to this?