mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
feat: add more info in setWindowOpenHandler details (#28518)
* fix: invoke the window open handler for _blank links * feat: add disposition to setWindowOpenHandler details * fix: pass postData to new-window event * postData can be heterogeneous * fix type of postBody * fix type of UploadFile and UploadRawData to be discriminated unions * exclude the empty string from additionalFeatures * add a test * add postBody and referrer to setWindowOpenHandler args * appease typescript * Update api-browser-window-spec.ts * update snapshots
This commit is contained in:
@@ -1012,8 +1012,9 @@ bool WebContents::IsWebContentsCreationOverridden(
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
const content::mojom::CreateNewWindowParams& params) {
|
||||
bool default_prevented = Emit("-will-add-new-contents", params.target_url,
|
||||
params.frame_name, params.raw_features);
|
||||
bool default_prevented = Emit(
|
||||
"-will-add-new-contents", params.target_url, params.frame_name,
|
||||
params.raw_features, params.disposition, *params.referrer, params.body);
|
||||
// If the app prevented the default, redirect to CreateCustomWebContents,
|
||||
// which always returns nullptr, which will result in the window open being
|
||||
// prevented (window.open() will return null in the renderer).
|
||||
|
||||
Reference in New Issue
Block a user