Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe indexOf better than startsWith #13

Open
lxlenovostar opened this issue Feb 1, 2018 · 1 comment
Open

Maybe indexOf better than startsWith #13

lxlenovostar opened this issue Feb 1, 2018 · 1 comment

Comments

@lxlenovostar
Copy link

        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.

@lgrahl
Copy link
Member

lgrahl commented Feb 1, 2018

Sure. Just make a pull request. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants