Search code examples
macosbuttonkindleprotocol-handler

How to open an app from a browser?


Amazon has the button that opens an app as follows.

http://img836.imageshack.us/img836/6829/screenshot20100724at111.png

Clicking this button opens a 'Amazon Kindle', for my case, 'Amazon Kindle for Mac'.

How is this possible? I mean, how can I program to do this job? It's definitely not Flash.

I tried to use button to open an App using button provided by HTML, but I couldn't make it because of the security kind of reasons.

ADDED

This is the source code for it.

<tr><td><a href="kindle://home/?action=refresh"><img src="https://images-na.ssl-images- amazon.com/images/G/01/kindle/www/mazama/download/mac/go-to-kindle-for-mac-lg-pri._V192549350_.gif" border="0"></a></td></tr>
<tr><td><div style="font-size:11px; margin-top:4px;">Requires <a href="http://www.amazon.com/gp/kindle/mac/ref=kcp_mac_lnd_spl">Kindle for Mac Application</a></div></td></tr>

I want to open 'App A' when I click a button 'X'. I want to control (open doc/app ...) my Mac from Safari browser.


Solution

  • Some of the other answers have the right gist, but I think it is a protocol handler rather than a MIME type. Kindle for Mac will have registered a handler for the "kindle:" protocol, either with OS X or directly with the browser (Safari, I guess), in a similar way that there is a default protocol handler for the "mailto:" protocol going to the Mail app.

    This question has an answer on how to modify your app to register a protocol handler.

    register a protocol on mac osx?