rawrtc-terminal-demo icon indicating copy to clipboard operation
rawrtc-terminal-demo copied to clipboard

Maybe indexOf better than startsWith

Open lxlenovostar opened this issue 7 years ago • 1 comments

        parseWSURIOrParameters(text) {
            // Stop catching paste events
            paste.setAttribute('contenteditable', 'false');
            this.previousPasteEventHandler = paste.onpaste;
            paste.onpaste = (event) => {
                event.preventDefault();
            };

            // Remove current selections (or we'll get an error when selecting)
            window.getSelection().removeAllRanges();

            // Parse
            //if (text.startsWith('ws://')) {
            if (text.indexOf('ws://')) {
                // WebSocket URI
                paste.innerText = 'Connecting to WebSocket URI: ' + text;
                paste.classList.add('done');
                paste.classList.add('orange');
                this.startWS(text);

in app.js

Because maybe text(websocket URL) start is a space.

lxlenovostar avatar Feb 01 '18 06:02 lxlenovostar

Sure. Just make a pull request. :)

lgrahl avatar Feb 01 '18 10:02 lgrahl