Add API to get any global variable from browser.
This commit is contained in:
		
					parent
					
						
							
								7a2734ed71
							
						
					
				
			
			
				commit
				
					
						a06c9b806b
					
				
			
		
					 2 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -103,3 +103,14 @@ exports.getObject = (id) ->
 | 
			
		|||
exports.getCurrentWindow = ->
 | 
			
		||||
  meta = ipc.sendChannelSync 'ATOM_BROWSER_CURRENT_WINDOW'
 | 
			
		||||
  metaToValue meta
 | 
			
		||||
 | 
			
		||||
# Get a global object in browser.
 | 
			
		||||
exports.getGlobal = (name) ->
 | 
			
		||||
  meta = ipc.sendChannelSync 'ATOM_BROWSER_GLOBAL', name
 | 
			
		||||
  metaToValue meta
 | 
			
		||||
 | 
			
		||||
# Get the process object in browser.
 | 
			
		||||
processCache = null
 | 
			
		||||
exports.__defineGetter__ 'process', ->
 | 
			
		||||
  processCache = exports.getGlobal('process') unless processCache?
 | 
			
		||||
  processCache
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue