Skip to content
CoolStar edited this page Oct 5, 2018 · 9 revisions

Note: This feature is no longer available as of version 2.1.8-2

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 for the file data.

Example

imageLoadTest is the id of an <img> tag.

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

loadFileString

Usage: anemone.loadFileString(fileName, callback);

Anemone will load the file at fileName, and call the function in callback, passing a string with the raw file data.

Example

testSpan is the id of a <span> tag.

anemone.loadFileString("/var/mobile/test.txt", function(text){
    document.getElementById("testSpan").innerHTML=text;
});

loadURLString

Usage: anemone.loadURLString(url, callback);

Anemone will load the url using a GET request, and call the function in callback, passing a string with the raw data loaded from the URL.

You can use this to load http or https URL's although we highly recommend using https.

Example

testDiv is the id of a <div> tag.

anemone.loadURLString("https://coolstar.moe/", function(html){
    document.getElementById("testDiv").innerHTML=html;
});

console.log

Usage: anemone.console.log(text);

Prints text to the syslog. Useful for debugging javascript.

Output Example

4/4/16, 11:09:51 AM SpringBoard[83097]: AnemoneHTML Console: Anemone Test

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>