Copy updates from branch 'development' into development-storage
This commit is contained in:
		
						commit
						d54f6b4081
					
				
					 4 changed files with 14 additions and 18 deletions
				
			
		
							
								
								
									
										2
									
								
								scripts/external/watch.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								scripts/external/watch.js
									
										
									
									
										vendored
									
									
								
							|  | @ -34,7 +34,7 @@ let main = (async () => { | |||
| 			 | ||||
| 			 | ||||
| 			// Begin only when the page is fully loaded. 
 | ||||
| 			window.addEventListener(`load`, (event) => { | ||||
| 			window.addEventListener(`DOMContentLoaded`, (event) => { | ||||
| 				// Begin processing. 
 | ||||
| 				let PROC = new processor(matches); | ||||
| 				 | ||||
|  |  | |||
|  | @ -70,9 +70,6 @@ export default class logging { | |||
| 	@param {boolean} critical the critical nature | ||||
| 	*/ | ||||
| 	static async error(ERROR_CODE, ERROR_MESSAGE, ERROR_STACK, critical = true) { | ||||
| 		// Import the templating.
 | ||||
| 		const texts = (await import(chrome.runtime.getURL("/scripts/strings/read.js"))).default; | ||||
| 
 | ||||
| 		// Display the error message.
 | ||||
| 		console.error(texts.localized(`error_msg`, false, [ERROR_CODE, ERROR_MESSAGE, ERROR_STACK])); | ||||
| 		if (critical) { | ||||
|  |  | |||
|  | @ -2,6 +2,10 @@ | |||
| 	This script provides network utilities. | ||||
| */ | ||||
| 
 | ||||
| import texts from "/scripts/strings/read.js"; | ||||
| import logging from "/scripts/logging.js"; | ||||
| 
 | ||||
| export default class net { | ||||
| 	/* | ||||
| 	Download a file from the network or locally. | ||||
| 	 | ||||
|  | @ -11,12 +15,7 @@ Download a file from the network or locally. | |||
| 	@param {boolean} STRICT strictly follow the file type provided | ||||
| 	@returns {Promise} the downloaded file | ||||
| 	*/ | ||||
| export default class net { | ||||
| 	static async download(URL, TYPE, VERIFY_ONLY = false, STRICT = false) { | ||||
| 		const texts = (await import(chrome.runtime.getURL(`/scripts/strings/read.js`))) | ||||
| 			.default; | ||||
| 		const logging = (await import(chrome.runtime.getURL(`/scripts/logging.js`))).default; | ||||
| 	 | ||||
| 		let CONNECT, DATA;  | ||||
| 	 | ||||
| 		try { | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ export default class product { | |||
| 		/* Remove uneeded data or formatting from the URL and the data. */ | ||||
| 		let clean = (URL) => { | ||||
| 			// Remove the protocol from the URL. 
 | ||||
| 			return(URL.replace(/(^\w+:|^)\/\//, ``).split(`?`)); | ||||
| 			return((URL.replace(/(^\w+:|^)\/\//, ``).split(`?`))[0]); | ||||
| 		} | ||||
| 
 | ||||
| 		// Set this product's details as part of the object's properties. 
 | ||||
|  | @ -67,7 +67,7 @@ export default class product { | |||
| 		if (!this.#snip) {throw new ReferenceError((new texts(`error_msg_notattached`)).localized)}; | ||||
| 
 | ||||
| 		// Save the data to the storage.
 | ||||
| 		secretariat.write([`sites`, this.URL, `data`], this.#snip, 1); | ||||
| 		await secretariat.write([`sites`, this.URL, `data`], this.#snip, 1); | ||||
| 
 | ||||
| 		// Write the analysis data to the storage. 
 | ||||
| 		(this[`analysis`]) ? secretariat.write([`sites`, this.URL, `analysis`], this.analysis, 1): false; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue