Skip to content
Browse files

Merge branch 'master' of github.com:cengageng/funcunit

  • Loading branch information...
2 parents baa2f89 + c2c20a6 commit ef32cde5e3d03436068596c6090e5c44ace07347 @moschel moschel committed Mar 9, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 browser/open.js
View
7 browser/open.js
@@ -108,6 +108,10 @@ $.extend(FuncUnit,{
else {
lookingForNewDocument = true;
if(isCurrentPage(url)){
+ /*Sometimes readyState does not correctly reset itself, so we remove the
+ body from the document we are navigating away from, which will get set again
+ when the page has reloaded*/
+ FuncUnit.win.document.body.parentElement.removeChild(FuncUnit.win.document.body);
// set the hash and reload
FuncUnit.win.location.hash = url.split('#')[1] || '';
FuncUnit.win.location.reload(true);
@@ -233,7 +237,8 @@ $.extend(FuncUnit,{
// actions check this
documentLoaded: function(){
var loaded = FuncUnit.win.document.readyState === "complete" &&
- FuncUnit.win.location.href != "about:blank";
+ FuncUnit.win.location.href != "about:blank" &&
+ FuncUnit.win.document.body;
return loaded;
},
// return true if new document found

0 comments on commit ef32cde

Please sign in to comment.
Something went wrong with that request. Please try again.