I would like to allow the user enter their url and browse in the iframe. After they click the confirm button, i will get the url the browse from the iframe.
IFrameElement frame = IFrameElement.as(DOM.createIFrame());
frame.setSrc("http://www.example.com"); //set the url of user enter
VerticalPanel ver = new VerticalPanel();
ver.getElement().appendChild(frame);
// After they click the confirm button, get the url from iframe
Window.alert(frame.getContentDocument().getURL());
But i got an error after i get the url from iframe
Exception: com.google.gwt.event.shared.UmbrellaException: Exception caught: (SecurityError) : Blocked a frame with origin "http://localhost" from accessing a cross-origin frame.
In short: you should not do this and you can not do this.
First:
Some pages' authors simply do not want to let their pages to be displayed in a frame. Try Facebook for example, you'll get:
One can also check (with a script) if the page is in a frame and 'break through' and take main window, http://www.interia.pl/ is an example.
So, there are pages that can not be shown in a frame.
Second:
Read about Same Origin Policy (SOP):