detect if webpage is pinned to ios home screen

+ code reformat