add delete conversations monitor
This commit is contained in:
21
background.js
Normal file
21
background.js
Normal 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");
|
||||
Reference in New Issue
Block a user