mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	made devtools startup timeout configurable...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									0c85d026fa
								
							
						
					
					
						commit
						4a8539bfce
					
				| @ -32,6 +32,18 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| if(window.require){ | 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(){ | 	window.__devtools_failsafe = setTimeout(function(){ | ||||||
| 		// nw... | 		// nw... | ||||||
| 		if(window.nw){ | 		if(window.nw){ | ||||||
| @ -43,7 +55,7 @@ if(window.require){ | |||||||
| 				require('electron').remote.getCurrentWindow().openDevTools() | 				require('electron').remote.getCurrentWindow().openDevTools() | ||||||
| 			} catch(err){ } | 			} catch(err){ } | ||||||
| 		} | 		} | ||||||
| 	}, 5000) | 	}, STARTUP_DEVTOOLS_TIMEOUT) | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -34,6 +34,18 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| if(window.require){ | 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(){ | 	window.__devtools_failsafe = setTimeout(function(){ | ||||||
| 		// nw... | 		// nw... | ||||||
| 		if(window.nw){ | 		if(window.nw){ | ||||||
| @ -45,7 +57,7 @@ if(window.require){ | |||||||
| 				require('electron').remote.getCurrentWindow().openDevTools() | 				require('electron').remote.getCurrentWindow().openDevTools() | ||||||
| 			} catch(err){ } | 			} catch(err){ } | ||||||
| 		} | 		} | ||||||
| 	}, 5000) | 	}, STARTUP_DEVTOOLS_TIMEOUT) | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user