Added check to not run js if not on a supporting device.