How can you programmatically detect if javascript is enabled/disabled in a Windows Desktop Application? (WebBrowser Control)

前端 未结 3 1331
我在风中等你
我在风中等你 2020-12-17 22:59

I have an application which writes HTML to a WebBrowser control in a .NET winforms application.

I want to detect somehow programatically if the Internet Settings hav

3条回答
  •  Happy的楠姐
    2020-12-17 23:30

    Here is a suggestion - Encode the warning into your webpage as default. Create a javascript that runs on page load which removes that element. The warning will be there when ever javascript is not allowed to run.

    It's a long while since I coded client side HTML javascript to interact with the DOM so I may be a little out of date. i.e. you will need to fix details, but I hope I get the general idea across.

    
    

    and in your HTML body

    Please enable Javascript

提交回复
热议问题