modified logic to exectute the passed function if there's an argument
This is sort-of a working patch where it attaches the Cordova object into Navigator. Many thanks to the Tizen implementation