Identifying and handling a pop-up window by its content