Merge pull request #123 from nonameShijian/master

fix game.exit
This commit is contained in:
Spmario233 2023-05-31 23:36:25 +08:00 committed by GitHub
commit 1da0825b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 11 deletions

View File

@ -32988,6 +32988,8 @@
}
},
exit:function(){
//安卓 / ios
if(lib.device) {
if(lib.device=='ios'){
game.saveConfig('mode');
if(_status){
@ -33004,6 +33006,26 @@
navigator.app.exitApp();
}
}
}
//electron
else if(typeof process=='function'){
var versions=window.process.versions;
var electronVersion=parseFloat(versions.electron);
var remote;
if(electronVersion>=14){
remote=require('@electron/remote');
}else{
remote=require('electron').remote;
}
var thisWindow=remote.getCurrentWindow();
thisWindow.destroy();
window.process.exit();
}
//网页版
else{
window.onbeforeunload = null;
window.close();
}
},
open:function(url){
if(lib.device){