created initial manager.js
Gemini created code on requesting additional webpage Not yet needed for now, but mighrt be good to have when switching to not allow website's usage
This commit is contained in:
		
							parent
							
								
									aa19d85417
								
							
						
					
					
						commit
						2c9a55d724
					
				
					 1 changed files with 23 additions and 0 deletions
				
			
		
							
								
								
									
										23
									
								
								scripts/manager.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								scripts/manager.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | ||||||
|  | /* manager.js  | ||||||
|  | Manage the running of the scripts.  | ||||||
|  | */ | ||||||
|  | 
 | ||||||
|  | /* ```js | ||||||
|  | chrome.runtime.onInstalled.addListener(function() { | ||||||
|  |   // Request permission for the website.
 | ||||||
|  |   chrome.permissions.request({ | ||||||
|  |     origins: ["https://example.com"] | ||||||
|  |   }, function(granted) { | ||||||
|  |     // If permission was granted, attach the content script to the website.
 | ||||||
|  |     if (granted) { | ||||||
|  |       chrome.tabs.executeScript({ | ||||||
|  |         code: 'console.log("Hello from the content script!");' | ||||||
|  |       }); | ||||||
|  |     } else { | ||||||
|  |       // Permission was not granted. Display an error message.
 | ||||||
|  |       console.error("Error: Permission not granted."); | ||||||
|  |     } | ||||||
|  |   }); | ||||||
|  | }); | ||||||
|  | ```*/
 | ||||||
|  | 
 | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue