Successfully ported script to chrome extension