A minimal library for handeling cirtical events in browsers