move getUserInfo define to util.js

This commit is contained in:
qcrao
2024-07-25 14:47:47 +08:00
parent 3887788b9d
commit 88eab68058
3 changed files with 15 additions and 30 deletions

View File

@@ -14,21 +14,6 @@ if (typeof window.globalsLoaded === "undefined") {
const CHECKBOX_CLASS = "conversation-checkbox";
// 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.Selectors = Selectors;
window.shiftPressed = false;