Is there a way to set/change the preload option in webPreferences after BrowserWindow has been created?
What I would like to do is make a webcrawler that changes its preload script whenever the BrowserWindow redirects to a new URL.
The issue that I am trying to solve is that the webcrawler needs to collect different information on different sites.
The only 2 solutions I can think of are:
BrowserWindow with a different preload script each time it redirects,but neither seems resource efficient.
Is it possible to change or use different preload scripts without using multiple instances of the BrowserWindow?
no, preload script is tied to per-process browserwindow creation, not per-url navigation inside of browserwindow.