Skip to content
CoolStar edited this page Apr 3, 2016 · 9 revisions

Note: This feature is currently in development and is only available in the builds on the fast ring repo.

Note: This feature is in development and subject to change.

Note: As of right now, this feature requires iOS 9 or higher, although it will be backported to iOS 8 in the near future.

HTML Loader

Anemone loads HTML wallpapers that are placed behind icons on the home screen. Wallpapers are view only and do not have user interaction.

Theme folders containing wallpapers may not contain Bundles/ IconBundles/ or Folders/. The wallpaper should be exclusive to its theme folder, although the folder itself may be bundled with other theme folders in the same theme package.

Anemone will load this from index.html in the theme's "AnemoneHTML" folder.

E.g. HTMLExample.theme/AnemoneHTML/index.html

All other assets can be placed in AnemoneHTML.

Note: Without the use of javascript to call Anemone, the wallpaper will only be able to access files in AnemoneHTML.

Javascript API

Anemone provides API's via javascript using the "anemone" namespace. You can use this to access various functions not accessible otherwise through WebKit.

loadFile

Usage: anemone.loadFile(fileName, callback);

Anemone will load the file at fileName, and call the function in callback, passing a base64 encoded URL with the file data.

Example

imageLoadTest is the id of an tag.

anemone.loadFile("/var/mobile/wallpaper26.jpg", function(url){
    document.getElementById("imageLoadTest").src=url;
});

Permissions Info.plist Options

All of these keys are under the "AnemoneHTML" dictionary entry in the plist.

FilesystemAllowReadOnly

An array of paths to allow reading files from via Anemone's javascript API

FilesystemAllowReadWrite

An array of paths to allow reading and writing files via Anemone's javascript API

Example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>AnemoneHTML</key>
	<dict>
		<key>FilesystemAllowReadOnly</key>
		<array>
			<string>/var/mobile/</string>
		</array>
		<key>FilesystemAllowReadWrite</key>
		<array>
			<string>/var/mobile/Library/Preferences</string>
		</array>
	</dict>
</dict>
</plist>
Clone this wiki locally