I have written a small javascript program embeded in the webpage “Your life is in your hands”(right click and save it) to regulate my internet usage. It has many nice features that many commercial software are lacking.
1. record weekly and daily internet usage, and display it in a table, so one can be constantly reminded his/her internet usage
2. each session is limited to a certain minutes (10 min by default)
3. the interval between two visist is also limited (20 min by default)
4. no more than a certain times and minutes allowed for each day (20 times and 60 minutes per day)
5. blocked time period for no internet use
6. automatic close the main window, but not those windows not opened by javascript. It’s the javascript problem, not mine
7. open source, it’s written in javascript and HTML.
Free as in the freedom, free for everybody.
But you may need some modifications in your system (just firefox or IE settings):
quote from the source code:
// Make this HTML page as your IE or firefox homepage, preferably in your local hard drive
// so that whenever you start IE or firefox, it will record and check your internet usage
//
// because both firefox and IE have restrictions on executing script,
// you need to make following modifications in your system
//
// for firefox, change this following general preference in your firefox directory
// “..mozillafirefoxgreprefsall.js”
// around line 420: change to pref(”dom.allow_scripts_to_close_windows”,true); i.e., change false to true
// if not, javascript won’t close the window
//
// for IE: go to the internet options under the tool menu, go to the advanced tab
// go down to the “security” section and make sure that
// the line “allow active content to run in files on my computer” is checked, i.e., allowed.
// otherwise you need to turn on javascript every time you open it
//
// TIP: you can clear the cookie in your browser to reset the record. ![]()
I have struggled to limit my internet usage for a long time. Surfing online practically caused all the distractions I am suffering now. Sure there are many spyware or keyloggers commerically available but they are too untrustworthy. You don’t want something to record your keytyping and send it around. Besides, I don’t have money to pay these stuff. So I decided to write my own tool.
It occurred to me that this kind of software is simple but not that simple. I ended up spending the whole weekend to develop it. The result is quite satisfactory, at least to me.
My idea is straightforward. Create a homepage for the web browser. Whenever the browser is launched, it records and checks my internet usage. Natually, the programming language is javascript plus HTML. Cookie is used to record the internet usage. Yes, I can use other languages such as php plus mySQL to record and analysis my internet usage, but that would be too much. Other people won’t be able to use it at their own computers anyway.
I never “seriously” programmed javascript before (except for a few frivirous little tricks for webpages). So it surprised me that there are so many confusions in javascript and quite some incompatibilities between IE and firefox (generally I found firefox sucks, or maybe IE sucks too). As always, 80% of my time was spent on debugging, and mostly due to the stupidities of browsers, my code.
Keep it simple, stupid.