×

Developers

Add To OnSong

The Add To OnSong extension enables users to add music content from your website by tapping into action extensions in iOS 8. OnSong may also support importing of content through an in-app browser. As a website owner, you can control what is imported and whether you want content to be importable.

How It Works

To determine what content to import, OnSong reviews the content of the website to find applicable content:

  1. Review <input type="hidden"/> elements to locate one that contains valid ChordPro syntax.
  2. If not found, enumerates pre elements and uses the element with the longest content.
  3. Found content is always stripped of HTML tags to remove additional formatting.
  4. Finds the last h1 tag that contains only text and uses that as the filename.
  5. If not found, the filename is extracted from the last component of the URL.

If content has been located, it is saved to a file with the found name and imported in the native file format. If needed, the title of the song is appended to the content if missing.

Making Your Content Better

If you want users to receive the best possible content when importing using the Add To OnSong Safari extension, use the following tips:

  1. Add or alter an <input type="hidden"/> element containing ChordPro content.
    OnSong will always use this instead of pre tags.
  2. Make sure that the content found in pre tags is in the OnSong or ChordPro file formats.
  3. Ensure that you have set appropriate restrictions on the file using the restrictions metadata tag.

Preventing Content From Being Added

If you don't wish to have your content accessed by OnSong, try the following:

  1. Provide an <input type="hidden"/> element that contains ChordPro with only a title.
  2. Do not include <input type="hidden"/> elements containing ChordPro or pre tags.
  3. Use Javascript to render chord charts and prevent them from being publicly indexed or acquired by software.