handle javascript errors on the client side from arbitrary sites

F

figelwump

Hello,

I'd like to be able to write an application that runs on a Windows XP
machine and can capture and handle javascript errors from any web site
that a user might encounter while using IE on that box. It doesn't
matter what language the application is written in.

I don't know if this is a Javascript question or a Windows component
question. Any ideas/thoughts on how to do this?

Thanks
 
V

VK

Hello,

I'd like to be able to write an application that runs on a Windows XP
machine and can capture and handle javascript errors from any web site
that a user might encounter while using IE on that box. It doesn't
matter what language the application is written in.

It is not clear what do you mean by "handle errors". To force the
script engine to disregard any errors and continue execution? This is
kinda pointless and against the common programming practice. I mean if
an error is cricial (no required object, no requested method etc.) then
how do you suppose to continue this block?

If you mean "bring all errors to the attention of user" then IE already
does it by default (red exclamation sign).

You may extend the latter option by installing free Microsoft Script
Debugger module
<http://en.wikipedia.org/wiki/Microsoft_Script_Debugger>

Now all errors will be displayed consecutively in the debugger window.
Unfortunately this debugger is weak in finding the right line causing
the error, especially with external .js files, so its highlight may be
off the base.

Presumably it is possible to patch jscript.dll so all errors would go
to some external program instead of debugger. This question is related
to C++ programming though, plus I am not sure if such action would be
legal withing your user agreement (smells a lot like reverse
engineering to me). Ask.
 
F

figelwump

Thanks for the response. When I say "handle errors", I mean an
application that can catch JS errors arising from any arbitrary page
that a user browses in IE. The user should then be able to continue
browsing normally (without having to dismiss a JS error dialog).

IE does some level of this if script debugging is disabled, but is not
able to hide all errors from the user. I would like to write a program
that extends this functionality to unconditionally hide any JS error
from the user.

I am not concerned with the continued execution of the JS code; the
user is browsing any arbitrary site and I do not have access to the
code. So, if the site is broken because of a critical JS error that
they did not handle internally, that's fine. Additionally I do not
want to modify the script engine (or any other IE components).

Any ideas on how to do this? Are there any hooks into IE or the script
engine that can be used here?

Thanks
 
V

VK

I would like to write a program
that extends this functionality to unconditionally hide any JS error
from the user.

AFAIK it can be done 90% without any programming:
Tools > Internet Options > Advanced
check Disable script debugging
uncheck Display a notification about every script error

That leaves the red exclamation sign only for something IE will
consider to be too important - but it still doesn't disturb the
browsing, because nothing forces you to double click on it to see
what's happened (and most users simply ignore it).

I do not think so that you can go with the rest 10%, because red sign
is not specially appointed to JScript errors. It is a notification sign
for any events browser considers important to report. Say it will be
shown if site doesn't have P3P politics for cookies, or if it tries to
set a cookie not matching to your cookie security settings, or if you
switch security protocol (on high security) etc. You will really need
to "kill" too many reporters for that. Also I would consider such build
as one with seriously damaged security - and the IE's default one is
not the most shinny under the sun ;-)

Any way, contact IEAK department and ask their advise:
<http://www.microsoft.com/technet/prodtechnol/ie/ieak/default.mspx>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top