Fix navigator webkit URL error in javascript