Can Silverlight HyperlinkButton forced to open page with Internet Explorer? - silverlight

Can Silverlight HyperlinkButton forced to open page with Internet Explorer?

If someone has defaulted to one browser (let say Chrome), you cannot ask the current browser (using JavaScript) to open the link to a specific browser (i.e. you want Internet Explorer instead of Chrome). I am not sure about Flash or Silverlight's ability to do what you want.
I have found a technique but it is specific to VBScript inside Excel and it may need the UA agent check to make sure it works correctly for a target environment if you want to adapt the similar code in Silverlight:
http://www.mofeel.net/87-microsoft-public-excel/30085.aspx

With HyperLinkButton you can't. If your OOB app is in full trust mode you can use automation object InternetExplorer.Application to open and control IE.

If you have the right permissions in silverlight you can read and wright to disk. So yes you can.

Related

WebBrowser: How to automatically allow activeX content

I have a problem where I am opening a set of html files found on the local computer which use ActiveX controls.
The constant notification popup is frustrating as every page it appears.
I cannot change the file as it is generated by an external application and I do not want enable ActiveX controls for IE in general.
What I would like to do is allow my webbrowser control, embedded in a WPF window, to allow blocked content automatically if it is from the local computer (or at the very least any blocked content as I can control what my webbrowser control can and cannot open)
I cannot see any obvious way of doing this, there are no options to allow blocked content and no event for identifying when blocked contetn has been foud.
Is there any way to achieve this?
Thanks
EDIT -
There have been plenty of views for this question but not a single comment. I will welcome any suggestions, perhaps even an alternative control, I realise the default WebBrowser is not ideal. Are there any other browsers that do offer this feature?
To add a little detail to the problem I think I should explain the requirements some more:
The resource being displayed is a set of html files that are generated as a report by a legacy tool that cannot be changed.
The tool I have built will allow the user to define the destination for the report and then allow them to browse it using an embedded browser.
I really just need a control that will render html and ActiveX controls as a browser would but without any interference from internet security settings.
UPDATE - Unfortunately I am no longer working on this project, however I am interested in the problem/fix so I shal try and replicate it in my spare time.
I have also renamed the question as I realise the problem I am dealing with specifically is ActiveX content, which may have a solution (see answer from Rajesh) which is specific to this type of content.
You need to add the file location to your trusted sites. This is possible either with a webserver running on your local machine or if the folder where they are located is a shared folder.
In IE, go to Internet Options > Security, select "Trusted Sites" and click the "Sites" button. Enter the location (i.e. file:\server-Hostname\Sharedfolder* for a shared folder) and click "add" (make sure that the "Require server verification (https:)..." option is unchecked).
There is a lot more information available if you search "Add local file to trusted sites" on the web. I do seem to recall adding a local file location without having to share the folder, but at the moment I don't remember how I did it.
Simply add this line to your html page at the start before the html tag.
< saved from url=(0023)http://www.contoso.com/
and then select and comment it.

Gesture support for WPF WebBrowser Control which is displaying a HTML5 Site

