put code into Chrome extension format