Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6687271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:16:07+00:00 2026-05-26T05:16:07+00:00

i have found that WebBrowser control (both Winforms and WPF) has certain javascript constructs

  • 0

i have found that WebBrowser control (both Winforms and WPF) has certain javascript constructs not supported especially when they are rendered using showModalDialog / showModelessDialog calls….

This is easily reproducible…

1) Create a test html page such as C:\Temp\Test.htm with this code..

    <input type=button
           onclick="showModalDialog('C:\\Temp\\Test.htm');"
           value="Show Me as Modal Page." />
    <BR />
    <a href="javascript:alert('I am shown.')">
       I should work using href.
    </a>
    <BR />
    <a href="#"
       onclick="javascript:alert('I am shown.')">
       I should work using onclick.
    </a>

If you load the page above using the IE browser, both hyperlinks should work. Now in the IE browser, if you you click the “Show Me as Modal Page.” button, the same page opens as MSHTML dialog window and again on that both hyperlinks work.

This is expected.

2) Now create a WPF or WinForm app hosting WebBrowser control sourced to “C:\Temp\Test.htm”

    <WebBrowser Source="C:\Temp\Test.htm" Height="500" Width="500"/>

If you run the app and load the test page using the WebBrowser control, both hyperlinks will work on the loaded page.

But if you load the modal window using the “Show Me as Modal Page.” button, then the modal window fails to alert using the first hyperlink i.e. I should work using href. does not appear.

Second hyperlink works as expected.

Do you guys reckon is there a workaround for the first hyperlink to work?

In my case I have no access to the page’s content that I am loading using the javascript:showModalDialog() call, so the issue fix is intended from the web browser’s perspective.

EDIT

They say that FEATURE_SCRIPTURL_MITIGATION has to be enabled for this. But it is already enabled in my registry. The MSDN continues to say …

By default, this feature is enabled for Internet Explorer and disabled
for applications hosting the WebBrowser Control. It has to be manually enabled for
webBrowser control.

How to enable this for the web browser control?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:16:08+00:00Added an answer on May 26, 2026 at 5:16 am

    MSDN :

    This feature is not supported for applications hosting the WebBrowser
    Control
    .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Webbrowser control that I am using to generate thumbnails of web
I have an .Net Froms application that displays web pages through a WebBrowser control.
I have a winForm panel that has a flash ative x control embedded in
I have found a javascript function that inverts colors on webpage: String javascript =
I have found that my HTML is, to be honest, very clunky. Small, simple
I have found that there is generally a singe type or namespace that takes
I have found that how to determine what columns are primary key column of
I have found that I often have to implement some sort of a scheduler
I have found that creating a zip file using the Zip task provided by
We have found that with our memcache some keys tend to be lost. To

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.