In a standard WPF app, I have a WebBrowser control which has been navigated to a HTML5 sample page (http://ie.microsoft.com/testdrive/Browser/BrowserSurface/).
In the browser outside the app, I can interact with this site as expected – move photo’s around, use gestures etc.
In the WebBrowser control the site does not work as expected. It renders, but it does not respond to any touch gestures – It will, however, zoom in and out when I pinch.
Is it possible to make the WebBrowser control pass gesture events etc so that I can interact with the site as I would in a normal browser?
Many thanks for any help with this!
Kris
I know this is an old question but I think this has something to do with the fact that the WebBrowserControl standard uses IE7 ActiveX. I had the same problem which always gave me JavaScript errors in the control for TouchEvents.
After I added some registery key to force the WebBrowserControl to use the latest IE version installed it worked.
Here is what I've add to my registery. Paste it in a txt file and save it as an .reg file. Then DoubleClick it. Or enter the key/value manual in your registery via Regedit.
I even included this in my application code to add the key/value automaticially if it doesn't exist yet.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
Sorry, the code plugin srews up.
Change IE version for the WPF WebBrowserControl
MSDN Internet Feature Controls (B..C)

Codeplex sample browser - what UI technology is it?

Codeplex has a strange application for downloading and browsing Windows samples, and I have not been able to understand just what it is:
http://1code.codeplex.com/releases/view/64539
When the click-once application above is installed, it creates a single file in the form of a shortcut which contains the following line only:
http://1code.codeplex.com/releases/clickonce/SampleBrowser.application#SampleBrowser.application, Culture=neutral, PublicKeyToken=48e4844f2d49d017, processorArchitecture=msil
Then, when this shortcut is double-clicked, a sort of browser application comes up, but it has no window borders and is very modern looking. What type of technology is this? I am including the WPF tag otherwise I am at my wit's end as to what it is.
(Wanted to include an image of the said application here but can't seem to upload an image as I am getting the following error: "Failed to upload image; imgur is rejecting the request") Here's a link to that image: http://imgur.com/B38P6
Thanks.
The initial part about the odd link is simply a click-once application. The rest of the application is hidden away somewhere in your user directory.
The "browser" is simply a window which has had its chrome modified. Could be pretty much any technology. A couple examples in winForms and wpf.
As a caution, if doing a custom chrome in wpf don't use the AllowTransparency="True" if you want your comboboxes and such to work properly on XP.

Alternatives to WebBrowser control in WPF?

We are working on a WPF app with the web browser control. When the user drags the window, the web browser lags behind the window as it drags.
Does anyone know how to solve this issue? Failing that, does anyone know an alternative to the web browser control itself?
Thanks!
Yes, as long as you don't require IE specific features you can use Awesomium which basically gives the same browser engine used by Google Chrome except for everything is rendered in pure WPF. For a while it was open source but I believe it is becoming a commercial product.
I haven't heard about any Native WPF WebBrowser Control. The only options I know are based on Win32 controls which are wrapped into WPF controls in order to displayed. (See more details at http://msdn.microsoft.com/en-us/library/ms752055.aspx )
Recently I have to use the WPF wrapper for the WebBrowser control, and it's very limited regarding the options available for the developer. During my research I found that you are able to inject scripts or html content in order to modify the page behavior. Also, you can call .NET code (e.g. CSharp function from Javascript).
However tasks such as accessing the cache, modifying cookies are difficult task or changing the web browser behavior are very difficult. Here is when you will have to use DLL Imports in order to invoke unmanaged routines (see http://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx )
It's possible to look for an alternative WebBrowser control such as:
http://code.google.com/p/csexwb2/
http://wpfchromium.codeplex.com/
I hope this helps
You can try CefSharp.Wpf which uses Chromium as a base browser. You can find it on NuGet

Silverlight 3 - Can I run Out-of-browser inside another application

The new Silverlight 3 beta includes the ability to run Out-of-Browser applications. The demos so far show this only inside a special frame. Does anyone know how I can run Siverlight 3 controls inside a (WPF) application?
No, you can not embed out-of-browser silverlight into WPF. The sllauncher.exe standalone frame has a special handler for the offline://(hostname).(revision)/ url given to it to allow the app to have all the features of out-of-browser mode (like extra keyboard access). Unless you can find a way to embed this app into your app, you won't be able to get out-of-browser; if you know some way to do this the address for this app is:
C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe
As others have said, however, you can embed a silverlight control inside of an html page and that inside a WebBrowser element. Be cautious with this method, however, since there is currently no x64 support for Silverlight and if you absolutely must do this make sure to compile specifically for x86.
I'm guessing (yes, shame on me!) but you can probably put a WPF web browser on your window and navigate to the Silverlight app inside it.
This is a supported scenario; a recent MSDN article stated this scenario was supported, and scenarios like this forced the CLR team to allow multiple CLRs loaded into a single process.
It seems that SLOOB apps run inside a host process (C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe). This hosts and sandboxes the app.
I suspect that it will not be possible to host it yourself - sorry if that's a little close to guessing, but short of running a hosting web browser in your WPF app I can't think of a way around the sandboxing requirement.
HTH
You can host a browser control inside a windows app, and load silverlight inside the browser control. This is how live mesh is going to do it.

Resources