aboutsummaryrefslogtreecommitdiffstats
path: root/src/scenario/Application.js
diff options
context:
space:
mode:
authorElliott Sprehn2010-11-01 18:03:52 -0700
committerIgor Minar2010-11-02 11:27:54 -0700
commitdcf76e681624dca350d00a4a2e5f5d63deffcb17 (patch)
tree6eb72ac544c9a70d83a7655553726a68afa6f156 /src/scenario/Application.js
parent56a3d52f45ceae7973999ab8351a090f3ffddbba (diff)
downloadangular.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.js8
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);
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371