ueokande/vim-vixen

Opening localhost:port URLs is broken

ajakk opened this issue · 2 comments

ajakk commented

I'm opening this issue because:

  • I'll report a bug
  • I'll propose a new feature

Failure Information (for bugs)

Opening localhost:1234 via the vim-vixen command line results in a red error line that says URL constructor: . is not a valid URL.. For me, it breaks out of the prompt when the colon is typed and displays the error line.

Steps to Reproduce

Try to run the command :tabopen localhost:1234.

System configuration

  • Operating system:
    Gentoo Linux
  • Firefox version:
    87.0
  • Vim-Vixen version:
    1.0.1

Console logs

Any relevant log in developer tools:

This is spit into the console at the breakage:

Uncaught (in promise) TypeError: items.map is not a function
    getOpenCompletions console.ts:175
    updateCompletions Console.tsx:214
    onChange Console.tsx:125
    React 11
    unstable_runWithPriority scheduler.production.min.js:18
    React 3

Hi @ajakk,

this looks like it is related to #106: opening what looks like illegal URLs will fail. Here, localhost:1234 looks just like about:config and others, resulting in an error.

A simple workaround exists for your case however: if you include the protocol in the URL, it will work. Moreover, after doing :tabopen http://localhost:1234, the address will appear in the smart completion list so you'll never have to type the http part again.

Hope this helps.

ajakk commented

Looks like the same issue! Seems I didn't search the previous issues well enough, sorry! We can close this issue as a duplicate in favor of that one. Thank you!