Obtenha URL da janela superior do iframe
var url = (window.location != window.parent.location)
? document.referrer
: document.location.href;
Arrogant Ant