weibo.js
authorChris <chris@roojs.com>
Tue, 21 Jan 2014 02:54:04 +0000 (10:54 +0800)
committerChris <chris@roojs.com>
Tue, 21 Jan 2014 02:54:04 +0000 (10:54 +0800)
weibo.js

index a4f0924..65dd16a 100644 (file)
--- a/weibo.js
+++ b/weibo.js
@@ -21,6 +21,14 @@ function run_weibo(u, p){
 
         //try to login 
         if(document.location.pathname == '/login.php'){
+            
+            var event = document.createEvent("KeyboardEvent");
+            e.keyCode = 13;
+
+            event.initEvent("click", false, true);
+             event.synthetic = true;
+            event.eventType = "click";
+            
             console.log("runing weibo login");
             // fills in the user name and password 
             var els = document.querySelectorAll('input[node-type]');
@@ -32,10 +40,11 @@ function run_weibo(u, p){
                     }
                     if(els[i].getAttribute('node-type') == 'password'){
                         els[i].value = p;
+                        els[i].dispatchEvent(event);
                     }
                 }
             }
-
+/*
             //return;
             // simulating click event to login ....
             var elss = document.querySelectorAll('a[node-type]');
@@ -56,7 +65,7 @@ function run_weibo(u, p){
                 }
             }
 
-
+*/
         }
 
     }