Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($location): re-assign location after BFCache back #4201

Merged
merged 1 commit into from
Sep 30, 2013

Conversation

jeffbcross
Copy link
Contributor

In the Android browser, the BFCache maintains
the state of JavaScript applications even when
navigating to another app, so that going
forward and back, to and from an application
is very fast.

Unfortunately, this can have undesired side
effects. In this instance, the location
variable was holding a reference to a stale
window.location, and was throwing errors
when going back to an Angular app after
browsing to another site.

This fix makes sure that location.url()
includes a check to make sure that location
is referencing the current window.location.

Closes #4044

@mary-poppins
Copy link

That's for that PR, Mr. Handsome!

@jeffbcross
Copy link
Contributor Author

In the Android browser, the BFCache maintains
the state of JavaScript applications even when
navigating to another app, so that going
forward and back, to and from an application
is very fast.

Unfortunately, this can have undesired side
effects. In this instance, the location
variable was holding a reference to a stale
window.location, and was throwing errors
when going back to an Angular app after
browsing to another site.

This fix makes sure that location.url()
includes a check to make sure that location
is referencing the current window.location.

Closes angular#4044
@jeffbcross
Copy link
Contributor Author

I updated the commit message and PR message:

  • Changed "Fixes" to "Closes" for issue.
  • Moved Closes clause to bottom of message.
  • Changed "fix(location)" to "fix($location)"
  • Changed "Re-assign" to "re-assign"
  • Removed period from first line

@jeffbcross jeffbcross merged commit 2ebf931 into angular:master Sep 30, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined TypeError: Cannot call method 'replace' of undefined in Android Browser
3 participants