I need in javascript (or JQuery) detect the actual url from the child window tab..
Example:
parent.php
<script type="text/javascript">
function openInNewTab(url) {
var child = window.open(url, '_blank');
child.focus();
var timer = setInterval(checkChild, 500);
function checkChild() {
document.write("Show here the location.hostname from child window");
}
}
</script>
<button onclick="openInNewTab('//mypage.com/child.php');">Open Child</button>
child.php
<a href="//google.com">Go to google</a>
<a href="//facebook.com">Go to facebook</a>
if user open child.php, show in parent.php "mypage.com" but if the user press click in the "go to google" show in parent.php "google.com" or in "go to facebook" show "facebook.com"
I need work this in javascript (or JQuery)