diff --git a/scripts/GUI/windowman.js b/scripts/GUI/windowman.js index f3a5d56..171d89a 100644 --- a/scripts/GUI/windowman.js +++ b/scripts/GUI/windowman.js @@ -10,7 +10,7 @@ export default class windowman { } // Prepare the window with its metadata. - constructor() { + constructor(OPTIONS = {}) { function headers() { let LOAD_STATE = true; let UI = { @@ -244,11 +244,21 @@ export default class windowman { actions(); } + ((OPTIONS != null && (typeof OPTIONS).includes(`obj`) && !Array.isArray(OPTIONS)) ? OPTIONS[`monitor`] : true) ? this.monitor() : null; + headers(); appearance(); events(); } + /* Send monitoring events, useful to determining whether the window is opened or closed. + + @param {string} MESSAGE_NAME Custom message name + */ + monitor() { + chrome.runtime.connect({name: `view=${window.location.href}`}); + }; + /* Run this function if you would like to synchronize with data. */ async sync() { // Import the module.