This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Back button broken in Chrome when setting location.href in HTML5 mode #11667
Closed
Description
When clicking a link from http://example.com/
to http://example.com/app
where /app
runs angular with HTML5 mode and the baseURL set to /app
, the following error is raised when you press the back button:
Error: [$location:ipthprfx] Invalid url "http://example.com/", missing path prefix "http://example.com/app/"
The offending line:
var pathUrl = beginsWith(appBaseNoFile, url);
Can be found here:
Line 107 in a509e9a
pathUrl
returns undefined which results in an error being thrown and the page not navigating back to http://example.com/
as expected.