You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
In Branch 31.x.x, the SetWindowOpenHandler return value can include a function called createWindow. This allows us to create a new BrowserView or BrowserWindow instead of calling the default event did-create-window.
It is currently not possible to create a WebContentsView because it does not accept an existing webContents object in its options.
Due to this it is not possible to create a WebContentsView within the SetWindowOpenHandler,
Proposed Solution
To resolve this we can do the same as the BrowserWindow code does src\electron\shell\browser\api\electron_api_browser_window.cc
i.e.:
// Copy the webContents option to webPreferences.
v8::Local<v8::Value> value;
if (options.Get("webContents", &value)) {
web_preferences.SetHidden("webContents", value);
}
in src\electron\shell\browser\api\electron_api_web_contents_view.cc at line 157
This allows us to simply pass the options argument of createWindow straight into as follows: new WebContentsView(options)
Alternatives Considered
N/a
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Preflight Checklist
Problem Description
In Branch 31.x.x, the SetWindowOpenHandler return value can include a function called createWindow. This allows us to create a new BrowserView or BrowserWindow instead of calling the default event did-create-window.
It is currently not possible to create a WebContentsView because it does not accept an existing webContents object in its options.
Due to this it is not possible to create a WebContentsView within the SetWindowOpenHandler,
Proposed Solution
To resolve this we can do the same as the BrowserWindow code does src\electron\shell\browser\api\electron_api_browser_window.cc
i.e.:
in src\electron\shell\browser\api\electron_api_web_contents_view.cc at line 157
This allows us to simply pass the options argument of createWindow straight into as follows: new WebContentsView(options)
Alternatives Considered
N/a
Additional Information
No response
The text was updated successfully, but these errors were encountered: