Improve icon display
This commit is contained in:
		
							parent
							
								
									a723791d1b
								
							
						
					
					
						commit
						fa97743fc8
					
				
					 1 changed files with 41 additions and 41 deletions
				
			
		|  | @ -13,8 +13,12 @@ class IconIndicator { | ||||||
| 		BrowserIcon.enable();		 | 		BrowserIcon.enable();		 | ||||||
| 
 | 
 | ||||||
| 		// Enable icon changes if enabled within the settings. 
 | 		// Enable icon changes if enabled within the settings. 
 | ||||||
|  | 		(Tabs.query(null, 0)).then((TAB) => { | ||||||
|  | 			// Get the URL of the tab. 
 | ||||||
|  | 			const LOCATION = TAB.url; | ||||||
|  | 
 | ||||||
| 			global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => {(PREFERENCE) | 			global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => {(PREFERENCE) | ||||||
| 			? fetch(CONFIG).then((response) => response.json()).then((jsonData) => { | 				? fetch(CONFIG).then((response) => response.json()).then(async (jsonData) => { | ||||||
| 					const ICON_COLORS = jsonData; | 					const ICON_COLORS = jsonData; | ||||||
| 	 | 	 | ||||||
| 					/* | 					/* | ||||||
|  | @ -45,11 +49,6 @@ class IconIndicator { | ||||||
| 						}); | 						}); | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 				 |  | ||||||
| 				(Tabs.query(null, 0)).then(async (TAB) => { |  | ||||||
| 					// Get the URL of the tab. 
 |  | ||||||
| 					let LOCATION = TAB.url; |  | ||||||
| 		 |  | ||||||
| 					BrowserIcon.set({ | 					BrowserIcon.set({ | ||||||
| 							"BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol, | 							"BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol, | ||||||
| 							"BadgeBackgroundColor": ICON_COLORS[`loading`] | 							"BadgeBackgroundColor": ICON_COLORS[`loading`] | ||||||
|  | @ -58,12 +57,11 @@ class IconIndicator { | ||||||
| 					showDetails(LOCATION, TAB.id); | 					showDetails(LOCATION, TAB.id); | ||||||
| 					observe((changes) => { | 					observe((changes) => { | ||||||
| 						showDetails(LOCATION, TAB.id); | 						showDetails(LOCATION, TAB.id); | ||||||
| 					}) |  | ||||||
| 					}); | 					}); | ||||||
| 				}) | 				}) | ||||||
| 				: false; | 				: false; | ||||||
| 			}) | 			}) | ||||||
| 
 | 		}) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/*  | 	/*  | ||||||
|  | @ -75,10 +73,12 @@ class IconIndicator { | ||||||
| 		// Enable icon changes if enabled within the settings. 
 | 		// Enable icon changes if enabled within the settings. 
 | ||||||
| 		global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => { | 		global.read([`settings`, `general`, `showApplicable`]).then((PREFERENCE) => { | ||||||
| 			(Tabs.query(null, 0)).then(async (TAB) => { | 			(Tabs.query(null, 0)).then(async (TAB) => { | ||||||
| 				BrowserIcon.set({ | 				(PREFERENCE) | ||||||
|  | 				? BrowserIcon.set({ | ||||||
| 						"BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, | 						"BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol, | ||||||
| 						"BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);}) | 						"BadgeBackgroundColor": await fetch(CONFIG).then((response) => response.json()).then((jsonData) => {return (jsonData[`N/A`]);})}, | ||||||
| 					}, {"tabId": TAB.id}); | 					{"tabId": TAB.id}) | ||||||
|  | 				: false; | ||||||
| 			}) | 			}) | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue