BSNL Portal on Firefox

| | Comments (1)

I have a BSNL Cellone connection. BSNL has its portal for viewing / paying bills online. This was giving JS errors on FF while working fine on IE. I did not pay too much attention to debugging this. Today, I had enough time at hand and decided to poke around to see what was wrong. Within a few minutes, I was able to spot the error.

<input name="hdnBID" id="hdnBID" type="hidden" />
<input name="hdnCID" id="hdnCID" type="hidden" />
<script language="javascript">
function SubmitForm(BId,Cid){

Simple enough to fix. But however, I was using a flawed approach of trying to replace the SubmitForm function with the correct values. Spent close to an hour reading Dive Into Greasemonkey and a few other documents on greasemonkey when I realised that there was something very much easier.

A few lines of code and this works fine now on FF

(function() {
window.addEventListener("load", function(e) {
var currentElement = document.getElementById("hdnBID");
currentElement.setAttribute("id", "hdnBId");
var currentElement = document.getElementById("hdnCID");
currentElement.setAttribute("id", "hdnCid");
}, false);

May be there are more easier ways, but this solves my problem for now. So if you want to use the BSNL portal on FF, go ahead and install this user script.


anujosy said:

This was highly useful piece of script. Now that BSNL has changed the file location it may be useful to note the following changes in the user script:

// @include
// @include

Josy P. Pullockara

Leave a comment

About this Entry

This page contains a single entry by balaji published on December 26, 2007 11:00 PM.

Sholay - Reloaded was the previous entry in this blog.

Goodbye 2007 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.