Reworking browser code to improve recording accuracy