Wednesday, September 1, 2010

historyFrame issues when document.domain is explicitly set

Hi

We have a simple GWT mash-up shell application with a top nav loading
content in an iframe.
The root application is explicitly setting the document.domain to
"mydomain.com".

All is well on FF but IE8 Same Origin Policy is blocking the page
(Access Denied).

I traced the error to the retrieval of the history token from the
historyframe (function getTokenElement). The __gwt_historyFrame iframe
should be owned by the containing page index.html where the
document.domain is explicitly set.

function getTokenElement(historyFrame){
if (historyFrame.contentWindow) {
var doc = historyFrame.contentWindow.document;
return doc.getElementById('__gwt_historyToken');
}
}

I am aware that IE8 requires all frames to set the document.domain
explicitly to the same value to allow access. Yet how can you set the
document.domain to the __gwt_historyFrame apart from declaring it in
the startup page where the document.domain is set ?

Anyone ran into this kind of behavior ? Any input welcomed.

Note: The compiled js pages also get their document.domain explicitly
set via IFrameLinker getModulePrefix(), overridden in our
CrossDomainLinker class.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment