Category Archives: Browser

Auto fare Calculator for Indian cities

Many people either carry copy of auto fare card with them or do remember formula. However, it becomes difficult when you are roaming in multiple cities frequently.

A lot many similar apps available, however they are either platform specific, outdated or requires GPRS or other network connection. Few others are city specific.

This is a very simple attempt to overcome a couple of situations.

The application:

  • Works on almost any mobile with basic browser (internet browsing software)
  • Does not require any GPRS or other connection to run the app
  • Has support for multiple cities of India
  • Support for night fare calculation – based on device time
  • No installation required, just copy to mobile and run
  • No advertisement, no license fee – free and open source
  • Can be very easily updated
  • Has very basic and simple interface, executes and works simply

Grab it : Download http://harit.kotharee.com/app/fareCalc.htm . (Right click to the link and select ‘Save As…’ and save to your computer / or save the copy on your mobile.)

Use it : Open the saved copy of fareCalc.htm from your mobile or equivalent device, in most cases, it should open with default available browser. That’s it. No need to explain further. 🙂

Why HTMLand JavaScript?

  • Most mobile browser supports
  • No formatting / styling required
  • Widest compatibility across mobile platforms
  • No rebuild, easy to update
  • No installation required
  • Easy to share

Chrome and popup policy

Google Chrome has different policy to detect and block popup window.

Generally, a browser blocks popup if it’s automated, i.e. with some JavaScript call on page load or so. Moreover the way state of popup can be known by browsers using JavaScript only.

Chrome is bit smarter in this.

window.open(); is expected to return reference to opened popup window, or null / undefined if popup is blocked.

But, chrome holds reference of so called popup as non null value and still blocks popup.

Below snippet is perfect example to test:

<script language="JavaScript">
<!--
function showpopup()
{
	setTimeout ( "showpopupAfterTime();", 1000 );
}

function showpopupAfterTime()
{
 var popwin = window.open("http://harit.kotharee.com/", "popupwindow",
   "width=400,height=300,resizable,status,menubar,scrollbars");
 popwin.focus();
}
//-->
</script>

<a href="javascript:showpopup()">Click for a pop-up window!</a>

Chrome allows popup only if opened directly, i.e. without any kind of delay through JavaScript or any other means of delay.

So, in the above example, it will work only if showpopupAfterTime(); is called on hyperlink!

%d bloggers like this: