CI / Build & Test (push) Successful in 2m44s
- Change readyTimeoutMs default from 0 to 30000 in both state files - Register Alt+Shift+H keyboard shortcut via manifest _execute_action command - Add severity filter buttons (All/Info/Warn/Error) and Download .txt to Logs page; background logs.js now tags entries with proper level field - Fire browser notifications on tunnelError events (notifyOnTunnelError setting) - Add exponential-backoff auto-reconnect for virtual hosts and service tunnels (tunnelAutoReconnect setting, 5s–120s backoff) - Add backupIntervalHours setting and scheduled auto-backup timer in message-router.js - Add TCP connect latency badges to Virtual Hosts and Service Tunnels tables via new pingTunnel native message - Add bytesIn/bytesOut/requests counters to https-proxy.js; expose in Overview status bar via getState - Add Export/Import connection configs (JSON, no CA key) in Settings - Add autoReconnect flag and exponential-backoff reconnect to SSH connection cards - Add light theme CSS variables and theme toggle in Settings (persisted to localStorage) - Add checkbox column and bulk Stop/Remove actions to Virtual Hosts, Service Tunnels, and Servers tables - Add Peer Lookup UI card on Overview page using existing lookup message handler
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
// Extension-level state shared across background modules.
|
|
|
|
const DEFAULT_PROXY_PORT = 8443;
|
|
/** CONNECT proxy port (browser must send CONNECT here, not to HTTPS port). Use when host omits connectProxyPort. */
|
|
const DEFAULT_CONNECT_PROXY_PORT = 8442;
|
|
|
|
// Track which swarmIds belong to which tab: tabId -> Set<swarmId>
|
|
const tabSwarms = new Map();
|
|
// Track how many tabs are using each swarm: swarmId -> count
|
|
const swarmRefCount = new Map();
|
|
|
|
// Track active connections from native host: connId -> { swarmId, peerKey, createdAt }
|
|
const activeConnections = new Map();
|
|
|
|
let notifyOnDisconnect = false;
|
|
let notifyOnTunnelError = true;
|
|
|
|
// True once proxy.settings.get confirms mode=pac_script controlled_by_this_extension
|
|
let pacConfirmedActive = false;
|
|
|
|
const extensionState = {
|
|
hostConnected: false,
|
|
proxyPort: 8443,
|
|
connectProxyPort: null, // PAC uses this when set (CONNECT proxy); else proxyPort
|
|
servers: [], // Holesail server tunnels
|
|
virtualHosts: [], // virtual hostname -> hsUrl mappings
|
|
stats: {
|
|
totalConnections: 0,
|
|
uptime: Date.now()
|
|
}
|
|
};
|
|
|
|
function updateExtensionState() {
|
|
extensionState.hostConnected = !!port;
|
|
extensionState.stats.totalConnections = activeConnections.size;
|
|
}
|