Remove the check for webkit and use close()

cancel() is not a valid method