(value)
| 23 | } |
| 24 | |
| 25 | function isValidWsUrl(value) { |
| 26 | try { |
| 27 | const url = new URL(value); |
| 28 | return url.protocol === "ws:" || url.protocol === "wss:"; |
| 29 | } catch (e) { |
| 30 | return false; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | function loadSettings() { |
| 35 | chrome.storage.local.get(DEFAULT_SETTINGS, (stored) => { |