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:
Jeremy Rose 2021-04-13 12:35:27 -07:00 committed by GitHub
parent b6315612dd
commit dba4df9326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 152 additions and 65 deletions

View file

@ -3093,7 +3093,7 @@ describe('BrowserWindow module', () => {
expect(additionalFeatures).to.deep.equal([]);
expect(postBody.data).to.have.length(1);
expect(postBody.data[0].type).to.equal('rawData');
expect(postBody.data[0].bytes).to.deep.equal(Buffer.from('post-test-key=post-test-value'));
expect((postBody.data[0] as any).bytes).to.deep.equal(Buffer.from('post-test-key=post-test-value'));
expect(postBody.contentType).to.equal('application/x-www-form-urlencoded');
});
});