473,466 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

WebBrowser ignore javascript errors

In my c# program ive got a WebBrowser control in which a certain
website is called.
This website gives for some reason a javascript errors (message box)
from time to time. Is there a way to build my program so that the
javascript errors dont appear ?

i search many article but i don't solve

i'm try next

private void axWebBrowser1_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
// excute javascript error
SHDocVw.WebBrowser b = (WebBrowser)e.pDisp;
mshtml.HTMLDocumentClass c =
(HTMLDocumentClass)b.Document;
mshtml.HTMLWindow2Class w =
(HTMLWindow2Class)c.parentWindow;

try
{
w.HTMLWindowEvents2_Event_onerror +=new
HTMLWindowEvents2_onerrorEventHandler(w_HTMLWindow Events2_Event_onerror);
m_ScriptErrorHandleTable.Add(e.uRL, w);
}
catch(Exception e10)
{
SSTrace.Trace( e10 );
}
}

private void w_HTMLWindowEvents2_Event_onerror(string description,
string url, int line)
{
try
{
HTMLWindow2Class w =
(HTMLWindow2Class)m_ScriptErrorHandleTable[url];
w.@event.returnValue = true;
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
}

this is half success. several frames web page is not work well on
javascript error

i do too
http://support.microsoft.com/default.aspx?scid=kb;en-us;261003

public int Exec( ref Guid pguidCmdGroup, int nCmdID, int nCmdexecopt,
object[] pvaIn, object[] pvaOut )
{
switch( nCmdID )
{
case (int)OLECMDID.OLECMDID_SHOWSCRIPTERROR:
// how do program this
break;
}
}

OLECMDID_SHOWSCRIPTERROR event is not fire
anyone help me.. thank you

ps) i'm not american. so my english expression is poor.. understanding
me

May 2 '06 #1
0 4854

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
6
by: Shane Story | last post by:
I am trying to add the Microsoft Web Browseractive X control to a vb.net form. I always get an error on the EndInit line. Parts of the errors says: "Unknown error" "First Chance...
1
by: eskildb | last post by:
First, please be gently. I am fairly new to the programming world (1.5 years with some expermentation prior to). I have been working on a project that has to print HTML pages with graphics in a...
1
by: eskildb | last post by:
First, please be gently. I am fairly new to the programming world (1.5 years with some expermentation prior to). I have been working on a project that has to print HTML pages with graphics in a...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: Sin Jeong-hun | last post by:
I've found that if a MessageBox (called by alert/confirm from Javascript) or a web page modeless dialog is popped up, I cannot call Navigate of the WebBrowser control. If I do, a COM exception...
4
by: Robson Siqueira | last post by:
Folks, I am facing a problem. I am trying to manipulate the HTML data (thru the Document and DocumentText properties) of the WebBrowser object (System.Windows.Forms). The problem is that the...
4
by: kimiraikkonen | last post by:
Hi, Just to test, i placed a simple webbrowser to login a site, this site has no problems and has same error with IE6 SP2 but it's suppressed as well and no problem with Firefox browser, but using...
11
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.