Merge branch 'development' into development-storage
This commit is contained in:
commit
79c1cc54f3
4 changed files with 20 additions and 8 deletions
14
scripts/GUI/inject.js
Normal file
14
scripts/GUI/inject.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
export default class injection {
|
||||||
|
constructor (parent, element, id, classes, options) {
|
||||||
|
let ELEMENTS = {};
|
||||||
|
|
||||||
|
ELEMENTS[`parents`] = ((typeof parent) != `object`) ? docuent.querySelectorAll(parent) : [...parent];
|
||||||
|
|
||||||
|
// must only run if there are elements to inject
|
||||||
|
if ((ELEMENTS[`parents`]).length > 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -4,9 +4,6 @@ Window and window content management */
|
||||||
import texts from "../strings/read.js";
|
import texts from "../strings/read.js";
|
||||||
import net from "../net.js";
|
import net from "../net.js";
|
||||||
|
|
||||||
// MAKE SURE TO TURN THIS OFF DURING BUILD.
|
|
||||||
let DEBUG = true;
|
|
||||||
|
|
||||||
export default class windowman {
|
export default class windowman {
|
||||||
static new(URL, height, width) {
|
static new(URL, height, width) {
|
||||||
this.window = chrome.windows.create({url: (URL.includes(`://`)) ? URL : chrome.runtime.getURL(URL), type: "popup", width: width ? parseInt(width) : 600, height: height ? parseInt(height) : 600});
|
this.window = chrome.windows.create({url: (URL.includes(`://`)) ? URL : chrome.runtime.getURL(URL), type: "popup", width: width ? parseInt(width) : 600, height: height ? parseInt(height) : 600});
|
||||||
|
@ -35,16 +32,17 @@ export default class windowman {
|
||||||
metadata_element.setAttribute(`href`, source);
|
metadata_element.setAttribute(`href`, source);
|
||||||
document.querySelector(`head`).appendChild(metadata_element);
|
document.querySelector(`head`).appendChild(metadata_element);
|
||||||
} else {
|
} else {
|
||||||
throw new ReferenceError(new texts(`error_msg_fileNotFound`, [UI.CSS[index]]));
|
throw new ReferenceError((new texts(`error_msg_fileNotFound`, [source])).localized);
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
const secretariat = (await import(chrome.runtime.getURL(`/scripts/secretariat.js`)));
|
||||||
const logging = (await import(chrome.runtime.getURL(`/scripts/logging.js`))).default;
|
const logging = (await import(chrome.runtime.getURL(`/scripts/logging.js`))).default;
|
||||||
|
|
||||||
// Raise an alert.
|
// Raise an alert.
|
||||||
logging.error(err.name, err.message, err.stack, true, [source]);
|
logging.error(err.name, err.message, err.stack, true, [source]);
|
||||||
|
|
||||||
// Stop loading the page when an error has occured; it's not going to work!
|
// Stop loading the page when an error has occured; it's not going to work!
|
||||||
if (!DEBUG) {
|
if ((await secretariat.read(`debug`, -1) != null) ? await secretariat.read(`debug`, -1) : true) {
|
||||||
window.close();
|
window.close();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
0
scripts/external/inject.js
vendored
0
scripts/external/inject.js
vendored
6
scripts/external/processor.js
vendored
6
scripts/external/processor.js
vendored
|
@ -2,9 +2,9 @@
|
||||||
Process the information on the website and display it on screen.
|
Process the information on the website and display it on screen.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// const inject = ((await import(chrome.runtime.getURL("scripts/external/inject.js"))).default);
|
import scraper from "/scripts/external/scraper.js";
|
||||||
const scraper = (await import(chrome.runtime.getURL("scripts/external/scraper.js"))).default;
|
import product from "/scripts/product.js";
|
||||||
const product = (await import(chrome.runtime.getURL("scripts/product.js"))).default;
|
import injection from "/scripts/GUI/inject.js"
|
||||||
|
|
||||||
export default class processor {
|
export default class processor {
|
||||||
#filter;
|
#filter;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue