We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cc94c0 commit 3d3c000Copy full SHA for 3d3c000
client/index.js
@@ -2,10 +2,13 @@ var url = require('url');
2
var SockJS = require("sockjs-client");
3
var stripAnsi = require('strip-ansi');
4
var scriptElements = document.getElementsByTagName("script");
5
+var scriptHost = scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, "");
6
7
+// If this bundle is inlined, use the resource query to get the correct url.
8
+// Else, get the url from the <script> this file was called with.
9
var urlParts = url.parse(typeof __resourceQuery === "string" && __resourceQuery ?
10
__resourceQuery.substr(1) :
- scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, "")
11
+ (scriptHost ? scriptHost : "/")
12
);
13
14
var sock = null;
0 commit comments