Added a onpopstate event and also a API check

Signed-off-by: tanji <nicholastanjerome@gmail.com>