Skip to content
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

safeDialogs option is broken since 7.0.0 (up to 9.0.0-beta.2, at least) #22350

Closed
3 tasks done
ChALkeR opened this issue Feb 23, 2020 · 1 comment · Fixed by #22353
Closed
3 tasks done

safeDialogs option is broken since 7.0.0 (up to 9.0.0-beta.2, at least) #22350

ChALkeR opened this issue Feb 23, 2020 · 1 comment · Fixed by #22353
Assignees

Comments

@ChALkeR
Copy link
Contributor

ChALkeR commented Feb 23, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 9.0.0-beta.2
    • 8.0.1
    • 7.1.13
    • 7.0.0
  • Operating System:
    • Linux xps 5.5.4-arch1-1 #1 SMP PREEMPT Sat, 15 Feb 2020 00:36:29 +0000 x86_64 GNU/Linux (Arch Linux current)
    • macOS 10.15.3
  • Last Known Working Electron version:
    • 6.1.8 -- fine, not affected

Expected Behavior

  • When safeDialogs option is used, I expect to see a "Prevent this app from creating additional dialogs" checkbox on all alerts after the first one, like it happened in Electron 6.1.8.
  • I expect safeDialogs option to do at least something.

Basically, how 6.x behaves.

Actual Behavior

  • That checkbox does not appear on second alert, or on any other subsequent alert (tried about 10).
  • There seems to no observable difference at all between turning that option on or off.

To Reproduce

const { BrowserWindow, app } = require('electron')
app.on('ready', () => {
  const window = new BrowserWindow({
    webPreferences: {
      //partition: 'memory',
      safeDialogs: true,
    }
  })
  window.webContents.loadURL('about:blank') // also could be e.g. https://example.com/
  window.webContents.on('did-finish-load', () => {
    window.webContents.executeJavaScript(`
      document.body.innerText = window.navigator.userAgent // (not required)
      alert(0)
      setTimeout(() => { alert(1) }, 100) // timeout for UA to be shown
    `)
  })
  window.show()
})

Screenshots

v6.1.8 (correct behavior)

Screenshot_20200223_221526

v7.0.0

Screenshot_20200223_222330

v7.1.13

Screenshot_20200223_221938

v8.0.1

Screenshot_20200223_222409

9.0.0-beta.2

Screenshot_20200223_222754

Additional Information

@ChALkeR
Copy link
Contributor Author

ChALkeR commented Feb 26, 2020

I can confirm this now works on master, thanks!

@sofianguy sofianguy added this to Fixed in 8.0.2 in 8.2.x Feb 26, 2020
@sofianguy sofianguy added this to Fixed in 9.0.0-beta.4 in 9-x-y Mar 6, 2020
@sofianguy sofianguy added this to Fixed in 7.1.14 in 7.2.x Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
7.2.x
Fixed in 7.1.14
8.2.x
Fixed in 8.0.2
9-x-y
Fixed in 9.0.0-beta.4
Development

Successfully merging a pull request may close this issue.

2 participants