JavaScript Debugger 1.1 patch for 'query-part' bug

Problem:

Early versions of Navigator 4.0x had an inconsistency in how the html parser reported URLs to the javascript engine when the URLs have query parts; i.e. a '?' followed by additional information in the URL. cgi URLs often have these query parts. This caused the debugger to fail in finding the right source to display for a page as it is being debugged. And, thus, made it impossible to debug such pages. The 1.0 version of the debugger shipped without always being able to handle .cgi pages because I never noticed this Navigator oddity. A user then pointed out the problem and I added a workaround for this problem to the 1.1 debugger. All was well. Then in one of the 4.0x Navigator releases (4.05 or 4.06?) someone in the Navigator development team fixed the .cgi inconsistency to deal with some security problem (without me finding out about it). This made my workaround not work and re-broke the debugger.
Fix:

I've created a new version of the one Java class where this original workaround was implemented. This new class simply does not have the 1.1 work around. It should therefore not exhibit the annoying debugger behavior in newer Navigators. It makes no attempt to check Navigator versions or any such thing. Install it only if you need it.

I am not supplying a whole new debugger package. And, since the existing package is a secure signed applet, the installation process is somewhat involved. Please read the below carefully and make sure you understand it before proceeding.

Installation:

  1. This assumes that you have already installed Netscape JavaScript Debugger 1.1 into some directory on your computer (let's call it <Communicator>\Program\JSDebug)

  2. Download and save the new classfile called SourceTextItemLocal.class.

  3. Install this classfile on your machine in a new directory that you need to create under the directory where the debugger is installed called: netscape\jsdebugger\api\local. So, if you have the debugger jarfile at <Communicator>\Program\JSDebug\jsdeb11.jar then the new classfile should be at <Communicator>\Program\JSDebug\netscape\jsdebugger\api\local\SourceTextItemLocal.class

  4. In order to get Java to load this new classfile instead of the existing one located in <Communicator>\Program\JSDebug\jsdeb11.jar you'll need to remove the copy in the .jar file. This can be accomplished using a zipfile tool like winzip. A .jar file is just a zipfile with a different extension. Open <Communicator>\Program\JSDebug\jsdeb11.jar and find the entry for SourceTextItemLocal.class. Now delete that file from the .jar. In winzip you can do this by highlighting the file in the list and pressing the delete key.

    NOTE: You should probably make a backup copy of the existing jsdeb11.jar first - just copy it to some other directory. After removing the .class file from the .jar file you should notice that the .jar file is a little smaller.

  5. Verify that you've done this all correctly by openning the Java Console in Navigator and starting the JavaScript Debugger. When the debugger starts it prints some information into the Java Console. With this patch correctly installed you should see a line that says:

       JSD loaded 'query-part' patched SourceTextItemLocal.class

    This indicates that the new classfile is being correctly loaded. You should now be able to debug into html file with query-part URLs.

  6. If things don't work out or you want to remove the patch then just reinstall the debugger (or just overwrite the hacked jsdeb11.jar with backup copy you made).
All the usual disclaimers apply... This is not an official anything. It is just me hacking on my own. The change has almost zero testing. If it helps you then great. If not then let me know and maybe I can help. But I make no promises and give not assurances.
John Bandhauer <jband@netscape.com>
18 June 1999