generic x-scheme-handler required

Asked by Ralph Schmieder

Working with telnet:// and ssh:// handlers requires support in xdg-open to support these. Chrome by default uses xdg-open to open these URIs and with Trusty these are not supported. Here's a patch that works for (it might not be generic enough, though). Also wondering if the scheme RE can actually contain a + as in here ^[a-zA-Z+\.\-]+: or if this would be a better RE ^[a-zA-Z\.\-]+://

Might be that this has to be fixed upstream...

Thanks,
-ralph

*** /usr/bin/xdg-open.original 2015-10-05 16:43:25.622169319 +0200
--- /usr/bin/xdg-open 2015-10-05 17:44:28.590111802 +0200
***************
*** 384,390 ****

  open_generic_xdg_mime()
  {
! filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"`
      default=`xdg-mime query default "$filetype"`
      if [ -n "$default" ] ; then
          xdg_user_dir="$XDG_DATA_HOME"
--- 384,394 ----

  open_generic_xdg_mime()
  {
! if [ -z $2 ]; then
! filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"`
! else
! filetype=$2
! fi
      default=`xdg-mime query default "$filetype"`
      if [ -n "$default" ] ; then
          xdg_user_dir="$XDG_DATA_HOME"
***************
*** 406,411 ****
--- 410,417 ----
                  fi
              fi
          done
+ else
+ exit_failure_operation_impossible "no handler for filetype $filetype defined!"
      fi
  }

***************
*** 444,449 ****
--- 450,461 ----
                  exit_success
              fi
          fi
+ elif (echo "$1" | egrep -q '^[a-zA-Z\.\-]+://'); then
+ local handler=$(echo "$1" | sed -re 's#^([a-zA-Z\.\-]+)://.*#\1#')
+ open_generic_xdg_mime "$1" "x-scheme-handler/"$handler
+ if [ $? -eq 0 ]; then
+ exit_success
+ fi
      fi

      OLDIFS="$IFS"

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu xdg-utils Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Ralph Schmieder (ralph-schmieder) said :
#2

any thoughts or comments on this? Maybe I should have mentioned that this is only relevant for the LX desktop as XFCE and Gnome / Unity environments are using specific commands. The vanilla xdg-open has specific cases for those desktop environment. LXUbuntu, however, falls back to open_generic_xdg_mime which is not able to handle ssh:// and telnet:// URIs and hence the patch above.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.