Removing unwanted javascript behavior