Silverlight controls getting stuck loading on IE - silverlight

We're seeing some crazy behavior using Silverlight 4 on IE, on some machines, in some configurations. Here's the scenario
1) Silverlight controls used in our own custom Sharepoint WebParts (loading using the tag)
2) 2 web-part-containing-Silverlight instances on a page. That means 2 object tags, both pointing to the same XAP file but loading different user controls from that XAP
On some pages (but not all), the Silverlight loading seems to get stuck. The Silverlight controls don't render, the object tags' onload handler isn't called, and Fiddler is showing that the XAP isn't even being downloaded. Some interaction with IE (sometimes it's hovering over the control, sometimes it's clicking on the control region) can kickstart the loading process again, and the xap will download, onload is fired, and the controls are rendered. If I let it sit for a long time (like 2-3 minutes), sometimes the loading will resume and finish (but not always).
Since it hasn't even downloaded the XAP yet, it's not something in our code - it just seems like the loading gets blocked for some reason.
This only happens on IE, not on Chrome or Firefox. We've seen it on IE8 and IE7. It doesn't happen on every page with 2 SL controls, so the page contents seems to matter. We've also seen the problem running the web parts on straight ASP.NET (outside of Sharepoint), though much less frequently.
I've tried debugging with WinDBG, and it looks like some threads are in the guts of coreclr, but there's no debug symbols so I can't deduce much.

I was using webpart for Silverlight app in SharePoint. But finally found that its not the issue with webpart. In my case I removed all webpart from the default page and finally found that SharePoint default page is not loading.. I was using IE 9.
Solution: At the end I found that it was an issue related to Active X control. So I gone to Advance tab of Internet Options and did reset/restore all settings. Then once i started browsing the default page of the SharePoint website. Then ActiveX run request pops up. I allowed the ActiveX from Microsoft Corporation. Now Sharepoint default page is loading properly..

This happened to me as well. I have multiple XAPs loaded in one page and IE (sometimes Safari) just don't do anything. Nothing gets loaded. By using the Javascript API, it waits till the document is ready before embedding the tags. This way IE can take its time processing JS, CSS, HTML, MetaTags, etc, and then silverlight loads when everything is processed.

Related

Black screen appears when the CEF Winform Browser loads for the 1st time

I am using CEF Sharp - V86
I am getting this strange issue and our users have starting complaining about it.
When the cefsharp winform browser loads for the first time, it shows the black window for few mili-seconds and then it disappears.
If we reload or refresh the webpage, it does not happens.
We have recently upgraded from V79 to V86 and we did not had any issue in earlier version.
What i have tried so far is, tried setting below command line arguements but it didn't work.
settings.CefCommandLineArgs.Add("disable-gpu");
settings.CefCommandLineArgs.Add("disable-gpu-compositing");
I have also tried setting
Cef.EnableHighDPISupport()
But it didn't work.
Additional Info :
Checked with Latest Version - CefSharp V88
When we load CefSharp winform browser in wpf application using winform host, a black screen appears on load for the first time for few miliseconds and then disappears.
This was not happening in earlier version.(i checked with V79 till V83).
Steps to reproduce.
Create a sample wpf application ,use windowsformhost to load cefsharp winform browser.
In constructor of winform browser, use any url. I tested with www.google.com.
Run the application.
Notice the initial black screen appears for few miliseconds and then disappears.
Please note this happens only for the first time when the chrome winform load.
his seems to have broken from CEFSharp v84.
Any help will be appreciated. :)
I was able to get rid of the black flash. Once I removed it from the VS Form Designer, things got better. Define it as a form level object:
private ChromiumWebBrowser cwbPage;
Then in the form constructor, instantiate it and add it to a panel in the form:
cwbPage= new ChromiumWebBrowser("");
cwbPage.Dock = DockStyle.Fill;
this.pnlPanel.Controls.Add(cwbPage);
cwbPage.BringToFront();
//...add any event handlers
Finally, pass it the string of Html or navigate to the url:
cwbPage.LoadHtml("<html><body>This is a test.</body></html>");
//OR
cwbPage.LoadUrlAsync("https://www.google.com");
Notes:
It still takes about 3 seconds to load the content, but at least there is no black flash.
I experimented and tried going back to using the VS Form Designer, and the black flash came back. I stripped almost all of the properties away from it in the VS Form generated code, but it still flashed blackly. So it does not like using the Form Designer.

Browser automation in .Net

Can I automate actions like filling and submitting a form, clicking links et.c. in a real browser (i.e. IE11 or Firefox) using only a Silverlight or an XBAP application?
I would be grateful if you could let me know any other solution (other than the two above) that can do the automations without the need to manually install third party software (like Selenium or Telerik Testing Framework).
No one answered, so I'll tell you what worked and what not.
Silverlight solutions didn't work due to the Same-origin browser policy.
The XBAP solution actually worked. I created a new XBAP application and loaded it in my other application inside an iframe.
The user must accept the pop-up and the XBAP application opens a new WebBrowser control doing its stuff.
The whole thing only supports IE.

