made devtools startup timeout configurable...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-09-18 03:52:22 +03:00
parent 0c85d026fa
commit 4a8539bfce
2 changed files with 26 additions and 2 deletions

View File

@ -32,6 +32,18 @@
<script>
if(window.require){
Object.defineProperty(window, 'STARTUP_DEVTOOLS_TIMEOUT', {
get: function(){
return parseInt(localStorage.STARTUP_DEVTOOLS_TIMEOUT || 5000) },
set: function(value){
if(value == null){
delete localStorage.STARTUP_DEVTOOLS_TIMEOUT
return
}
value = parseInt(value)
;(value || value == 0)
&& (localStorage.STARTUP_DEVTOOLS_TIMEOUT = value) }, })
window.__devtools_failsafe = setTimeout(function(){
// nw...
if(window.nw){
@ -43,7 +55,7 @@ if(window.require){
require('electron').remote.getCurrentWindow().openDevTools()
} catch(err){ }
}
}, 5000)
}, STARTUP_DEVTOOLS_TIMEOUT)
}
</script>

View File

@ -34,6 +34,18 @@
<script>
if(window.require){
Object.defineProperty(window, 'STARTUP_DEVTOOLS_TIMEOUT', {
get: function(){
return parseInt(localStorage.STARTUP_DEVTOOLS_TIMEOUT || 5000) },
set: function(value){
if(value == null){
delete localStorage.STARTUP_DEVTOOLS_TIMEOUT
return
}
value = parseInt(value)
;(value || value == 0)
&& (localStorage.STARTUP_DEVTOOLS_TIMEOUT = value) }, })
window.__devtools_failsafe = setTimeout(function(){
// nw...
if(window.nw){
@ -45,7 +57,7 @@ if(window.require){
require('electron').remote.getCurrentWindow().openDevTools()
} catch(err){ }
}
}, 5000)
}, STARTUP_DEVTOOLS_TIMEOUT)
}
</script>