Firefox not allowing connection to autoreload websocket when using a self-signed SSL certificate

Instead of displaying an unhandled error, just log it to console
This commit is contained in:
Kovid Goyal 2017-06-22 22:35:45 +05:30
parent 98b235e8e7
commit 2d5840f40d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -16,7 +16,13 @@ class Watcher:
self.reconnect() self.reconnect()
def reconnect(self): def reconnect(self):
self.ws = WebSocket(self.url) try:
self.ws = WebSocket(self.url)
except DOMException as e:
if e.name == 'SecurityError':
console.log('Not allowed to connect to auto-reload watcher, probably because using a self-signed, or otherwise invalid SSL certificate')
return
raise
self.ws.onopen = def(event): self.ws.onopen = def(event):
self.retries = 0 self.retries = 0