Add preview function

Maryana said no-js support is of low priority, that will be implemented
in another patch later

Change-Id: Ia98006ba7c8d961d78e89de45d93a72513b21970
Merge "Add preview function"