From b76f839a9b88fcb0d8af3c50600ffe3addb31fc0 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Thu, 20 Jun 2013 15:27:59 -0700 Subject: [PATCH] fix cell execution in firefox, closes #3447 location.origin is specific to WebKit only. The fix is to use a combination of location.protocol and location.host --- .../html/notebook/static/services/kernels/js/kernel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IPython/frontend/html/notebook/static/services/kernels/js/kernel.js b/IPython/frontend/html/notebook/static/services/kernels/js/kernel.js index 5fb20e605..ef7adb416 100644 --- a/IPython/frontend/html/notebook/static/services/kernels/js/kernel.js +++ b/IPython/frontend/html/notebook/static/services/kernels/js/kernel.js @@ -104,7 +104,9 @@ var IPython = (function (IPython) { this.kernel_id = json.kernel_id; var ws_url = json.ws_url; if (ws_url.match(/wss?:\/\//) == null) { - ws_url = "ws" + location.origin.substr(4) + ws_url; + // trailing 's' in https will become wss for secure web sockets + prot = location.protocol.replace('http', 'ws') + "//"; + ws_url = prot + location.host + ws_url; }; this.ws_url = ws_url; this.kernel_url = this.base_url + "/" + this.kernel_id;