patch some missing functions for different browser supportness