BrowserView is deprecated in Electron>=29
According to Electron API docs BrowserView was deprecated in version 29 in favour of WebContentsView.
BrowserView: https://www.electronjs.org/docs/latest/api/browser-view WebContentsView: https://www.electronjs.org/docs/latest/api/web-contents-view
It is worth looking at this to make sure that API is still relevant and working and add a new one as well.
In my opinion this depends. If we want to still support versions that do not have WebContentsView we should stick to the deprecated one (or have both - but I think this would be too costly in terms of maintenance). Otherwise, I'd say let's go for the new one. I'm open for both options (I'd even argue that it would be good to remove that old cruft and use this to well-define a minimum version of Electron that is supported by Electron.NET).
I would also suggest to use new API since it is not known how long the old one will be kept in Electron. It has been 10 versions and it is still present but we cannot take it for granted.
From my point of view, this is very simple:
- We need to have the new one (it's the way forward, there's no really a choice)
- And we cannot drop the old one (would break things for Electron.NET users - they should be able to make their own decisions when to migrate)
This could probably be solved with a custom analyzer and attribute on the old BrowserView class/property that would warn (or potentially throw an error) on compile, depending on the electron version that is selected.
While I was implementing WebContents methods did notice that BrowserView is used in other code like IpcMain, WindowManager and possibly more.
Do not think it will be an easy switch.