diff options
author | Tobias Speicher <rootcommander@gmail.com> | 2022-03-24 17:31:53 +0300 |
---|---|---|
committer | Tobias Speicher <rootcommander@gmail.com> | 2022-03-24 23:53:23 +0300 |
commit | 68b340fe2319ca5519b9a6314e6c91f090c08fa1 (patch) | |
tree | 8cba9b0401101716d06c53cac2d06d96430808a9 /docs | |
parent | ae62e05fdde9e734ee03c8763190dd96fc3531bb (diff) |
Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Talkbuchet.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/Talkbuchet.js b/docs/Talkbuchet.js index ba5017eb8..513b71c94 100644 --- a/docs/Talkbuchet.js +++ b/docs/Talkbuchet.js @@ -242,13 +242,13 @@ class Signaling extends EventTarget { } sanitizeSignalingUrl(url) { - if (url.indexOf('https://') === 0) { - url = 'wss://' + url.substr(8) - } else if (url.indexOf('http://') === 0) { - url = 'ws://' + url.substr(7) + if (url.startsWith('https://')) { + url = 'wss://' + url.slice(8) + } else if (url.startsWith('http://')) { + url = 'ws://' + url.slice(7) } - if (url[url.length - 1] === '/') { - url = url.substr(0, url.length - 1) + if (url.endsWith('/')) { + url = url.slice(0, -1) } return url + '/spreed' |