Out of browser option is not loaded with controls - silverlight

I changed the silverlight project property file in to out of browser option. The screen is loaded with no controls. Any idea?

Yes. It is working fine the browser and when it is set to out of browser application, the application is installed in the start up as well as desktop. when we load it is opened with a blank screen and no control was loaded.

It could be related to unhandled exception happened inside App.xaml.cs during start-up. For instance, if you try to reach any in-browser-application only objects such as System.Windows.Browser.HtmlPage, you will get Null reference exception. You should be able to find this out by put a break point inside App.xaml.cs.
Here is an example that you can see in browser application but you will get a blank window in out of browser.
System.Windows.Browser.HtmlPage.Document.DocumentUri;
To support both in-browser and out-browser, you should do the following.
if (Application.Current.IsRunningOutOfBrowser)
{
// MessageBox.Show("Application.Current.Host.Source = " + Application.Current.Host.Source.ToString());
return Application.Current.Host.Source;
}
// MessageBox.Show("DocumentUri = " + System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString());
return System.Windows.Browser.HtmlPage.Document.DocumentUri;
If this is not the case, please try to rebuild your solution by toggling "Enable the application out of the browser". Sometimes you have to build twice (the first one without the check, the second one with the check) before you can see the out-of-browser application window.

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.

Python WebBrowser Open In Same Tab

running this line:
webbrowser.open(page.path, new=0, autoraise=True)
I always get the page opened in a new Tab.
How can I get it in the same Tab as it should be using new=0?
This can't be done unfortunately.
You can set the variable to whatever you want but browser tab behaviour is hard-set in modern browsers and will override it. You'll find that you won't be able to use new=1 to open in a brand new window either, for the same reason. It will always just be a new tab.
The last update to the webbrowser module in the Github was about the same age as this question, I wonder if this has been abandoned.

Can't get Dynamic Data Display working with WPF Browser Application

Can I get Dynamic Data Display library working with WPF Browser App? I'm getting "Target Invocation Exception" when attempting to launch the app, regular desktop WPF app runs just fine.
Update 1: "That assembly does not allow partially trusted callers." is the error, got it by adding D3's chart plotter dynamically. Looking into it now.
Fixed by switching to "This is a full trust application" option in the Security tab of my project's properties. May not be appropriate for everyone, check for the potential implications of it. Did the trick for me though.

What cases will prevent javascript from being executed in a WPF WebBrowser control?

We have a System.Windows.Controls.WebBrowser control rendering HTML with references to jQuery (retrieved with https connection). Our test machine recently had its Internet Explorer version upgraded to 8.0.7600.16385. After the upgrade, the WebBrowser control stopped executing javascript. We tested the same HTML in a regular browser and also in a System.Windows.Forms.WebBrowser control and it works perfectly in both.
Does anybody know what could cause?
It's probably due to security restrictions. Try to include a Mark of the Web on your page. For instance, this comment will tell the WebBrowser to execute the page with the security policy of the Local Intranet zone:
<!-- saved from url=(0016)http://localhost -->
Typically the cause for "JavaScript doesn't execute" is the browser errors while parsing or executing it: file doesn't exist, file has syntax error in it, script threw an exception while running, etc. You've attempted to rule this out by testing in a regular browser, but is there anything in the script that detects a UserAgent or browser features, and fails? Can you harvest console errors from a WPF WebBrowser control?

Silverlight controls getting stuck loading on IE

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.

Resources