Port script to firefox