Minimeter is a handy Firefox extension that helps keeping an eye on one'Internet usage. I have already blogged about this extension here a while ago.
This extension stopped working for me this week and returned an error whenever it connected to Videotron to fetch my Internet usage statistics. For those looking for a quick fix, clearing Videotron cookies will very probably solve the problem until the next time it occurs.
This is a step by step fix not intended for the faint-hearted users.
The problem
Minimeter uses a regular expression to to parse the Internet usage page returned by Videotron. The extension asks for a statistics in French. This is done by setting the lang parameter in the url to fr
https://extranet.videotron.com/services/secur/extranet/tpia/Usage.do?lang=FRENCH&compteInternet=<videotronAccount>
However, this parameter is ignored, if Videotron has already set your preferred language to English in a cookie. Minimeter expects getting a page in French but gets a page in English instead, so it fails to parse the HTML.
The solution
This is a step by step fix of this problem. The fix will allow Minimeter to properly parse the statistics page, regardless the language. The tutorial below assumes that the user is running Firefox under Ubuntu (10.*+). Though, it is fairly easy to adapt it to other platforms.
- Backup Minimiter's XPI file. This file is located under .mozilla/firefox/<yourProfileId>.default/extensions:
cp {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.xpi _{08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.xpi.minimeter_bkp
2. Change the extention of Minimeter's file from '.xpi' to '.zip'
mv {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.xpi {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.zip
3. Extract the zip file contents using "Archive Manager" or your favorite software. This should create a folder called {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7} under .mozilla/firefox/<yourProfileId>.default/extensions
4. Double-click this new folder, then double-click file minimeter.jar. You should be able to see then directory structure and the files used by Minimeter at this point.
5. Navigate to folder content/monitor, then open file Videotron.js
6. Identify the regular expression used by Minimeter to parse the statistics page HTML
var regDateAndUsed = /\s*[0-9]*-[0-9]*-([0-9]*) (au|to)
[0-9-]*<\/td>\s*([0-9.]*)<\/td>\s*[0-9.]*<\/td>\s*([0-9.]*)<\/td>\s*[0-9.]*<\/td>\s*([0-9.]*)<\/td>\s*[0-9.]*<\/td>\s*<\/tr>/;
7. Replace
au in the regular expression above by (au|to)
8. In Videotron.js, replace line
this.usedVolume = volumeused[4];
with line
this.usedVolume = volumeused[5];
9. Save your changes to Videotron.js and click on update when your are prompted if you want to update file minimeter.jar.
10. Restart Firefox, then click once on Minimeter's icon to force go and fetch data from Videotron instead of using the cache. Et voilĂ .
11. If things go wrong, then you can just rollback by deleting folder {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}, renaming {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.zip to {08ab63e1-c4bc-4fb7-a0b2-55373b596eb7}.xpi and then restarting Firefox.