Running javascript in Silverlight with Firefox

I am trying to execute a javascript part in a silverlight application. Pretty simple example I created ... Only one button that tries to execute this line of code ...

private void Button_Click(object sender, RoutedEventArgs e)
{
   HtmlPage.Window.Eval("alert('hi');");
}

A warning window will appear, but it freezes firefox, I have to force quit firefox to never come back to life .... has anyone come across this?

I thought maybe the firefox plugin is causing the problem, but I disabled them all with the same results.

The only way to make it work if I go to about:configin firefox and install dom.ipc.plugins.enabled.npctrl.dllinfalse

Any ideas ???

+3
source share
1 answer

, , ...

Silverlight...

<param name="windowless" value="true" />

, <div>

 <div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
        width="100%" height="100%">
        <param name="source" value="ClientBin/JavascriptSLTrigger.xap" />
        <param name="onError" value="onSilverlightError" />
        <param name="background" value="white" />
        <param name="minRuntimeVersion" value="4.0.50826.0" />
        <param name="windowless" value="true" />
        <param name="autoUpgrade" value="true" />
        <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration: none">
            <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
                style="border-style: none" />
        </a>
    </object>
    <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
        border: 0px"></iframe>
</div>
+2

Source: https://habr.com/ru/post/1775231/


All Articles