Question

I have a GWT application, and I want to embed its URL in another web page through an iFrame:

<iframe src="http://127.0.0.1:8888/myProject.html?gwt.codesvr=127.0.0.1:9997"/>

But I'm getting errors.

If I browsed it in firefox:

Permission denied to access property 'href' (from firebug console)

If I browsed it in chrome:

A dialog pops up saying: Plugin failed to connect to Development Mode server at 127.0.0.1:9997

I researched a lot but all were in vain.

Using development mode of GWT.

Any help would be appreciated.

Was it helpful?

Solution

OK if someone ever get here cause he has the same problem and want to know what happened I will just summarize what we've got.

I'm not sure but I think that the problem was because internet browsers don't let sites to access url that are not in the main page domain (if it was able to do so very bad things would have happened) unless you let them do so.

It's called cross-domain access policy, so there are 2 options for handling it

  1. The easy one- the gwt and the outer html must have the same host.
  2. Let gwt plugin run from the outer html context, it's described here and here but for some reason it wasn't working. we still don't know why.

OTHER TIPS

My workaround (Ubuntu, GWT 2.5.1) was to replace:

__gwt_HostedModePlugin -> parent.__gwt_HostedModePlugin
window.top -> window.parent

in hosted.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top