How do I enable javascript in webbrowser control? - c#

I have a web application which launches a windows application using Citrix server.
Windows application has a webbrowser control.
When windows application is launched stand alone on Citrix server, web site opens in webbrowser control with no problem.
But when it is launched through my web application, the webbrowser control does not load the javascript.
It shows content blocked error. It does not fire any event and show message on web page as
"Note: Since your browser does not support javascript you must press the Continue button once to proceed
"
I tried this :
I enabled the scripting on Internet Explorer on Citrix server.
Added my application url in trusted site.
But none of the above worked for me.

Here is a nice walkthrough if you would be compelled to do something like work in IE.
https://www.whatismybrowser.com/guides/how-to-enable-javascript/internet-explorer

Related

How can I authorize a user without using the browser?

My app is Windows based, and there is IE installed. But my app will run in a process which does not like externally-launched applications (like a web browser, when authorizing). Instead, my app will use the host application's web features to display a browser.
The host app takes over the front-end and is a public kiosk-type application, so I have no control over how browsing gets launched. The google drive api automatically launches the default browser (with an affinity toward Chrome, even if not the default... :-/
I cant give code examples, but you need to look into non browser based auth - i.e. server side authentication https://developers.google.com/drive/web/auth/web-server?hl=en

C# webBrowser internet security

I have a problem with a webBrowser.
I follow the instruction here C# webbrowser Ajax call to customize the webBrowser but I have a problem with security, I think.
When my application starts, I have this message in my webbrowser:
To help protect your security, Internet Explorer has restricted this
file from showing active content that could access your computer.
Click here for options
How can I force the webBrowser to accept my script?

How can I call a win app on client machine from my aspx web page?

I want to call a windows application on my clients machine from my aspx page , and If It's possible I want to send some parameter to the application . Any guids ?
The only way you can do that is to custom-develop an ActiveX control and host that control in your page. Then the user would have to allow ActiveX controls in his browser. Normally, a browser is a sandbox, so you cannot access Windows from it... But with ActiveX, this is possible.
Here is a tutorial for developing ActiveX controls in C#: http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/
Of course you can still use the old way, that is VB6 or C++...
You may use Shell API in javascript to invoke your windows application. This works only in Internet explorer browser. You need to make sure that your browser security settings (At client) is also changed to "run activex controls"
Here is a sample.
I don't know the specific details, but this might point you in the right direction.
For instance, some IRC applications react when you click a link whose target is irc://some.host.com
Same goes for textmate application for mac:
txmt://open?«arguments»
This, however, is only possible if the target application has registered a custom URL schema in the user's machine. Furthermore, the User has to allow access to it.
You could write a ClickOnce application that you can launch from the web page.
If you make it a full-trust application, you can use it to launch the local Windows application. You can pass arguments to the ClickOnce application, which can parse them and pass them on to the local Windows application.
Alternatively, if you are the author of the local Windows application (and if it is C#/.Net) then you could make the Windows application itself a ClickOnce application.

Detect browser URL

Is there a way for a standard C# desktop app to detect the URL that the browser is going to navigate to, and possibly prevent it from doing that? An example would be all those download managers that pop up when I click a link in the browser and prevent browser's default action from occurring.
you can not access to internet browsers from winform projects but
you can access if you have a plug-in app. for browsers.
Develop a plug-in app. and communicate with your winform app. like internet download manager app.
here is expamle for IE add-ons
IE add-on express
for chrome
Google dev guide
hopefully helps it.

How can you open windows program by pressing a button on web page

How can you open windows program by pressing a button on web page
I develop web app in asp.net, and I want to do some action in windows when press button on
the web page,
For example: when you press Messenger button in http://www.msn.com/?ocid=hmlogout
windows live messenger will open in your computer,
Is there a certain technique to do that ?
thanks for any suggestion.
Dani.
This will not work unless you try to upen a URI with an associated protocol on the client.
torrent:// or something like this.
You can either:
open applications associated with a protocol (as citronas said)
use a trusted applet/activex

Categories