Thanks to visit codestin.com
Credit goes to github.com

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

fix($location) don't rewrite location when clicking on "javascript:" or "mailto:" link #8426

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jul 31, 2014

Previously, absent a specified target attribute, when clicking on an anchor tag with an href beginning with either "javascript:" or "mailto:", the framework would rewrite the URL, when it ought not to.

With this change, the browser is prevented from rewriting if the URL begins with a case-insensitive match for "javascript:" or "mailto:", optionally preceeded by whitespace.

Closes #8407
Closes #8425

@caitp caitp added this to the 1.3.0-beta.18 milestone Jul 31, 2014
@caitp
Copy link
Contributor Author

caitp commented Jul 31, 2014

@petebacondarwin can you take a quick look at this when you have time? I'd like to get this in because it's a pretty small fix, and should be a lot easier than getting people to add target="_self" everywhere.

…or "mailto:" link

Previously, absent a specified target attribute, when clicking on an anchor tag with an href beginning
with either "javascript:" or "mailto:", the framework would rewrite the URL, when it ought not to.

With this change, the browser is prevented from rewriting if the URL begins with a case-insensitive match
for "javascript:" or "mailto:", optionally preceeded by whitespace.

Closes angular#8407
Closes angular#8425
@caitp caitp added cla: yes and removed cla: no labels Jul 31, 2014
@petebacondarwin
Copy link
Contributor

LGTM

@caitp
Copy link
Contributor Author

caitp commented Jul 31, 2014

Thanks

caitp pushed a commit that referenced this pull request Jul 31, 2014
…or "mailto:" link

Previously, absent a specified target attribute, when clicking on an anchor tag with an href beginning
with either "javascript:" or "mailto:", the framework would rewrite the URL, when it ought not to.

With this change, the browser is prevented from rewriting if the URL begins with a case-insensitive match
for "javascript:" or "mailto:", optionally preceeded by whitespace.

Closes #8407
Closes #8425
Closes #8426
@caitp caitp closed this in 97f230a Jul 31, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop rewrite href when the url is started "javascript:" and "mailto:"
3 participants