diff --git a/Libraries/Cordova/framework/CordovaView.xaml.cs b/Libraries/Cordova/framework/CordovaView.xaml.cs index 5d149f4..6416416 100644 --- a/Libraries/Cordova/framework/CordovaView.xaml.cs +++ b/Libraries/Cordova/framework/CordovaView.xaml.cs @@ -327,7 +327,7 @@ void GapBrowser_LoadCompleted(object sender, System.Windows.Navigation.Navigatio void GapBrowser_Navigating(object sender, NavigatingEventArgs e) { - DebugConsole.WriteLine("GapBrowser_Navigating to :: " + e.Uri.ToString()); + //DebugConsole.WriteLine("GapBrowser_Navigating to :: " + e.Uri.ToString()); // TODO: tell any running plugins to stop doing what they are doing. // TODO: check whitelist / blacklist // NOTE: Navigation can be cancelled by setting : e.Cancel = true; diff --git a/Libraries/IE.Debug.Core/DebugTraceListener.cs b/Libraries/IE.Debug.Core/DebugTraceListener.cs index 27f9eb4..00ac292 100644 --- a/Libraries/IE.Debug.Core/DebugTraceListener.cs +++ b/Libraries/IE.Debug.Core/DebugTraceListener.cs @@ -1,13 +1,4 @@ using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; namespace IE.Debug.Core { diff --git a/Libraries/IE.Debug.Core/IE.Debug.Core.csproj b/Libraries/IE.Debug.Core/IE.Debug.Core.csproj index 9cf607a..dbcf7e8 100644 --- a/Libraries/IE.Debug.Core/IE.Debug.Core.csproj +++ b/Libraries/IE.Debug.Core/IE.Debug.Core.csproj @@ -60,6 +60,10 @@ {FC6A1A70-892D-46AD-9E4A-9793F72AF780} WP7CordovaClassLib + + {5F99E641-C43E-49A2-A771-06FC091BE010} + Support + diff --git a/Libraries/IE.Debug.Core/Scripting.cs b/Libraries/IE.Debug.Core/Scripting.cs index 32e8dc7..50ac255 100644 --- a/Libraries/IE.Debug.Core/Scripting.cs +++ b/Libraries/IE.Debug.Core/Scripting.cs @@ -24,6 +24,13 @@ public static string BuilInjectScript(string link) link); } + public static string BuilInjectInlineScript(string text) + { + return String.Format( + @"var head = document.getElementsByTagName('head')[0]; var sc1 = document.createElement('script');sc1.innerHTML = '{0}';sc1.type = 'text/javascript'; (head || document.body).appendChild(sc1);", + text); + } + public static string PhoneGapInjectScript { get {return BuilInjectScript(PhoneGapLink); } diff --git a/Libraries/IE.Debug.Core/WebPageDebugger.cs b/Libraries/IE.Debug.Core/WebPageDebugger.cs index 36625b5..5f4b48b 100644 --- a/Libraries/IE.Debug.Core/WebPageDebugger.cs +++ b/Libraries/IE.Debug.Core/WebPageDebugger.cs @@ -9,6 +9,9 @@ using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; +using System.IO.IsolatedStorage; +using System.IO; +using Support; namespace IE.Debug.Core { @@ -36,12 +39,34 @@ public static void InstallDebugConsole() browser.InvokeScript("eval", new string[] { Scripting.PhoneGapInjectScript }); browser.InvokeScript("eval", new string[] { Scripting.BuilInjectScript(@"http://mshare.akvelon.net:8184/cordova-init.js")}); } + + public static void ConnectWeinerDebugger() + { + ConnectWeiner(); + } + public static void InstallFirebug() { browser.InvokeScript("eval", new string[] { Scripting.FirebugInjectScript }); //(@"function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened')();"); } + public static void ExecuteCustomScript(string script) + { + browser.InvokeScript("eval", new string[] { script}); + } + + public static void ConnectWeiner() + { + + browser.InvokeScript("eval", new string[] { @"window.WeinreServerId='wp7'" }); + browser.InvokeScript("eval", new string[] { @"window.WeinreServerURL='http://debug.shadow.adobe.com:8080'" }); + + browser.InvokeScript("eval", new string[] { FileUtils.ReadFileContent("app/www/wp-hacks.js") }); + browser.InvokeScript("eval", new string[] { FileUtils.ReadFileContent(@"app/www/target-script-min.js") }); + + } + public static void InjectTestScript() { browser.InvokeScript("eval", new string[] { Scripting.BuilInjectScript(Scripting.TestLink) }); diff --git a/Libraries/Support/Support.csproj b/Libraries/Support/Support.csproj index f151bea..0a18725 100644 --- a/Libraries/Support/Support.csproj +++ b/Libraries/Support/Support.csproj @@ -50,6 +50,7 @@ + diff --git a/WindowsPhone/Controls/PageHostControl.xaml b/WindowsPhone/Controls/PageHostControl.xaml index b8b35c5..d6f858e 100644 --- a/WindowsPhone/Controls/PageHostControl.xaml +++ b/WindowsPhone/Controls/PageHostControl.xaml @@ -15,8 +15,8 @@ - + VerticalAlignment="Stretch" StartPageUri="http://microsoft.com" /> +