accomodate PATH being set as a dictionary of options instead
This commit is contained in:
		
							parent
							
								
									891de959db
								
							
						
					
					
						commit
						9d5df38baa
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -11,16 +11,16 @@ export default class Sidebar { | |||
| 	*/ | ||||
| 	constructor (PATH) { | ||||
| 		// Set side panel's URL. 
 | ||||
| 		chrome.sidePanel.setOptions({ path: PATH }); | ||||
| 		chrome.sidePanel.setOptions(((typeof PATH).includes(`str`)) ? { path: PATH } : PATH); | ||||
| 		 | ||||
| 		// Grab the current tab ID. 
 | ||||
| 		Tabs.query({ active: true, currentWindow: true }, 0).then((TAB) => { | ||||
| 			chrome.sidePanel.open({windowId: TAB.id}); | ||||
| 			this.root = PATH; | ||||
| 			this.root = ((typeof PATH).includes(`str`)) ? PATH : chrome.sidePanel.getOptions(TAB.id).path; | ||||
| 		}); | ||||
| 
 | ||||
| 		chrome.runtime.onConnect.addListener((CONNECTION) => { | ||||
| 			if ((CONNECTION.name).includes(`view=${PATH}`)) { | ||||
| 			if ((CONNECTION.name).includes(`view=${this.root}`)) { | ||||
| 				this.focus(TRUE); | ||||
| 				CONNECTION.onDisconnect.addListener(async () => { | ||||
| 					this.focus(FALSE); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue