test: use WebContents event to test beforeunload (#23699)
This commit is contained in:
parent
0dabd5e8c7
commit
08f288faf1
13 changed files with 97 additions and 134 deletions
3
spec/fixtures/api/beforeunload-false.html
vendored
3
spec/fixtures/api/beforeunload-false.html
vendored
|
@ -4,9 +4,6 @@
|
|||
// Only prevent unload on the first window close
|
||||
var unloadPrevented = false;
|
||||
window.onbeforeunload = function() {
|
||||
setTimeout(function() {
|
||||
require('electron').ipcRenderer.sendSync('onbeforeunload');
|
||||
}, 0);
|
||||
if (!unloadPrevented) {
|
||||
unloadPrevented = true;
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue