Accessing contentDocument or contentWindow.document URL


I have a CustomLayout wherein a DIV/IFrame is found.
I would like to access that components contentDocument/contentWindow.document in order
to determine which URL is being used. The following code works:

String stop =
“var iframe = document.getElementById(‘iframe1’) ; \n” +
“alert(‘DIV Iframe url =’ + iframe.src); \n” +
“var doc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document; \n” +
“alert('DIV Iframe html = ’ + doc + ’ URL = ’ + doc.URL); \n” ;

Now I need to make that URL visible to the Vaadin (client) code.
How can I do this?