| 
									
										
										
										
											2023-04-24 07:35:14 -07:00
										 |  |  | const { ipcRenderer, shell } = require('electron') | 
					
						
							| 
									
										
										
										
											2019-11-01 20:34:47 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | const appInfoBtn = document.getElementById('app-info') | 
					
						
							| 
									
										
										
										
											2023-04-24 07:35:14 -07:00
										 |  |  | const electronDocLink = document.querySelectorAll('a[href]') | 
					
						
							| 
									
										
										
										
											2019-11-01 20:34:47 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | appInfoBtn.addEventListener('click', () => { | 
					
						
							|  |  |  |   ipcRenderer.send('get-app-path') | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ipcRenderer.on('got-app-path', (event, path) => { | 
					
						
							|  |  |  |   const message = `This app is located at: ${path}` | 
					
						
							|  |  |  |   document.getElementById('got-app-info').innerHTML = message | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-24 07:35:14 -07:00
										 |  |  | electronDocLink.addEventListener('click', (e) => { | 
					
						
							| 
									
										
										
										
											2019-11-01 20:34:47 +05:30
										 |  |  |   e.preventDefault() | 
					
						
							| 
									
										
										
										
											2023-04-24 07:35:14 -07:00
										 |  |  |   const url = e.target.getAttribute('href') | 
					
						
							| 
									
										
										
										
											2019-11-01 20:34:47 +05:30
										 |  |  |   shell.openExternal(url) | 
					
						
							| 
									
										
										
										
											2023-04-05 06:42:20 -07:00
										 |  |  | }) |