import everything instead of being inside settings
Pretty sure every key is important!
This commit is contained in:
		
							parent
							
								
									5b06c3f967
								
							
						
					
					
						commit
						3930e06f2b
					
				
					 1 changed files with 45 additions and 49 deletions
				
			
		|  | @ -2,61 +2,57 @@ | ||||||
| This does not stand for "FamiCom" but instead on Finalization and Completion. This script provides installation run scripts. | This does not stand for "FamiCom" but instead on Finalization and Completion. This script provides installation run scripts. | ||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| import {read, write, init} from './secretariat.js'; | import { read, write, init } from "./secretariat.js"; | ||||||
| 
 | 
 | ||||||
| let config = chrome.runtime.getURL('config/config.json'); | let config = chrome.runtime.getURL("config/config.json"); | ||||||
| 
 | 
 | ||||||
| export default class fc { | export default class fc { | ||||||
|  |   /* Start the out of the box experience. */ | ||||||
|  |   static hello() { | ||||||
|  |     // the OOBE must be in the config.
 | ||||||
|  |     fetch(config) | ||||||
|  |       .then((response) => response.json()) | ||||||
|  |       .then((jsonData) => { | ||||||
|  |         let configuration = jsonData[`OOBE`]; | ||||||
| 
 | 
 | ||||||
| 	/* Start the out of the box experience. */ |         if (configuration) { | ||||||
| 	static hello() { |           configuration.forEach((item) => { | ||||||
|  |             chrome.tabs.create({ url: item }, function (tab) {}); | ||||||
|  |           }); | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |       .catch((error) => { | ||||||
|  |         console.error(error); | ||||||
|  |       }); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
| 		// the OOBE must be in the config.
 |   /* Initialize the configuration. */ | ||||||
| 		fetch(config) |   static setup() { | ||||||
| 			.then((response) => response.json()) |     // the OOBE must be in the config.
 | ||||||
| 			.then((jsonData) => { |     fetch(config) | ||||||
| 				let configuration = jsonData[`OOBE`]; |       .then((response) => response.json()) | ||||||
|  |       .then((jsonData) => { | ||||||
|  |         let configuration = jsonData; | ||||||
| 
 | 
 | ||||||
| 				if (configuration) { |         // Run the storage initialization.
 | ||||||
| 	 				configuration.forEach((item) => { |         init(configuration); | ||||||
| 						chrome.tabs.create({ url: item }, function(tab) {}); |       }) | ||||||
| 					}); |       .catch((error) => { | ||||||
| 				}; |         console.error(error); | ||||||
| 			}) |       }); | ||||||
| 			.catch((error) => { |   } | ||||||
| 					console.error(error); |  | ||||||
| 			}); |  | ||||||
| 	}; |  | ||||||
| 
 | 
 | ||||||
| 	/* Initialize the configuration. */ |   static trigger() { | ||||||
| 	static setup() { |     chrome.runtime.onInstalled.addListener(function (details) { | ||||||
|  |       if (details.reason == chrome.runtime.OnInstalledReason.INSTALL) { | ||||||
|  |         fc.hello(); | ||||||
|  |       } | ||||||
|  |       fc.setup(); | ||||||
|  |     }); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
| 		// the OOBE must be in the config.
 |   /* main function */ | ||||||
| 		fetch(config) |   static run() { | ||||||
| 			.then((response) => response.json()) |     fc.trigger(); | ||||||
| 			.then((jsonData) => { |   } | ||||||
| 				let configuration = jsonData[`settings`]; |  | ||||||
| 
 |  | ||||||
| 				// Run the storage initialization.
 |  | ||||||
| 				init(configuration); |  | ||||||
| 			}) |  | ||||||
| 			.catch((error) => { |  | ||||||
| 					console.error(error); |  | ||||||
| 			}); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	static trigger() { |  | ||||||
| 		chrome.runtime.onInstalled.addListener(function (details) { |  | ||||||
| 			if (details.reason == chrome.runtime.OnInstalledReason.INSTALL) { |  | ||||||
| 				fc.hello(); |  | ||||||
| 			}; |  | ||||||
| 			fc.setup(); |  | ||||||
| 		}); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	/* main function */ |  | ||||||
| 	static run() { |  | ||||||
| 
 |  | ||||||
| 		fc.trigger(); |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue