opt user experience

This commit is contained in:
qcrao
2023-11-17 17:30:00 +08:00
parent fb20c480d4
commit 25096861d6
4 changed files with 22 additions and 47 deletions

View File

@@ -2,18 +2,7 @@ console.log('globals.js loaded');
let lastChecked = null;
const standardSelectors = {
// 标准用户的选择器
conversationsCheckbox: '.conversation-checkbox:checked',
deleteButton: 'nav div a>div>button:nth-child(2)',
confirmDeleteButton: 'button.btn.btn-danger',
threeDotButton: '[id^="radix-"]',
// 其他标准用户选择器...
CONVERSATION_SELECTOR: 'div div span div ol li>a.flex',
TITLE_SELECTOR: '.flex-1.text-ellipsis.max-h-5.overflow-hidden.break-all.relative',
};
const plusSelectors = {
let Selectors = {
// Plus 用户的选择器
conversationsCheckbox: '.conversation-checkbox:checked',
deleteButton: '[class*="text-red"]',
@@ -24,16 +13,4 @@ const plusSelectors = {
TITLE_SELECTOR: '.relative.grow.overflow-hidden.whitespace-nowrap',
};
const CHECKBOX_CLASS = 'conversation-checkbox';
function isPlusUser() {
const spans = document.querySelectorAll('span.text-sm');
return Array.from(spans).some(span => span.textContent.trim() === "Explore");
}
function getSelectors() {
return isPlusUser() ? plusSelectors : plusSelectors;
}
// 暴露 getSelectors 函数到全局作用域
window.getSelectors = getSelectors;
let CHECKBOX_CLASS = 'conversation-checkbox';