[Greasemonkey] Need help fixing a script for GM 0.5

Blake West blakewest at gmail.com
Thu Aug 11 10:32:00 EDT 2005

> Instead of creating a new property on Window.prototype ("_close"), try
> storing the original close method in a script-level global variable.
> var old_close = Window.prototype.close;
> Window.prototype.close = funload;
> ...
> function funload() {
> ...
> if (some condition) {
>   old_close();
> }
> }

Didn't work...

I tried something else to diagnose the problem, and it looks like the
GM script executes after the JS code in the page that closes the
window. The reason for this may be the wretched markup sent to my
innocent browser by Microsoft. Check this out (note that the <head>
element does not get closed:

<script language="Javascript">

function openNewWindow(fileName,windowName,theWidth,theHeight) {
	if (windowName == "newMessageWindow") 
		//generate random window ID

		 windowName = new String(Math.round(Math.random() * 100000));



<script language='javascript'>
    var holdMinutes=5;
    var holdMs=60000 * holdMinutes; //5 min we could get the current
session timeout if we felt like it?
    var L_SessionHasTimedOut_Message = "Your session under this
message has timed out.  You may use this window only to copy any
unsaved work you may have.";

    function holdSession() {

function LaunchForm(szFormPath) {
  openNewWindow(szFormPath +

<body text=000000 onLoad="LaunchForm('frmRoot.asp')">

More information about the Greasemonkey mailing list