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:
- Review
<input type="hidden"/>
elements to locate one that contains valid ChordPro syntax. - If not found, enumerates
pre
elements and uses the element with the longest content. - Found content is always stripped of HTML tags to remove additional formatting.
- Finds the last
h1
tag that contains only text and uses that as the filename. - 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:
- Add or alter an
<input type="hidden"/>
element containing ChordPro content.
OnSong will always use this instead ofpre
tags. - Make sure that the content found in pre tags is in the OnSong or ChordPro file formats.
- 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:
- Provide an
<input type="hidden"/>
element that contains ChordPro with only a title. - Do not include
<input type="hidden"/>
elements containing ChordPro orpre
tags. - Use Javascript to render chord charts and prevent them from being publicly indexed or acquired by software.