Added platform checking condition for .capx

Avoid runtime error in non-cocoonjs platforms.