Pārlūkot izejas kodu

fix target script src

master
Martin Dørum pirms 4 gadiem
vecāks
revīzija
b3d0b71e29
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. 10
    5
      web/target.js

+ 10
- 5
web/target.js Parādīt failu

@@ -1,11 +1,16 @@
(function() {

var id = document.currentScript.src.split("?")[1];
var state = "connecting"

var conn = new WebSocket(
location.protocol.replace("http", "ws") + "//" +
location.host);
var state = "connecting";

let wsurl = document.currentScript.src
.replace(/https?:\/\//, "")
.split("/")[0]
.replace("http", "ws");
let wsproto = document.currentScript.src
.split("://")[0]
.replace("http", "ws");
var conn = new WebSocket(wsproto + "://" + wsurl);

function toString(val) {
if (typeof val == "string" || typeof val == "function")

Notiek ielāde…
Atcelt
Saglabāt