add delete conversations monitor

This commit is contained in:
qcrao
2024-07-11 13:26:08 +08:00
parent 96dd85edf5
commit 3feea445c1
5 changed files with 92 additions and 30 deletions

View File

@@ -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");
}