开发者

Hosting Silverlight widget from local file system

开发者 https://www.devze.com 2022-12-16 01:10 出处:网络
I\'m trying to host a remote Silverlight widget in an html file that will exist l开发者_Go百科ocally on the hard drive, but whenever I open the html file, the Silverlight content does not show up.If I

I'm trying to host a remote Silverlight widget in an html file that will exist l开发者_Go百科ocally on the hard drive, but whenever I open the html file, the Silverlight content does not show up. If I move the file to a web server and then access it through http, it works perfectly. I figured out (or at least I assume) that the widget is trying to make a call back to the web server but it's failing because of the cross zone restrictions in SL 2+. I've also seen a few reports from users talking about running into this issue when debugging from a local file. My question is, how can I tell for sure that this is the issue going on/what tools might I use to verify my hypothesis?

Additionally, (knowing full well that there are elevation of privileges security concerns to take into account) is there any way that I could declare the web services the widget calls as safe (for instance adding to the trusted sites) in such a way that Silverlight would be able to perform the calls without the security exceptions?

An example of a widget I'm talking about is below:

<object 
    type="application/x-silverlight-2" 
    data="data:application/x-silverlight-2," 
    width="400" height="400">
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="background" value="#141414" />
    <param name="splashScreenSource"
      value="http://memorabilia.hardrock.com/Widget/3.2009.1014.0/Splash.xaml" />
    <param name="source"
      value="http://memorabilia.hardrock.com/Widget/3.2009.1014.0/HardRock.Memorabilia.Silverlight.Widget.xap" />
    <param name="enableHtmlAccess" value="true" />
    <param name="initParams" value="item=034739" />
    <a href="http://go.microsoft.com/fwlink/?linkid=149156&v=3.0.40624.0">
        <img src="http://memorabilia.hardrock.com/Widget/3.2009.1014.0/Ping.gif?type=install&item=034739" 
          style="background:#141414
           url(http://content.memorabilia.hardrock.com/Assets/Images/widget/034739.jpg)
           no-repeat center;margin:0;padding:0;border:0;" 
          width="400" height="400" />
    </a>
</object>


This is an issue of a cross protocol violation - a page with a file:// protocol cannot access assets with an http:// protocol. This also helps protect your your computer from accessed by a malicious Silverlight application.

0

精彩评论

暂无评论...
验证码 换一张
取 消