Fix alert()

This commit is contained in:
OctoHuman 2016-03-20 02:09:30 -05:00
parent e05804848f
commit 9f6541228d

View file

@ -161,11 +161,14 @@ window.open = function(url, frameName, features) {
// Use the dialog API to implement alert(). // Use the dialog API to implement alert().
window.alert = function(message, title) { window.alert = function(message, title) {
var buttons; var buttons;
if (message === undefined) {
message = '';
}
if (title == null) { if (title == null) {
title = ''; title = '';
} }
buttons = ['OK']; buttons = ['OK'];
message = message.toString(); message = String(message);
remote.dialog.showMessageBox(remote.getCurrentWindow(), { remote.dialog.showMessageBox(remote.getCurrentWindow(), {
message: message, message: message,
title: title, title: title,