fix bugs, add unsupported browser & onbeforeunload