A legal battle over online safety and free speech is emerging as New York prepares to enforce new social media warning requirements.