Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 16 Oct 2017, 20:25
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Suggestions
Improving xdg-open
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 3015
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Wed 29 Mar 2017, 10:59    Post subject:  Improving xdg-open  

Bonjour,
Running Dropbox (but this may be true for many other applications!) I was getting this error message when the menu entry of the system icon "Run the Dropbox web site" was clicked:
Quote:
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope"><env:Body xmlns:rox="http://rox.sourceforge.net/SOAP/ROX-Filer"><env:Fault xmlns:rpc="http://www.w3.org/2001/12/soap-rpc" xmlns:env="http://www.w3.org/2001/12/soap-envelope"><faultcode>Failed</faultcode><faultstring>/tmp/dbxlTZUtV3.html#ceab1215aa5e6c51dd211cb2051ddbeea0a7021f9438e0c8e786bfc5ffdb2949f59e737c45862b87a65332 not found</faultstring></env:Fault></env:Body></env:Envelope>

jamesbond found a solution to this issue while modifying/adding lines into Jemimah's xdg-open.
Choice A:
Code:
 #!/bin/bash
#this script created by Jemimah. see: http://murga-linux.com/puppy/viewtopic.php?t=63400&start=150
#110115 xdg-open used to be a symlink to defaulthandler.

case "$1" in
        '') exit
                ;;
        *://*) exec rox -U "${1%#*}"
                ;;
        *@*.*) exec rox -U "mailto:${1}"
                ;;
        *) exec rox "$1"
                ;;
esac


Choice B:
Code:
#!/bin/bash
#this script created by Jemimah. see: http://murga-linux.com/puppy/viewtopic.php?t=63400&start=150
#110115 xdg-open used to be a symlink to defaulthandler.

case "$1" in
        '') exit
                ;;
        *://*) exec $DEFAULTBROWSER "$1"
                ;;
        *@*.*) exec rox -U "mailto:${1}"
                ;;
        *) exec rox "$1"
                ;;
esac

NOTE: $DEFAULTBROWSER, or /usr/local/bin/defaultbrowser, or defaulthandler, etc, may be chosen, whichever works best for many puplets.

While I'm at it:
In the original Woof-CE Jemimah's script (https://github.com/puppylinux-woof-CE/woof-CE/blob/testing/woof-code/rootfs-skeleton/usr/local/bin/xdg-open) it seems there is an anomaly:
Quote:
#!/bin/sh
#this script created by Jemimah. see: http://murga-linux.com/puppy/viewtopic.php?t=63400&start=150
#110115 xdg-open used to be a symlink to defaulthandler.

#!/bin/bash

[...]


Cordialement.

_________________


Last edited by Argolance on Thu 30 Mar 2017, 03:11; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 10936
Location: Gatineau (Qc), Canada

PostPosted: Wed 29 Mar 2017, 14:07    Post subject:  

Bonjour, Argolance.

I am unclear about the type of feedback you wish to have on the above?

TIA. BFN.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 684

PostPosted: Wed 29 Mar 2017, 21:44    Post subject:  

I played with xdg-open once.
Here http://www.murga-linux.com/puppy/viewtopic.php?t=101776
It was just for opening .magnet files in transmission.

The xdg-open in puppy is simple, in fatdog it's slightly bigger, in Ubuntu it went all over my head (some 600 lines of scripting).

But I think you can take a look at Fatdog's script.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3055
Location: The Blue Marble

PostPosted: Thu 30 Mar 2017, 02:15    Post subject:  

While working together with Argolance to troubleshoot his dropbox app (see here: http://www.murga-linux.com/puppy/viewtopic.php?p=948095#948095), we found that dropbox use xdg-open to launch its URL; and Puppy version of xdg-open fails to open a URL with the pattern "file:///some/local/file.html#anchor" (note that "file:///some/local/file.html" works, but "file:///some/local/file.html#anchor").

We traced the problem to the fact that xdg-open uses Rox to do open the URL; and Rox does not support anchors, so xdg-open fails.

The solution posted above is to improve the situation and make xdg-open able to open a local file with anchors. It's basically either:
a) drop the anchor, before passing the URL, or
b) Use $DEFAULTBROWSER to handle URL, instead of Rox.

The xdg-open in Woof-CE is old, and perhaps its time to be revisited. Hence this suggestion.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 10936
Location: Gatineau (Qc), Canada

PostPosted: Thu 30 Mar 2017, 10:05    Post subject:  

Hello JamesBond, Argolance and all.

On my Puppy, < echo $DEFAULTBROWSER > refers to nothing useful
("exec", actually).

So I think I'll use < defaultbrowser > instead. I can, no?

The 2nd crunch-bang line < #!/bin/bash > is probably a leftover of
something else or an oversight, and can be safely removed.

IHTH. BFN.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 3015
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 31 Mar 2017, 04:26    Post subject:  

Bonjour,
Thank you jamesbond for giving precisions about the reason of this thread. You did it better than I ever could!
Sorry musher0, I was busy this week and in a hurry: I admit it was a little bit "short"! Wink
musher0 wrote:
On my Puppy, < echo $DEFAULTBROWSER > refers to nothing useful

Not sure, but I think this is automatically updated when any installed browser is set as default browser using defaults-chooser.
Quote:
So I think I'll use < defaultbrowser > instead. I can, no?

It is what I have done in the Arrow MyDbox script
Now, Dropbox is fully functional! Very Happy

Thanks drunkjedi for your note.

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Suggestions
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0633s ][ Queries: 14 (0.0076s) ][ GZIP on ]