New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when using file chooser in BrowserView #9828

Merged
merged 1 commit into from Jun 26, 2017

Conversation

Projects
None yet
2 participants
@poiru
Member

poiru commented Jun 21, 2017

The crash was a segfault caused by a null WebDialogHelper::window_.

@poiru poiru requested a review from kevinsawicki Jun 21, 2017

Fix crash when using file chooser in BrowserView
The crash was a segfault caused by a null `WebDialogHelper::window_`.
@poiru

This comment has been minimized.

Member

poiru commented Jun 26, 2017

This also fixes application menu keyboard shortcuts in BrowserView on Linux/Windows.

@kevinsawicki kevinsawicki self-assigned this Jun 26, 2017

@kevinsawicki kevinsawicki merged commit 4c8592b into master Jun 26, 2017

6 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-mas-x64 Build #4468 succeeded in 12 min
Details
electron-osx-x64 Build #4474 succeeded in 10 min
Details
electron-win-ia32 Build #3444 succeeded in 12 min
Details
electron-win-x64 Build #3449 succeeded in 10 min
Details
@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jun 26, 2017

Thanks @poiru

Verified the crash was fixed with the following app:

const {app, BrowserView, BrowserWindow} = require('electron')

let win

app.once('ready', () => {
  win = new BrowserWindow({width: 800, height: 600})
  win.on('closed', () => {
    win = null
  })

  let view = new BrowserView({
    webPreferences: {
      nodeIntegration: false
    }
  })
  win.setBrowserView(view)
  view.setBounds({x: 0, y: 0, width: 300, height: 300})
  view.webContents.loadURL(`file://${__dirname}/index.html`)
})
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    hello
    <input type="file">
  </body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment