Sure, a system call out would be nicest way to register a handler. 
Unfortunately, registering custom URI schemes seems to be completely different 
on every platform, as well as how they receive an activation event. OS X uses a 
plist, Windows a registry entry, for Linux depends on the distro. So I went for 
a minimal solution. But it should be doable to provide a platform-aware package 
that takes case of the installation.

> On 12 Oct 2017, at 09:34, Norbert Hartl <norb...@hartl.name> wrote:
> 
> Ok, I see. Building a native app and interfacing it from pharo is the most 
> reliable version. I was just thinking that having a system call out it might 
> be easier to make it cross-platform. I would be interested to have that 
> available for all platforms.
> 
> Norbert
> 
> Am 12.10.2017 um 09:20 schrieb Manuel Leuenberger <leuenber...@inf.unibe.ch 
> <mailto:leuenber...@inf.unibe.ch>>:
> 
>> That's what I did. Only I used a native Objective-C app, as it provides a 
>> simple API to register to the events and will even be started if it's not 
>> running yet.
>> 
>> Am 12.10.2017 08:50 schrieb Norbert Hartl <norb...@hartl.name 
>> <mailto:norb...@hartl.name>>:
>> I think all you need is to do a system call out to the OS in order to 
>> register your scheme. For Mac OS it would be sonething like
>> 
>> 
>> https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x
>>  
>> <https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x>
>> 
>> And then you can see if it is what you want. Custom handlers associate a url 
>> scheme to an application binary. I‘m not sure you can use an image with it. 
>> So I would register a shell script and handle the adoption in the script.
>> 
>> Does that help?
>> 
>> Norbert
>> 
>> Am 10.10.2017 um 21:06 schrieb Manuel Leuenberger <leuenber...@inf.unibe.ch 
>> <mailto:leuenber...@inf.unibe.ch>>:
>> 
>> Hi,
>> 
>> Is there any support from the VM/Application package to add custom URI 
>> schemes to listen to from within Pharo? I would like to have a hyperlink 
>> like ‘pharo://send?data=fancypants’ in an arbitrary document that, when 
>> clicked, switches to Pharo and calls a hook I can register. Could someone 
>> give me a hint how to achieve that, or do I have to build a little bridge 
>> application that handles the scheme registration and talks with Pharo 
>> through another channel? Currently, I only need this for OS X.
>> 
>> Cheers,
>> Manuel
>>  
>> 

Reply via email to