60 lines
1.8 KiB
JavaScript
60 lines
1.8 KiB
JavaScript
// 安全popup脚本 - 移除验证功能版
|
|
(function() {
|
|
'use strict';
|
|
|
|
console.log('Popup模块已加载');
|
|
|
|
// 显示状态信息
|
|
function showStatus(message, isSuccess = true) {
|
|
const statusDiv = document.getElementById('activation-status');
|
|
if (!statusDiv) {
|
|
console.error('未找到状态元素');
|
|
return;
|
|
}
|
|
|
|
const icon = isSuccess ? '✅' : '❌';
|
|
statusDiv.innerHTML = `
|
|
<div class="status-icon">${icon}</div>
|
|
<div class="status-text">${message}</div>
|
|
`;
|
|
statusDiv.className = `status-card ${isSuccess ? 'activated' : 'not-activated'}`;
|
|
}
|
|
|
|
// 显示已激活信息
|
|
function showActivatedInfo() {
|
|
// 隐藏激活相关区域
|
|
const activationSection = document.getElementById('activation-section');
|
|
if (activationSection) activationSection.style.display = 'none';
|
|
|
|
// 显示已激活信息
|
|
const activatedInfo = document.getElementById('activated-info');
|
|
if (activatedInfo) {
|
|
activatedInfo.style.display = 'block';
|
|
|
|
// 更新信息显示
|
|
const statusSpan = document.getElementById('current-status');
|
|
const expirySpan = document.getElementById('expiry-date');
|
|
|
|
if (statusSpan) statusSpan.textContent = '已启用';
|
|
if (expirySpan) expirySpan.textContent = '无限制';
|
|
}
|
|
|
|
// 隐藏重新激活按钮
|
|
const reactivateBtn = document.getElementById('reactivate-btn');
|
|
if (reactivateBtn) reactivateBtn.style.display = 'none';
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
console.log('DOMContentLoaded事件触发');
|
|
|
|
try {
|
|
// 直接显示已激活状态
|
|
showStatus('功能已启用', true);
|
|
showActivatedInfo();
|
|
} catch (error) {
|
|
console.error('Popup初始化失败:', error);
|
|
showStatus('初始化失败', false);
|
|
}
|
|
});
|
|
|
|
})(); |