ui: add provideFeature/getFeature API

This commit is contained in:
undefined committed 2023-04-11 14:51:26 +08:00
1 parent e76e1c9beb
commit c482c5fef8
5 files changed
+34 -21

No files matched your search

@@ -4,9 +4,9 @@ export default class Sock {
sock: ReconnectingWebSocket;
interval: NodeJS.Timer;
constructor(public url: string) {
constructor(public url: string, nocookie = false) {
const i = new URL(url, window.location.href);
if (i.host !== window.location.host) i.searchParams.append('sid', document.cookie.split('sid=')[1].split(';')[0]);
if (i.host !== window.location.host && !nocookie) i.searchParams.append('sid', document.cookie.split('sid=')[1].split(';')[0]);
i.protocol = i.protocol.replace('http', 'ws');
this.url = i.toString();
this.sock = new ReconnectingWebSocket(this.url, [], {