incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [5/13] wp7 commit: fetch meta viewport on page load
Date Sat, 28 Apr 2012 00:26:43 GMT
fetch meta viewport on page load


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/3676534a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/3676534a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/3676534a

Branch: refs/heads/master
Commit: 3676534a2b3880e9693cf713a0244f82ebbfa40a
Parents: c341247
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Thu Apr 26 18:57:25 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Thu Apr 26 18:57:25 2012 -0700

----------------------------------------------------------------------
 framework/Cordova/BrowserMouseHelper.cs |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/3676534a/framework/Cordova/BrowserMouseHelper.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/BrowserMouseHelper.cs b/framework/Cordova/BrowserMouseHelper.cs
index 3e02971..6af02ad 100644
--- a/framework/Cordova/BrowserMouseHelper.cs
+++ b/framework/Cordova/BrowserMouseHelper.cs
@@ -95,6 +95,20 @@ namespace WP7CordovaClassLib
 
         void Browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs
e)
         {
+
+            string metaScript = "(function() { return document.querySelector('meta[name=viewport]').content;
})()";
+            string scriptRet = null;
+
+            try
+            {
+                string eval = _browser.InvokeScript("eval",new string[] {metaScript}) as
string;
+            }
+            catch (Exception)
+            {
+
+            }
+
+
             try
             {
                 _browser.InvokeScript("execScript", MinifiedMouseScript);


Mime
View raw message