WebBrowser control and javascript popup code: "if(popupWnd != null) popupWnd.close()"

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

My app is hosting a WebBrowser control that handles popup window
opening via the NewWindow3 event, and popup window closing via the
WM_PARENTNOTIFY/WM_DESTROY combo. It works fine for the most part.

On a particular web site that has it's own "Back" navigation button, I
get a javascript error when the script tries to access a previously
creating popup window using some javascript like this:

if(popupWnd != null) popupWnd.close()

That script works fine in IE, but not in my hosted WebBrowser.

Any ideas?

Thanks,
Jeff
 
because popupWnd.close() will call your close() method,which written by yourself. This may cause cross-site access. IE will ban it.
 
Back
Top