BSNL Portal on Firefox

| 1 Comment

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){
  document.getElementById("hdnBId").value=BId;
  document.getElementById("hdnCid").value=Cid;
...
}
</script>

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.

1 Comment

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 http://portal.bsnl.in/MobilePayments/aspxfiles/circle.aspx
// @include http://portal.bsnl.in/MobilePayments/aspxfiles/celloneoutstandingbills.aspx

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.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.12