Skip to main content

Microsoft Silverlight

Unanswered Question downloader and same-origin-policyRSS Feed

(0)

DonDozone
DonDozone

Member

Member

0 points

7 Posts

downloader and same-origin-policy

Hi there,

I'm wondering if the "downloader" object of Silverlight 1.0 is also restricted by Javascripts' "same-origin-policy"?

I'm currently developing a Silverlight-gadget for IGoogle and try to show there pictures, which come from a different domain. I check the status from the "DownloadFailed"-Event and it says:

Status:204 HTTP:NO CONTENT

but the URL is perfectly okay and it worked in the Sidebar version of the gadget.

I read in the MSDN-documentation, that the source has to come from the same host as the gadget.

Is there a way to surpass this restriction? I really need the downloader object, because i have to determine the exact time, when the download of the image has finished. When i use silverlightobject.Source = "http....", I have no control about when the image is rendered.

Any help appreciated.

Wolf Schmidt (MSFT)
Wolf Sch...

Member

Member

489 points

79 Posts

Microsoft

Re: downloader and same-origin-policy

Downloader does not restrict its Get URLs to come from the same host/ site of origin as the calling plug-in. Putting an http:// request to download from another SOO should work fine for an image. But there are other things you might be running into.

* Your image source site might have a client policy in place to restrict cross domain requests. Silverlight downloads respect the client policy, I'm not sure what sidebar does.

* I'd expect a different error for this, but maybe the image format isn't Silverlight compatible?

* How are you testing this - using localhost? Downloader requests do have to come from same SCHEME, so if you are testing by double-clicking and thus using file://, you will get DownloadFailed, as well as a AG_E_NETWORKERROR

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities