iwebbrowser2 - file:// delay



Hello,

When a live web page is saved to local storage via the "Save As:"
command in IE, and the page has certain heinous javascript such as the
code below:

<SCRIPT type=text/javascript>
var o = String.fromCharCode(60);
var c = String.fromCharCode(62);
var l = document.location.toString();
l = l.substring(0, l.indexOf(':'));

document.write(o+'script type="text/javascript"
src="'+l+'://ct.360i.com/cgi-bin/ctasp-server.cgi?i=yrsp2aXWAFMsxATr"'+c+o+'/script'+c);
</SCRIPT>

when the page is reloaded from the file system into the iwebbrowser2
control, or IE for that matter, the url generated will be something
like:

file://ct.360i.com/cgi-bin/ctasp-server....

which causes the web browser control to appear to be locked up for
approximately 15-20 seconds. Similar to the way, file explorer will
appear to freeze if you try to navigate to a non existent device.

The authors of the code meant for the page to load from the server the
page was originally loaded from, but the document.location.toString()
returns a value of file: as it should since it was loaded from the file
system. Woops.

Does anyone have any idea how to either - reduce the timeout, or a way
to intercept the call to the file system before its made so that I
could verify the filepath is valid. I have experimented with
InternetSetOption() and INTERNET_OPTION_CONNECT_TIMEOUT with no luck.


Thanks!

Ed

.