Skip to content

Commit

Permalink
Test document.URL of <iframe src="javascript:...">
Browse files Browse the repository at this point in the history
The document.URL should be about:blank.

Follows whatwg/html#4205.
  • Loading branch information
jyasskin authored and domenic committed Dec 18, 2018
1 parent 7ed525a commit ed74c4f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
ifr1:{url:"about:blank", sameDom: true},
ifr2:{url:"about:blank", sameDom: true},
ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
ifr4:{url:"about:blank", sameDom: true}
ifr4:{url:"about:blank", sameDom: true},
ifr5:{url:"about:blank", sameDom: true}
}

var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
Expand Down Expand Up @@ -46,8 +47,15 @@
results[frame.name] = 'Exception on setting!';
}
};

// An iframe with an initial src of a javascript: URL should also have a
// document URL of about:blank.
var ifr = document.createElement('iframe');
ifr.name = 'ifr5';
ifr.src = js_url;
document.body.appendChild(ifr);
}

</script>
</body>
</html>
</html>

0 comments on commit ed74c4f

Please sign in to comment.