From 2d5840f40d2594c83f020ccc447c90b34ab4e7ba Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Jun 2017 22:35:45 +0530 Subject: [PATCH] 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 --- src/pyj/autoreload.pyj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pyj/autoreload.pyj b/src/pyj/autoreload.pyj index 624888ddac..6a16231d7c 100644 --- a/src/pyj/autoreload.pyj +++ b/src/pyj/autoreload.pyj @@ -16,7 +16,13 @@ class Watcher: self.reconnect() 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.retries = 0