()
| 10 | }; |
| 11 | |
| 12 | function getSettings() { |
| 13 | return new Promise((resolve) => { |
| 14 | chrome.storage.local.get(DEFAULT_SETTINGS, (stored) => { |
| 15 | resolve({ |
| 16 | serverUrl: (stored.serverUrl || DEFAULT_SETTINGS.serverUrl).trim(), |
| 17 | apiKey: (stored.apiKey || "").trim(), |
| 18 | routeKey: (stored.routeKey || "").trim(), |
| 19 | clientLabel: (stored.clientLabel || "").trim() |
| 20 | }); |
| 21 | }); |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | function closeSocket() { |
| 26 | if (heartbeatInterval) clearInterval(heartbeatInterval); |