move code to js to prevent warnings of amo automatic verification