initial attempt to add custom headers URL

This commit is contained in:
buzz-lightsnack-2007 2024-04-23 12:20:20 +08:00
parent 83036e8ed2
commit b1206a3b51

View file

@ -10,13 +10,16 @@ export default class windowman {
}
// Prepare the window with its metadata.
constructor(OPTIONS = {}) {
function headers() {
constructor(OPTIONS) {
function headers(OPTIONS) {
let LOAD_STATE = true;
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")]
};
// 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) => {
try {
let resource = false;
@ -250,10 +253,9 @@ export default class windowman {
actions();
}
((OPTIONS != null && (typeof OPTIONS).includes(`obj`) && !Array.isArray(OPTIONS)) ? OPTIONS[`monitor`] : true) ? this.monitor() : null;
headers();
headers(((OPTIONS != null && typeof OPTIONS == `object`) ? OPTIONS[`headers`] : false)? OPTIONS[`headers`] : {});
appearance();
events();
}