chore: convert guest-window-manager.js to TypeScript (#25709)

This commit is contained in:
Milan Burda 2020-10-02 20:18:42 +02:00 committed by GitHub
parent 7e88585bfb
commit e1a19d735e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 48 deletions

View file

@ -566,7 +566,7 @@ WebContents.prototype._init = function () {
if (this.getType() !== 'remote') {
// Make new windows requested by links behave like "window.open".
this.on('-new-window' as any, (event: any, url: string, frameName: string, disposition: string,
rawFeatures: string, referrer: string, postData: string) => {
rawFeatures: string, referrer: string, postData: Electron.UploadRawData[]) => {
const { options, webPreferences, additionalFeatures } = parseFeatures(rawFeatures);
const mergedOptions = {
show: true,
@ -584,7 +584,7 @@ WebContents.prototype._init = function () {
// "window.open", used in sandbox and nativeWindowOpen mode.
this.on('-add-new-contents' as any, (event: any, webContents: Electron.WebContents, disposition: string,
userGesture: boolean, left: number, top: number, width: number, height: number, url: string, frameName: string,
referrer: string, rawFeatures: string, postData: string) => {
referrer: string, rawFeatures: string, postData: Electron.UploadRawData[]) => {
if ((disposition !== 'foreground-tab' && disposition !== 'new-window' &&
disposition !== 'background-tab')) {
event.preventDefault();