solve public functions by Claude.ai

This commit is contained in:
qcrao
2024-07-11 22:56:37 +08:00
parent 3feea445c1
commit cf722d23a7
3 changed files with 16 additions and 0 deletions

14
utils.js Normal file
View File

@@ -0,0 +1,14 @@
function getUserInfo() {
return new Promise((resolve) => {
chrome.identity.getProfileUserInfo({ accountStatus: "ANY" }, (userInfo) => {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError);
resolve(null);
} else {
resolve(userInfo);
}
});
});
}
window.getUserInfo = getUserInfo;