[fix] make this work with browser globals