Update contentscript.js

Implemented search and replace algorithm.
Also implemented pop-up to content listener.