initial attempt to add custom headers URL
This commit is contained in:
		
							parent
							
								
									83036e8ed2
								
							
						
					
					
						commit
						b1206a3b51
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		|  | @ -10,13 +10,16 @@ export default class windowman { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Prepare the window with its metadata.
 | 	// Prepare the window with its metadata.
 | ||||||
| 	constructor(OPTIONS = {}) { | 	constructor(OPTIONS) { | ||||||
| 		function headers() { | 		function headers(OPTIONS) { | ||||||
| 			let LOAD_STATE = true; | 			let LOAD_STATE = true; | ||||||
| 			let UI = { | 			let UI = { | ||||||
| 				CSS: [chrome.runtime.getURL("/styles/external/fonts/materialdesignicons.min.css"), chrome.runtime.getURL("/styles/external/materialize/css/materialize.css"), chrome.runtime.getURL("/styles/ui.css")] | 				CSS: [chrome.runtime.getURL("/styles/external/fonts/materialdesignicons.min.css"), chrome.runtime.getURL("/styles/external/materialize/css/materialize.css"), chrome.runtime.getURL("/styles/ui.css")] | ||||||
| 			}; | 			}; | ||||||
| 
 | 
 | ||||||
|  | 			// Add additional sources. 
 | ||||||
|  | 			(OPTIONS[`CSS`] != null) ? ((Array.isArray(OPTIONS[`CSS`])) ? UI[`CSS`] = UI[`CSS`].concat(OPTIONS[`CSS`]) : UI[`CSS`].push(OPTIONS[`CSS`])) : null; | ||||||
|  | 
 | ||||||
| 			(UI[`CSS`]).forEach(async (source) => { | 			(UI[`CSS`]).forEach(async (source) => { | ||||||
| 				try { | 				try { | ||||||
| 					let resource = false; | 					let resource = false; | ||||||
|  | @ -252,8 +255,7 @@ export default class windowman { | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 		((OPTIONS != null && (typeof OPTIONS).includes(`obj`) && !Array.isArray(OPTIONS)) ? OPTIONS[`monitor`] : true) ? this.monitor() : null; | 		((OPTIONS != null && (typeof OPTIONS).includes(`obj`) && !Array.isArray(OPTIONS)) ? OPTIONS[`monitor`] : true) ? this.monitor() : null; | ||||||
| 
 | 		headers(((OPTIONS != null && typeof OPTIONS == `object`) ? OPTIONS[`headers`] : false)? OPTIONS[`headers`] : {}); | ||||||
| 		headers(); |  | ||||||
| 		appearance(); | 		appearance(); | ||||||
| 		events(); | 		events(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue