(url, replace, state)
| 14632 | var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; |
| 14633 | |
| 14634 | function setBrowserUrlWithFallback(url, replace, state) { |
| 14635 | var oldUrl = $location.url(); |
| 14636 | var oldState = $location.$$state; |
| 14637 | try { |
| 14638 | $browser.url(url, replace, state); |
| 14639 | |
| 14640 | // Make sure $location.state() returns referentially identical (not just deeply equal) |
| 14641 | // state object; this makes possible quick checking if the state changed in the digest |
| 14642 | // loop. Checking deep equality would be too expensive. |
| 14643 | $location.$$state = $browser.state(); |
| 14644 | } catch (e) { |
| 14645 | // Restore old values if pushState fails |
| 14646 | $location.url(oldUrl); |
| 14647 | $location.$$state = oldState; |
| 14648 | |
| 14649 | throw e; |
| 14650 | } |
| 14651 | } |
| 14652 | |
| 14653 | $rootElement.on('click', function(event) { |
| 14654 | var rewriteLinks = html5Mode.rewriteLinks; |
no test coverage detected