How to remove “Do you want to leave this page or stay” pop-up from Safari

“Do you want to leave this page or stay” is a annoying pop-up message indicating that your computer is infected with the malware. Usually such kinds of infections crawl into the system accompanied by another programs. In these cases, user often forgets to opt out from additional programs during the installation.