diff --git a/lib/renderer/inspector.js b/lib/renderer/inspector.js index 3192aa160edb..fdb14b717013 100644 --- a/lib/renderer/inspector.js +++ b/lib/renderer/inspector.js @@ -6,6 +6,22 @@ window.onload = function () { window.WebInspector.createFileSelectorElement = createFileSelectorElement } +window.confirm = function (message, title) { + const {dialog} = require('electron').remote + let buttons, cancelId + if (title == null) { + title = '' + } + buttons = ['OK', 'Cancel'] + cancelId = 1 + return !dialog.showMessageBox({ + message: message, + title: title, + buttons: buttons, + cancelId: cancelId + }) +} + const convertToMenuTemplate = function (items) { return items.map(function (item) { const transformed = item.type === 'subMenu' ? {