Detection logic totally on client-side