Port firefox example to chrome APIs