Browser console compatibility shim for legacy JavaScript engines