You can show a modal once when mouse cursor leaves the page without any problem. Refresh the page to see result again.