I'm not able to navigate to a certain URL when I'm using the following command:
window.location.href = "http://google.com";
In my cordova config.xml file I already specified to access to all sources using the default cordova setting with the wildcard:
<access origin="*" subdomains="true" />
Here is what location prints to the console:
Location {replace: function, assign: function, ancestorOrigins: DOMStringList, origin: "file://", hash: ""…}
ancestorOrigins: DOMStringList
assign: function () { [native code] }
hash: ""
host: ""
hostname: ""
href: "file:///android_asset/www/index.html"
origin: "file://"
pathname: "/android_asset/www/index.html"
port: ""
protocol: "file:"
reload: function reload() { [native code] }
replace: function () { [native code] }
search: ""
toString: function toString() { [native code] }
valueOf: function valueOf() { [native code] }
__proto__: Location
I'm running my application in Android with the cordova 5.1.1 version.
Sometimes, the default access settings aren't enough, i don't really know why, but i think i know how to patch this.
Try to install this plugin :
And then, in your config.xml, add this line
Compile again and tell me how it's going on ! :)