Handle browser quirks for window.location.pathname.