It might be worth to consider using Electron BrowserViews instead of webviews. Here are some reasons why it might be a good idea
Electron's webview tag is based on Chromium's webview, which is undergoing dramatic architectural changes. This impacts the stability of webviews, including rendering, navigation, and event routing. We currently recommend to not use the webview tag and to consider alternatives, like iframe, Electron's BrowserView, or an architecture that avoids embedded content altogether.
I've seen some articles mention improved performance, though I'm not sure how significant this is if at all. Worth looking into though, as it could help with #62.
BrowserViews have a webContents property with a findInPage method. That can help with #67.
Even though the webview documentation recommends using BrowserViews over webviews, they are marked as experimental.
Does BrowserView still only support one view at a time? I looks into this a couple of months ago but Electron only allowed for one view to exist at a time, which would not be ideal as users want to keep their other services alive in the background so they can continue where they were.
I would assume so. It says it was added in the Electron 5.0 changelog (by this PR), and I can't find any mention of it being removed in 6.0 or 7.0.
It looks like BrowserViews supports all features Ferdi needs to work! Ferdi uses react-electron-web-view to manage the web view. I just created react-electron-browser-view which should allow us to pretty much simply swap out those package to switch to BrowserViews.
@vantezzen Very well done! 馃挭
Just as an update: I am currently trying to change Ferdi to using BrowserViews but here are some problems I am facing:
For the overlays, maybe one of these would work
Moving overlays to new BrowserViews/windows/tabs would require major rewrites inside Ferdi as this this would require the modal plus their functionality to be moved into new pages and would also require us to create a method for these different pages to communicate and live-update.
These changes would also need to be kept updated every time we sync with Franz - so I don't think this is a real option.
I think our only option is to hide the BrowserViews as soon as an overlay opens.
Additionally, in my short tests while developing it looks like BrowserViews don't actually improve Ferdi's performance a lot - but I havn't done enough tests yet.
Another improvement you mentioned about BrowserViews is that they offer findInPage functionality: webviews also offer this. The reason it isn't implement yet is because it requires additional logic and design inside Ferdi - this isn't different with BrowserViews.
I don't really know if BrowserViews actually have enough improvements over webviews that we can justify switching.
I would like to find a BrowserView simple example Browser .
Can someone aim me in the right direection .
Thanks for your Help...
Most helpful comment
It looks like
BrowserViewssupports all features Ferdi needs to work! Ferdi uses react-electron-web-view to manage the web view. I just created react-electron-browser-view which should allow us to pretty much simply swap out those package to switch to BrowserViews.Related: https://github.com/getferdi/ferdi/blob/09b961828168f8ab5a2052e0c9072d55cd1cfafc/src/components/services/content/ServiceWebview.js#L58-L79