mirror of
				https://github.com/open-webui/extension
				synced 2025-06-26 18:25:58 +00:00 
			
		
		
		
	refac
This commit is contained in:
		
							parent
							
								
									dbd79dab90
								
							
						
					
					
						commit
						344262154d
					
				| @ -1,7 +1,7 @@ | |||||||
| chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { | ||||||
|   console.log(request, sender); |   console.log(request, sender); | ||||||
|   const id = sender.tab.id; |   const id = sender.tab.id; | ||||||
|   if (request.method == "getSelection") { |   if (request.action == "getSelection") { | ||||||
|     chrome.scripting |     chrome.scripting | ||||||
|       .executeScript({ |       .executeScript({ | ||||||
|         target: { tabId: id, allFrames: true }, |         target: { tabId: id, allFrames: true }, | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								extension/dist/main.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extension/dist/main.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -16,7 +16,7 @@ export const SpotlightSearch = () => { | |||||||
|         setOpen((open) => !open); |         setOpen((open) => !open); | ||||||
| 
 | 
 | ||||||
|         const response = await chrome.runtime.sendMessage({ |         const response = await chrome.runtime.sendMessage({ | ||||||
|           method: "getSelection", |           action: "getSelection", | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         if (response?.data ?? false) { |         if (response?.data ?? false) { | ||||||
| @ -39,7 +39,7 @@ export const SpotlightSearch = () => { | |||||||
|       } |       } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     document.addEventListener("keydown", down); |     document.addEventListener("keydown", down, { capture: true }); | ||||||
|     return () => document.removeEventListener("keydown", down); |     return () => document.removeEventListener("keydown", down); | ||||||
|   }, []); |   }, []); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user