| 
									
										
										
										
											2018-12-19 07:44:51 +01:00
										 |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html> | 
					
						
							|  |  |  | <head> | 
					
						
							|  |  |  |   <meta charset="utf-8"> | 
					
						
							|  |  |  |   <title></title> | 
					
						
							|  |  |  |   <script> | 
					
						
							|  |  |  |     const { ipcRenderer } = require('electron') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function handleFocusChange(event) { | 
					
						
							|  |  |  |       if (event.target.tagName && event.target.tagName !== 'WEBVIEW') { | 
					
						
							|  |  |  |         const elementId = event.target.id ? `-${event.target.id}` : '' | 
					
						
							|  |  |  |         const elementIdentifier = `${event.target.tagName}${elementId}` | 
					
						
							|  |  |  |         ipcRenderer.send('focus-changed', elementIdentifier) | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     addEventListener('focus', handleFocusChange, true) | 
					
						
							|  |  |  |   </script> | 
					
						
							|  |  |  |   <body> | 
					
						
							|  |  |  |     <div> | 
					
						
							|  |  |  |       <button id="element-1">Button 1</button> | 
					
						
							|  |  |  |       <button id="element-2">Button 2</button> | 
					
						
							| 
									
										
										
										
											2021-03-01 13:52:29 -08:00
										 |  |  |       <webview src="tab-focus-loop-elements-wv.html" nodeintegration webpreferences="contextIsolation=no"></webview> | 
					
						
							| 
									
										
										
										
											2018-12-19 07:44:51 +01:00
										 |  |  |       <button id="element-3">Button 3</button> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   </body> | 
					
						
							|  |  |  | </html> |