ユーザーが自分のURLを入力してiframeでブラウズすることを許可します。 確認ボタンをクリックすると、iFrameからURLを取得します。GWT原点 "http:// localhost"のフレームがクロスオリジンフレームにアクセスしないようにブロックしました
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());
しかし、私は、iframeの
ExceptionからURLを取得した後、私はエラーを得た:com.google.gwt.event.shared.UmbrellaException:例外 がキャッチ:(例外SecurityError):フレームをブロックされました原点は "http://localhost"はクロスオリジンフレームにアクセスできません。