From 81a88be03ce57170be1d67bd954e3073a5e48117 2013-06-20 22:27:59 From: Paul Ivanov Date: 2013-06-20 22:27:59 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 --- 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 5fb20e6..ef7adb4 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;