example of javascript that shuts MSIE down

aloha, y'all!

during the 14 december 2000 teleconference, we discussed whether self-closing events should be accorded the same treatment as self-spawning events...  since there were several persons on the call who could confirm that such actions occur, and yet no one could precisely identify the scripting necessary to cause a self-closing event within a UA, nor evidence that such things occur in the wild, other than in the cases cited by tim (choosing to log out from an online banking interface causes a self-close routine to be called, but the user is prompted before shutting down) and me (popup windows that contain advertisements which open when one chooses a live audio stream at some cybercasting sites that then self-close, presumably upon a timing mechanism, or when the helper application they have called begins buffering the stream)...

and then, today, while pursuing completely different quarry, I stumbled across an example of a browser-specific self-closing call in the wild:
  <http://www.xox.pl/~sharpy/main1.html>

if one loads this URI using MSIE (at least, MSIE 5.5, which is what i am currently running), one gets an IE-generated error message which states:

quote
This page doesn’t support MSIE. Please, upgrade to Lynx.
unquote

and then the window--and the open instance of IE that spawned it—closes... IE shuts down suddenly and completely without warning, UNLESS one has more than one instance of IE running, in which case the error message of which david and tim spoke during the telecon (“The web page you are viewing is trying to close this window. Do you want to close this window? Yes No”) is generated, and the user has the choice of whether to allow the author's intent to be actualized, or is provided with a means of blocking it slash instructing the UA to ignore it, before it is processed...

here's the JavaScript that performs the action:

<SCRIPT LANGUAGE="JavaScript">
<!--
  var uagent=navigator.userAgent;
  if (uagent.indexOf("MSIE") == 25) {
  alert( 'This page doesnt support MSIE. \nPlease, upgrade to Lynx.' )
  self.close() 
    }
//-->
</SCRIPT>

so, at least, now the WG knows what ERT tools & UAs developers wishing to repair (or offer their users the option to block the author’s intent) will be searching for--the string “self.close” inside a script...

by the way, I hacked the script a bit and tried to get Netscape 6 to choke on the javascript, but NN6 doesn’t work at all well, let alone harmoniously with JFW, at least on my machine, so I’m not quite sure what transpired, but I think I only succeeded in getting NN6 to attempt to loop back to a file named “index” which it expected the UA to find in the same directory in which the test page that contained the script resides...

oh, and if anyone ends up at the index page for the site whose URI is listed above and wonders what the hell i was doing there, i was trying to find out who it was who had mirrored a bunch of my pages on site geographically located in poland, whether they were being auto-translated (unfortunately, not), and what kind of site it was that was mirroring them...  i'm still not sure what the purpose of the site is, other than to champion lynx and, at least ostensively, a closer spirit of kinship with animals than most web surfers are probably comfortable contemplating...  in any event, the mirrored versions of the pages are quite old, and it was in the hopes of securing an eddress to which to report this that i discovered for myself how MSIE 5.5 handles self.close calls from javascript...

gregory, who is still struggling to stay online

-------------------
Email sent using AnyEmail from http://www.hicom.net

Received on Saturday, 16 December 2000 03:46:14 UTC