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

21
background.js Normal file
View File

@@ -0,0 +1,21 @@
console.log("Background script loaded");
chrome.runtime.onInstalled.addListener(() => {
console.log("Extension installed");
});
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === "getUserInfo") {
chrome.identity.getProfileUserInfo({ accountStatus: "ANY" }, (userInfo) => {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError);
sendResponse({ error: chrome.runtime.lastError.message });
} else {
sendResponse({ userInfo: userInfo });
}
});
return true; // Will respond asynchronously
}
});
console.log("Background script setup complete");