Added OS-checking JS code