diff options
| author | Elliott Sprehn | 2010-11-01 18:03:52 -0700 | 
|---|---|---|
| committer | Igor Minar | 2010-11-02 11:27:54 -0700 | 
| commit | dcf76e681624dca350d00a4a2e5f5d63deffcb17 (patch) | |
| tree | 6eb72ac544c9a70d83a7655553726a68afa6f156 /src/scenario/Application.js | |
| parent | 56a3d52f45ceae7973999ab8351a090f3ffddbba (diff) | |
| download | angular.js-dcf76e681624dca350d00a4a2e5f5d63deffcb17.tar.bz2 | |
Provide better sandbox error messages, and disallow running from file:// URLs
Diffstat (limited to 'src/scenario/Application.js')
| -rw-r--r-- | src/scenario/Application.js | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/src/scenario/Application.js b/src/scenario/Application.js index eacf3c7b..9d05aad0 100644 --- a/src/scenario/Application.js +++ b/src/scenario/Application.js @@ -41,7 +41,7 @@ angular.scenario.Application.prototype.getWindow_ = function() {   * Checks that a URL would return a 2xx success status code. Callback is called   * with no arguments on success, or with an error on failure.   * - * Warning: This requires the server to be able to respond to HEAD requests  + * Warning: This requires the server to be able to respond to HEAD requests   * and not modify the state of your application.   *   * @param {string} url Url to check @@ -69,7 +69,7 @@ angular.scenario.Application.prototype.checkUrlStatus_ = function(url, callback)  /**   * Changes the location of the frame.   * - * @param {string} url The URL. If it begins with a # then only the  + * @param {string} url The URL. If it begins with a # then only the   *   hash of the page is changed.   * @param {Function} loadFn function($window, $document) Called when frame loads.   * @param {Function} errorFn function(error) Called if any error when loading. @@ -79,8 +79,8 @@ angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorF    var frame = this.getFrame_();    //TODO(esprehn): Refactor to use rethrow()    errorFn = errorFn || function(e) { throw e; }; -  if (/^file:\/\//.test(url)) { -    errorFn('Sandbox Error: Cannot load file:// URL.'); +  if (url === 'about:blank') { +    errorFn('Sandbox Error: Navigating to about:blank is not allowed.');    } else if (url.charAt(0) === '#') {      url = frame.attr('src').split('#')[0] + url;      frame.attr('src', url); | 
