Tuesday, December 18, 2007

Getting the ISP javascript file

If you're going to dig around in the files below be sure to have a backup of your Net Usage directory so you can copy everything back if needed. I'm going to assume an intermediate level of knowledge of computers and Windows for this blog. If I've glossed over too many parts please leave a comment and I will update the blog entry as required.

Information on each Australian ISP is recorded in the isps.js file. If you have installed an additional country pack it will be in a file called isps_xx.js where xx is a two letter country abbreviation. Don't go searching your computer for these files yet, you wont be able to find them because they have been stored in a JAR file.

There is heaps of information on the Internet about Firefox JAR and XPI files. To cut a long story short, the JAR and XPI files are just a normal ZIP file. Therefore if you want to get your ISP javascript files you need to rename your JAR files to a ZIP file and then extract the ISP javascript file you want to edit.

This is how it's done (on XP):
  1. Go to the Firefox Profile in your Application Data directory by entering %AppData%\Mozilla\firefox\Profiles\ in the Run command on the Start Menu. Navigate to the Extentions directory in your profile. Mine is at
    C:\Documents and Settings\Gerard\Application Data\Mozilla\firefox\Profiles\8ndbqffi.default\extensions
  2. Hit CTRL + F and find netusageitem.jar (if your are using an Additional ISP pack you will need to find netusageisps.jar)
  3. In the Find Results window right click on the result and select Open Containing Folder. You should end up in your extensions chrome directory.
  4. Copy the netusageitem.jar and call it netusageitem.jar.bak so you have a backup in case things go bad.
  5. Now copy the netusageitem.jar file again but rename it netusageitem.zip
  6. You should now have three files in your chrome directory netusageitem.jar.bak, netusageitem.zip and netusageitem.jar (if you are editing an Additional ISP pack you should have netusageisps.jar.bak, netusageisps.zip and netusageisps.jar)

  7. I use Winzip so you may need to change the process slightly for your compression software. You want to extract the isps.js or the isps_xx.js file from the zip file you have just created. When you extract the file you will need to extract it with folder names. Using Winzip, double click on the netusageitem.zip file. You will be presented with a list of files in the zipfile. Click on isps.js and click the Extract button.

  8. Now ensure the Extract to: path is the chrome path for your extension. Ensure the Selected files/folders is marked and Use folder names is ticked. Click Extract. Close Winzip.



  9. The chrome folder you are in should now contain a content folder. In the content folder is the isps.js or isps_xx.js file you will need to edit.


I use notepad++ to edit my javascript files. It is small, free, has syntax highlighting and can open more than one file at a time. Open the javascript file and have a look. We still have some more setting up to do before we can start the editing process.



7 comments:

Anonymous said...

Looks good. Will try it tonight.. Thanks for the blog and keep it up!!

Anonymous said...

hmmm.. tutorial start well but.. I suppose non experienced users will find the most difficult thing to do is pharsing info/data from isp pages.. so it will be very useful to help about writing pharse script for particular provider.. to explain what for example s4 error mean, what cause it,how to find elements on page and etc.. 10q, ewoks, vbjelak@yahoo.com

Anonymous said...

"Over the next few blogs I will explain in detail how to edit the source file and create your own script for your ISP."

I'm sorry, but is there a step missing from these instructions? I'm not a programmer or anything so I've just been following your every step word for word (which has been very detailed). Up until the step where you actually edit the isps.js file.

More information on this would be great. Thanks

Unknown said...

the above two comments are both correct. I've been very busy and unable to complete the blog For the moment.
However, if you want to contact me directly gedm@emears.com with problems you are having I will happily answer them and help you (turn around emails are about 24 hours) or skype me on mearsg for a more direct answer.
I can them collate the emails and questions which will assist me in wring the next blog.
Also, the developer has a page at http://netusage.iau5.com/ispjs.html which gives some great detail but may confuse you a bit at first. Feel free to contact me to ask for help. I'm only too glad to help you.
Thanks for the feedback.

Carlos Eduardo said...

Hi
I'm also one of those who needs a hand modifying the ips.js script file...
The tutorial for that would be much appreciated...
If could give us a walk through or some examples it would be great...
Or maybe helping scripting...
Thanks for your help
all the best

The amature flying chef said...

Hi, would you like us to update the isps_au.js file. Comcen had changed recently and I've changed the isps.js file. Would be happy to submit it back to your trunk.

Unknown said...

Hi Chef,
you should email the changed script to lpgcritter(at)nasquan[dot]com
He'll add it to his trunk.

Thanks