override window.confirm in devtools
This commit is contained in:
parent
bbaab755e3
commit
3ac9858726
1 changed files with 16 additions and 0 deletions
|
@ -6,6 +6,22 @@ window.onload = function () {
|
||||||
window.WebInspector.createFileSelectorElement = createFileSelectorElement
|
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) {
|
const convertToMenuTemplate = function (items) {
|
||||||
return items.map(function (item) {
|
return items.map(function (item) {
|
||||||
const transformed = item.type === 'subMenu' ? {
|
const transformed = item.type === 'subMenu' ? {
|
||||||
|
|
Loading…
Reference in a new issue