You are not logged in.

#1 2019-07-02 08:12:09

sco
Member
Registered: 2017-02-07
Posts: 2

xdg-open handles ports in url wrong

Hi,
somehow I messed up my mime-sheme(?) for http(s) links.
If I try

xdg-open https://google.com:8080

it becomes

https://www.google.com/?line=8080&column=0

in the browser.

I think it happened after I switched from chormium to firefox as default browser but it did not change back after I switched back.

I checked the contents of

.local/share/mime

but to no avail.

Also the following looks okay to me?

> xdg-settings get default-url-scheme-handler http
firefox.desktop
> xdg-settings get default-url-scheme-handler https
firefox.desktop
> xdg-mime query default x-scheme-handler/http 
firefox.desktop
> xdg-mime query default x-scheme-handler/https 
firefox.desktop

Last edited by sco (2019-07-02 08:33:09)

Offline

#2 2019-07-04 15:55:18

outfrost
Member
From: sh: which: command not found
Registered: 2019-07-04
Posts: 2

Re: xdg-open handles ports in url wrong

Hi,

Same issue has started appearing for me just recently, without any changes to the default applications.

Interestingly,

xdg-open localhost:8080

opens

localhost?line=8080&column=0

in the browser.

However,

xdg-open localhost:8080/

opens the expected:

localhost:8080

Prepending http(s):// or not has no effect.

There doesn't seem to have been an update to xdg-open for quite a while, and yet this looks like a potential bug somewhere. After all, if xdg-open is going to process the supplied URI as a Web URL, it shouldn't consider numbers after a colon to be line/column numbers, should it?

Offline

#3 2019-07-05 14:33:38

ASRMarco13
Member
Registered: 2019-07-05
Posts: 3

Re: xdg-open handles ports in url wrong

Hello, i have the same problem. Any solution?

Offline

#4 2019-07-05 15:20:43

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: xdg-open handles ports in url wrong

You can try to run it with bash in trace mode to find the problem. It is probably a tool xdg-open relies on like "gvfs-open"

 bash -x /usr/bin/xdg-open localhost:8080

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2019-07-15 00:25:26

danielfm123
Member
Registered: 2019-07-15
Posts: 1

Re: xdg-open handles ports in url wrong

progandy wrote:

You can try to run it with bash in trace mode to find the problem. It is probably a tool xdg-open relies on like "gvfs-open"

 bash -x /usr/bin/xdg-open localhost:8080

still wont work...

Offline

#6 2019-07-24 13:06:05

outfrost
Member
From: sh: which: command not found
Registered: 2019-07-04
Posts: 2

Re: xdg-open handles ports in url wrong

Are any of you using Plasma 5 as well? I've looked at the code of xdg-open (it's a shell script), and determined that it uses kde-open5 in case of Plasma 5. Running

kde-open5 localhost:8080

produces the same erroneous result. Unfortunately, I do not know where to look in order to see whether that's an upstream bug.

Offline

#7 2019-07-24 13:25:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: xdg-open handles ports in url wrong

danielfm123 wrote:

still wont work...

That wasn't a suggestion of a fix, but a diagnostic step to gather information.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-07-24 15:10:52

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: xdg-open handles ports in url wrong

outfrost, thanks for the trace to kde. Here are the upstream and opensuse bug reports I found:

https://bugs.kde.org/show_bug.cgi?id=408632
https://bugzilla.opensuse.org/show_bug.cgi?id=1138956

This resolves the bug at least for urls starting with a scheme like http(s) or ftp. I have no idea if it will fix scheme-less urls.

Last edited by progandy (2019-07-24 15:15:52)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB