provide tracking for the window

Might be useful when opening a built-in page.
This commit is contained in:
buzz-lightsnack-2007 2024-04-22 16:43:20 +08:00
parent 12f9562aa6
commit eaaeba79b1

View file

@ -10,7 +10,7 @@ export default class windowman {
} }
// Prepare the window with its metadata. // Prepare the window with its metadata.
constructor() { constructor(OPTIONS = {}) {
function headers() { function headers() {
let LOAD_STATE = true; let LOAD_STATE = true;
let UI = { let UI = {
@ -244,11 +244,21 @@ export default class windowman {
actions(); actions();
} }
((OPTIONS != null && (typeof OPTIONS).includes(`obj`) && !Array.isArray(OPTIONS)) ? OPTIONS[`monitor`] : true) ? this.monitor() : null;
headers(); headers();
appearance(); appearance();
events(); 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. */ /* Run this function if you would like to synchronize with data. */
async sync() { async sync() {
// Import the module. // Import the module.