add delete conversations monitor
This commit is contained in:
50
globals.js
50
globals.js
@@ -1,24 +1,40 @@
|
||||
if (typeof window.globalsLoaded === 'undefined') {
|
||||
console.log('globals.js loaded');
|
||||
if (typeof window.globalsLoaded === "undefined") {
|
||||
console.log("globals.js loaded");
|
||||
|
||||
window.globalsLoaded = true;
|
||||
window.globalsLoaded = true;
|
||||
|
||||
const lastChecked = null;
|
||||
const lastChecked = null;
|
||||
|
||||
const Selectors = {
|
||||
conversationsCheckbox: '.conversation-checkbox:checked',
|
||||
confirmDeleteButton: 'button.btn.btn-danger',
|
||||
threeDotButton: '[id^="radix-"]',
|
||||
CONVERSATION_SELECTOR: 'div > div > div > div > div > div > nav > div > div > div > div > ol > li > div > a',
|
||||
TITLE_SELECTOR: '.relative.grow.overflow-hidden.whitespace-nowrap',
|
||||
};
|
||||
const Selectors = {
|
||||
conversationsCheckbox: ".conversation-checkbox:checked",
|
||||
confirmDeleteButton: "button.btn.btn-danger",
|
||||
threeDotButton: '[id^="radix-"]',
|
||||
CONVERSATION_SELECTOR:
|
||||
"div > div > div > div > div > div > nav > div > div > div > div > ol > li > div > a",
|
||||
TITLE_SELECTOR: ".relative.grow.overflow-hidden.whitespace-nowrap",
|
||||
};
|
||||
|
||||
const CHECKBOX_CLASS = 'conversation-checkbox';
|
||||
const CHECKBOX_CLASS = "conversation-checkbox";
|
||||
|
||||
// Expose variables to the global scope
|
||||
window.lastChecked = lastChecked;
|
||||
window.Selectors = Selectors;
|
||||
window.CHECKBOX_CLASS = CHECKBOX_CLASS;
|
||||
// Define getUserInfo function
|
||||
function getUserInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
chrome.runtime.sendMessage({ action: "getUserInfo" }, (response) => {
|
||||
if (chrome.runtime.lastError) {
|
||||
reject(chrome.runtime.lastError);
|
||||
} else if (response.error) {
|
||||
reject(new Error(response.error));
|
||||
} else {
|
||||
resolve(response.userInfo);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Expose variables to the global scope
|
||||
window.lastChecked = lastChecked;
|
||||
window.Selectors = Selectors;
|
||||
window.CHECKBOX_CLASS = CHECKBOX_CLASS;
|
||||
} else {
|
||||
console.log('globals.js already loaded, skipping re-initialization');
|
||||
console.log("globals.js already loaded, skipping re-initialization");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user