Re: general uri handler
Dennis New <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 5 Jul 2014 12:27:54 +0200, Johannes Hofmann wrote:
> On Sat, Jun 28, 2014 at 07:58:20AM -0400, Dennis New wrote:
> > How are you guys handling non-builtin uris, like ed2k:, mailto:,
> > magnet:, etc? I hacked a general purpose handler (that calls a shell
> > script) from dpi/hello.c, but surely something this useful should
> > ship with dillo?
> >
> > It seems that this has been a popular request for a long time :P...
> >
> > http://lists.dillo.org/pipermail/dillo-dev/2004-October/002403.html
>
> I mostly use "Copy link location" from the popup menu.
> Can you make the source of your general purpose handler availble
> somewhere?
It was a tiny hack of dpi/hello.c, I also got rid of the dialog box
and changed the html output a bit, and didn't bother doing escape
character filtering...
+ Dstr *cmd_arg = dStr_new("");
if (cmd && url) {
- child_cmd = dStrdup("date -R");
+ dStr_sprintfa(cmd_arg, "dillo-urihandler \"%s\"", url);
+ child_cmd = dStrdup(cmd_arg->str);
MSG("[%s]\n", child_cmd);
To make compilation easier, I didn't bother renaming
"hello.filter.dpi". And I had to add an entry for each protocol that I
wanted to handle in dpidrc...
+proto.magnet=bla/hello.filter.dpi
+proto.mailto=bla/hello.filter.dpi