made a js lib with common functions used by both chromium and mozilla