User Tools

Site Tools


developer_center:articles:nightingale_protocol_handler

Introduction

Web developers often have visitors viewing their site in their default web browser (Firefox, Safari, etc.) but may wish to redirect a link to open inside Nightingale. For instance, music blogs or stores may wish to have users view their site within Nightingale to utilise Webpage API features, or Nightingale's media-scraping features. In order to support this, Nightingale 1.8.1 and higher will register a ngale:// protocol handler with the operating system to enable webpages to redirect links to open within Nightingale. The exact format looks like:

ngale:<command>?value=pair&value=pair

Of course, if the user doesn't have Nightingale installed, then no protocol handler will have been registered. To remedy this, the Nightingale website will have a Web Launch Redirection service to facilitate Nightingale detection. The Web Redirector will attempt to detect whether the user has Nightingale installed (by use of a cookie installed from the Nightingale download page, or by sniffing the user-agent to see if the user is already within Nightingale ), and forward the user through (depending on the command), or will prompt the user to download and install Nightingale.

Any web developer can utilise this service freely.

Commands

While the list of commands is expected to grow in the future, as of this article's writing (1.1 release-time), the only command implemented so far is open.

open

Summary

Launch Nightingale and open a tab with the url contained in the url query string parameter. The new tab should have the focus.

Parameters

  • url
    • The URL to open in Nightingale; MUST BE URL-ENCODED (see example)

Example

The following example would cause a new tab to open in Nightingale, loading http://libre.fm/

 ngale:open?url=http%3A%2F%2Flibre.fm 

Web Launch Redirector

Of course, the ngale:// protocol handler is only effective if Nightingale is installed. To facilitate this, Nightingale's website provides a Web Launch Redirector at http://launch.getnightingale.com free for any web developer to use. You can construct a link to look like:

 http://launch.getnightingale.com/<nightingale_PATH_INFO>

The URL to redirect to should be a ngale:// URL in the form of one of the above valid commands. For instance, to provide a link to the Web Redirector to launch a new tab open to http://libre.fm, the link should look like:

 http://launch.getnightingale.com/?url=http://libre.fm/
 ngale:open?url=http://libre.fm/

If the user doesn't have Nightingale installed, then they will be prompted to download and install Nightingale by the launch.getnightingale.com site.

developer_center/articles/nightingale_protocol_handler.txt · Last modified: 2014/07/08 07:33 by geekshadow