Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
wp8.1 and the IE11 WebBrowser control do not support execScript, movi…
…ng to 'eval'
  • Loading branch information
purplecabbage committed May 23, 2014
1 parent 14d1371 commit 18ec1c3af674007e48bf34dcdf3fc7ee0be8ba10
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
@@ -42,7 +42,7 @@ public void InjectScript()
cons.error = cons.error || function(msg) { exec('ERROR:' + msg ); };
})(window);";

Browser.InvokeScript("execScript", new string[] { script });
Browser.InvokeScript("eval", new string[] { script });
}

void OnServiceClosing(object sender, ClosingEventArgs e)
@@ -387,7 +387,7 @@ void CordovaBrowser_LoadCompleted(object sender, System.Windows.Navigation.Navig
string nativeReady = "(function(){ cordova.require('cordova/channel').onNativeReady.fire()})();";
try
{
CordovaBrowser.InvokeScript("execScript", new string[] { nativeReady });
CordovaBrowser.InvokeScript("eval", new string[] { nativeReady });
}
catch (Exception /*ex*/)
{
@@ -397,7 +397,7 @@ void CordovaBrowser_LoadCompleted(object sender, System.Windows.Navigation.Navig
string appExitHandler = "(function(){navigator.app = navigator.app || {}; navigator.app.exitApp= function(){cordova.exec(null,null,'CoreEvents','__exitApp',[]); }})();";
try
{
CordovaBrowser.InvokeScript("execScript", new string[] { appExitHandler });
CordovaBrowser.InvokeScript("eval", new string[] { appExitHandler });
}
catch (Exception /*ex*/)
{
@@ -72,7 +72,7 @@ public void InjectScript()

try
{
Browser.InvokeScript("execScript", new string[] { jsCallback });
Browser.InvokeScript("eval", new string[] { jsCallback });
}
catch (Exception)
{
@@ -106,14 +106,14 @@ void page_OrientationChanged(object sender, OrientationChangedEventArgs e)
try
{

Browser.InvokeScript("execScript", new string[] { jsCallback });
Browser.InvokeScript("eval", new string[] { jsCallback });

jsCallback = "var evt = document.createEvent('HTMLEvents');";
jsCallback += "evt.initEvent( 'orientationchange', true, false );";
jsCallback += "window.dispatchEvent(evt);";
jsCallback += "if(window.onorientationchange){window.onorientationchange(evt);}";

Browser.InvokeScript("execScript", new string[] {jsCallback});
Browser.InvokeScript("eval", new string[] {jsCallback});
}
catch (Exception)
{
@@ -255,7 +255,7 @@ public void InjectScript()
})(window, document); ";


Browser.InvokeScript("execScript", new string[] { script });
Browser.InvokeScript("eval", new string[] { script });
}

public bool HandleCommand(string commandStr)

0 comments on commit 18ec1c3

Please sign in to comment.