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" />
+
diff --git a/WindowsPhone/CordovaSourceDictionary.xml b/WindowsPhone/CordovaSourceDictionary.xml
index 2fd9911..b68cbcc 100644
--- a/WindowsPhone/CordovaSourceDictionary.xml
+++ b/WindowsPhone/CordovaSourceDictionary.xml
@@ -4,5 +4,7 @@
+
+
diff --git a/WindowsPhone/IE.Debug.WindowsPhone.csproj b/WindowsPhone/IE.Debug.WindowsPhone.csproj
index b09730b..f7e05ef 100644
--- a/WindowsPhone/IE.Debug.WindowsPhone.csproj
+++ b/WindowsPhone/IE.Debug.WindowsPhone.csproj
@@ -93,6 +93,7 @@
+
PreserveNewest
@@ -106,6 +107,7 @@
PreserveNewest
+
Designer
diff --git a/WindowsPhone/Views/MainPage.xaml b/WindowsPhone/Views/MainPage.xaml
index dea2004..e6319ca 100644
--- a/WindowsPhone/Views/MainPage.xaml
+++ b/WindowsPhone/Views/MainPage.xaml
@@ -15,12 +15,16 @@
shell:SystemTray.IsVisible="True"
xmlns:local="clr-namespace:IE.Debug.WindowsPhone.Controls">
-
+
-
-
-
+
+
+
@@ -38,7 +42,10 @@
-
+
+
+
+
diff --git a/WindowsPhone/Views/MainPage.xaml.cs b/WindowsPhone/Views/MainPage.xaml.cs
index 13e1475..2063413 100644
--- a/WindowsPhone/Views/MainPage.xaml.cs
+++ b/WindowsPhone/Views/MainPage.xaml.cs
@@ -17,6 +17,7 @@
using IE.Debug.Core;
using IE.Debug.WindowsPhone.Controls;
using Microsoft.Phone.Shell;
+using Microsoft.Phone.Info;
namespace IE.Debug.WindowsPhone.Views
{
@@ -38,6 +39,22 @@ private void ActionRunFirebug(object sender, EventArgs e)
{
WebPageDebugger.InstallFirebug();
}
+
+ private void ActionConnectWeinreDebugger(object sender, EventArgs e)
+ {
+ WebPageDebugger.ConnectWeinerDebugger();
+ }
+
+ private void ActionClearPerfLog(object sender, EventArgs e)
+ {
+ WebPageDebugger.ExecuteCustomScript("window.profiler.reset();");
+ }
+
+ private void ActionGetPerfLog(object sender, EventArgs e)
+ {
+ WebPageDebugger.ExecuteCustomScript("console.log($dumpProfileJSON (window.profiler));");
+ }
+
private void ActionInstallDebugConsole(object sender, EventArgs e)
{
WebPageDebugger.InstallDebugConsole();