mirror of
https://github.com/electron/electron.git
synced 2026-02-10 15:15:43 -05:00
Use the dialog API to implement alert().
This commit is contained in:
@@ -34,3 +34,10 @@ window.open = (url, name, features) ->
|
||||
browser = new BrowserWindow options
|
||||
browser.loadUrl url
|
||||
browser
|
||||
|
||||
# Use the dialog API to implement alert().
|
||||
window.alert = (message, title='') ->
|
||||
remote = require 'remote'
|
||||
dialog = remote.require 'dialog'
|
||||
buttons = ['OK']
|
||||
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
|
||||
|
||||
Reference in New Issue
Block a user