Silverlight 5 app from iframe not closing in IE9

I am developing a web application using Dojo v1.8 and my target machine runs IE9 and Silverlight 5.1.20125. In this web app, the user can select a tool from a toolbar at the top of the page that will open up in a content pane (or an IFrame if it is an external tool) below the toolbar (only one tool can run at a time).
The bug I am encountering is that one of the external tools that opens in an IFrame runs a Silverlight app, and if the user tries to select another tool, the new tool won't open and the Silverlight application stays there. After checking the DOM Tree, all references to the Silverlight application have been wiped, and the new tool is there instead (which is the desired behavior).
So my question is, why is the Silverlight Application still being viewed even when it is gone from the DOM Tree, and is there a way to programmatically close it from Javascript? Also, I do NOT have access to the source code of the Silverlight Application.
Well I did not manage to solve this issue directly. However, there was another bug that I ran into which involved the java swing library not working on the production machine. The solution was to add the following tag as the first element of head:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8>
This forces IE to use IE8 instead of IE9. This trick solved this other issue, but inadvertently solved this issue as well. Here are several links that helped lead me to the solution (amongst others):
http://sourceforge.net/p/djproject/discussion/671154/thread/d7662f61
http://msdn.microsoft.com/en-us/ie/ff959805.aspx#_Compatibility_issues_with_1

How get XAP name from Silverlight application with MEF?

I am writing Silverlight 4 application with Navigation framework and MEF.
In my application each menu for navigation must load on MEF project and show it.
But there are some problems. First of all I can't navigate to page of other XAP(see David Polls post). To do that I need DynamicNavigation.dll and must create extra pages, which is not acceptable in my case. Other soluction can be found on davidezordan.net. This version is looks much better.
Second problem for me is that example works great if there is on additional XAP, but if I load 2 or more XAPs(by clicking on menus for navigation), I can't decide which page to show.
If 2 XAPs are loaded MEFModuleList contains 2 pages and I can't get any information about them to decide which page to show.
One solution is to hard code XAP name of each project in pages, which will be loaded to MEFModuleList by Attribute or other way, but it is not good solution.
Is there any other way to solve this problem?

Is there a "Browser Control" to host a website inside Flash/Silverlight?

I'm looking for something similar to the VB6 / .Net Winforms "Browser Control", that let's you show a browser inside your application.
I don't want to just render a page, I want it to be a fully-functional browser, in which people can click links, will run Javascript, etc.
In essence, what I want is an IFrame, only that it runs inside a Flash app, or a Silverlight app.
The ultimate reason for this is that I want to defeat IFrame busters. I'm making a web app that lets you see other sites inside of it, and I'm running into a bunch of sites that have this code:
var t=top.location,w=window.location;if(t!=w) t.replace(w);
(that's from eBay BTW)
which essentially pops the user out of my site and into theirs.
My hope is that by using a "browser control" of some sort, inside a plugin sandbox, "top", will be top for that browser control, and not for my site.
Of course, if you have any other ideas to achieve the same, they'll be more than welcome.
Edit: I've tried the Component One control suggested by Bill, but it didn't work for these purposes, because it's creating an IFrame outside of the SilverLight control, so it executes in the same context as the page hosting Silverlight, which is what I'm trying to avoid.
Northcode SWF Studio allows you to add browser window on the stage in Flash. I personally use SWF Studio as a third party SWF2EXE tool to extend the power of Flash projectors. It's quite stable and powerful. As far as browser control is concerned here is the example you can download and test if it serves your purpose. Check the Browser APT here.
We've not built a component to enable folks to do this but we're open to suggestions here. That being said, easiest solution is an iFrame, but word of caution in that when you overlay an iFrame over the the top of Silverlight we've seen customers experience perf issues as a result (mostly due to alpha transparency of the iframe etc).
This isn't isolated to Silverlight, Flash suffers the same issue as it has to do with browsers and rendering within the given operating system.
HTH.
Scott Barnes / Rich Platforms Product Manager / Microsoft.
I use the HTML control created by Component One. It has the limitation that the Silverlight object in the page should be set to windowless, but otherwise it works very well.
It's an old post but I'll add my tupence answer. I used the DivElements free control for Silverlight link text and it works quite nicely. It just positions the div accurately so that it looks like it's on top.
As for the other such controls, you've got to set the windowless property of the Silverlight container to true.
It works really well for me and I'm able to seemlessly have Google maps and the Acrobat plugin displayed side by side with my Silverlight application.
PS: because the component just adds a <div> to the page, you can't do stuff like having it load dynamically Javascript file like in the <header> tag.
PPS: when setting the HTML code "by hand", be sure to hook up on the DocumentReady or Loaded event before playing with the HTML DOM.
Hope that helps someone.

Resources