Permalink
Browse files

updated childbrowser plugin

  • Loading branch information...
1 parent c558609 commit 6e5111163102b8b51a6e629d65c1b4c978c7dbbf sgrebnov committed Dec 1, 2011
Showing with 9 additions and 3 deletions.
  1. +6 −0 WindowsPhone/ChildBrowser/ChildBrowser.js
  2. +3 −3 WindowsPhone/ChildBrowser/ChildBrowserCommand.cs
@@ -46,6 +46,12 @@ ChildBrowser.prototype.showWebPage = function(loc,geolocationEnabled)
var success = function(msg)
{
console.log("ChildBrowser.showWebPage success :: " + msg);
+
+ var event = JSON.parse(msg);
+
+ if (event.type == "locationChanged") {
+ ChildBrowser._onLocationChange(event.location);
+ }
};
var error = function(e)
@@ -172,23 +172,23 @@ public void close(string options="")
void browser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
- string message = "{type:\"locationChanged\",location:\"" + e.Uri.AbsoluteUri + "\"}";
+ string message = "{\"type\":\"locationChanged\", \"location\":\"" + e.Uri.AbsoluteUri + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.OK, message);
result.KeepCallback = true;
this.DispatchCommandResult(result);
}
void browser_NavigationFailed(object sender, System.Windows.Navigation.NavigationFailedEventArgs e)
{
- string message = "{type:\"navigationError\",location:\"" + e.Uri.AbsoluteUri + "\"}";
+ string message = "{\"type\":\"navigationError\",\"location\":\"" + e.Uri.AbsoluteUri + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.ERROR, message);
result.KeepCallback = true;
this.DispatchCommandResult(result);
}
void browser_Navigating(object sender, NavigatingEventArgs e)
{
- string message = "{type:\"locationAboutToChange\",location:\"" + e.Uri.AbsoluteUri + "\"}";
+ string message = "{\"type\":\"locationAboutToChange\",\"location\":\"" + e.Uri.AbsoluteUri + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.OK, message);
result.KeepCallback = true;
this.DispatchCommandResult(result);

0 comments on commit 6e51111

Please sign in to comment.