mirror of
https://github.com/jackwener/OpenCLI.git
synced 2026-09-14 18:25:42 +08:00
4812486482
- Add popup.html/popup.js showing daemon connection status (Connected / Reconnecting / No daemon connected) - Add message listener in background.ts to expose WebSocket state - Add PRIVACY.md with full privacy policy covering all permissions - Add content_security_policy to manifest.json - Update description to be clearer for CWS reviewers
21 lines
757 B
JavaScript
21 lines
757 B
JavaScript
// Query connection status from background service worker
|
|
chrome.runtime.sendMessage({ type: 'getStatus' }, (resp) => {
|
|
const dot = document.getElementById('dot');
|
|
const status = document.getElementById('status');
|
|
if (chrome.runtime.lastError || !resp) {
|
|
dot.className = 'dot disconnected';
|
|
status.innerHTML = '<strong>No daemon connected</strong>';
|
|
return;
|
|
}
|
|
if (resp.connected) {
|
|
dot.className = 'dot connected';
|
|
status.innerHTML = '<strong>Connected to daemon</strong>';
|
|
} else if (resp.reconnecting) {
|
|
dot.className = 'dot connecting';
|
|
status.innerHTML = '<strong>Reconnecting...</strong>';
|
|
} else {
|
|
dot.className = 'dot disconnected';
|
|
status.innerHTML = '<strong>No daemon connected</strong>';
|
|
}
|
|
});
|