feat: add more info in setWindowOpenHandler details#28518
Conversation
|
This should perhaps be target/12-x-y too |
|
Would it be possible to add the parsed |
parsed features is a little more complicated because:
If it helps, the code for parsing the features isn't much more complicated than electron/lib/common/parse-features-string.ts Lines 59 to 72 in 77dcf10 |
|
@nornagon thanks for looking into this, I'll probably use JSON then if I can use any string. I'm in control of the features string anyway. |
|
Release Notes Persisted
|
|
I was unable to backport this PR to "13-x-y" cleanly; |
* 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
|
@VerteDinde has manually backported this PR to "master", please check out #29276 |
|
@VerteDinde has manually backported this PR to "13-x-y", please check out #29276 |
|
@VerteDinde has manually backported this PR to "13-x-y", please check out #29277 |
* 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 Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Since the introduction of `setWindowOpenHandler` `features` is no longer parsed but passed as a raw string (see electron#28518 (comment)). I've switched to JSON to pass data through `window.open` for my multi-window application. The docs should reflect that this can be an arbitrary string.
Description of Change
This adds
disposition,referrerandpostBodyto the details object passed to the window open handler.Builds on #28513, which fixes a number of PostBody-related issues.
Closes #28380.
Checklist
npm testpassesRelease Notes
Notes: Added
disposition,referrerandpostBodyto the details object passed to the window open handler registered withsetWindowOpenHandler.