Thanks. Very helpful. From what I am reading I guess the ExternalTextResource cannot switch to JSONP at runtime? I can test at runtime if the HTML host page domain is different from the Module domain and activate it at runtime.
Maybe I will use ExternalTextResource then. I need to check first if it bundles all ExternalTextResource resources in a single file which I wouldn't like. Maybe I remember it incorrectly and it was TextResource which does the bundling. On Wednesday, June 27, 2012 11:08:59 AM UTC+2, Jens wrote: > > CssResource: works as its inlined into your JavaScript to avoid round trip > times. > > ImageResource: should work as you typically use it with GWT's @Sprite in > CSS or in combination with GWT's Image class. In both cases the image will > be loaded via CSS background-image: url(<imageUrl>) => no SOP. > > DataResource: With DataResource you only have DataResource.getUrl() to > access it. So it depends on yourself and how you load the url. If you load > it via XHR you have a SOP problem. But if its for example a custom mouse > cursor and you set the url to CSS cursor:url(<url>) its not a problem. > > TextResource: Are inlined into your JS and should work, but there is a max > limit in text size (see: TextResourceGenerator.MAX_STRING_CHUNK and its > JavaDoc). > > ExternalTextResource: Are loaded async (XHR) and wouldn't work but it > seems like there is a configuration property that tells GWT to load the > ExternalTextResource via JSONP (see: > ExternalTextResourceGenerator.USE_JSONP and its JavaDoc). So you would use > <set-configuration-property name="ExternalTextResource.useJsonp" > value="true" /> in your module.gwt.xml. > > > Also you should be able to test all this very easily by creating a mini > project only containing a ClientBundle and some code which uses it, compile > it and load it from a different domain. E.g. serve it from localhost and > access it from 127.0.0.1 or edit your systems hosts file and add some more > domain names for your local host, e.g. 127.0.0.1 localhost > test-domain1.com test-domain2.com. > > > -- J. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/MQfsBc7M0FgJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
