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

View File

@@ -21,6 +21,7 @@
"matches": ["*://chat.openai.com/*"],
"js": [
"globals.js",
"utils.js",
"addCheckboxes.js",
"bulkDeleteConversations.js",
"bulkArchiveConversations.js"

View File

@@ -64,5 +64,6 @@
</div>
<script src="popup.js"></script>
<script src="utils.js"></script>
</body>
</html>

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;