Bug 74804

Summary: xdg-open fails to open file:// URLs with URL fragments
Product: Portland Reporter: Alain Kalker <a.c.kalker>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium CC: a.c.kalker
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Alain Kalker 2014-02-10 17:57:21 UTC
OS: Arch Linux
WM: i3
xdg-utils @ 6da906f

Trying to open a file:// URL containing an URL fragment gives an error:

$ ls $(pwd)/*.html
/home/miki/index.html
$ XDG_UTILS_DEBUG_LEVEL=3 xdg-open "file://$(pwd)/index.html#anchor"
Selected DE generic
xdg-open: file '/home/miki/index.html#anchor' does not exist

A real-world example of this problem is Dropbox, where choosing "Launch Dropbox Website" from the menu leads to a similar error.

Even setting the default handler for file:// URLS doesn't solve the problem:

$ xdg-mime default chromium.desktop x-scheme-handler/file
$ xdg-mime query default x-scheme-handler/file
chromium.desktop
$ XDG_UTILS_DEBUG_LEVEL=3 xdg-open "file://$(pwd)/index.html#anchor"
Selected DE generic
xdg-open: file '/home/miki/index.html#anchor' does not exist

The browser handles these URLs without problems:
$ chromium "file://$(pwd)/index.html#anchor"
(browse away)

Specifying URL fragments (f.i. as 'anchors') is a very useful feature which xdg-open should not interfere with, IMHO.
In particular, when user sets a default handler for file:// URLs, xdg-open should honor that.
Comment 1 Rex Dieter 2014-02-10 18:02:02 UTC

*** This bug has been marked as a duplicate of bug 50715 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.