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

index f495866..b7fa907 100644 (file)
--- a/weibo.js
+++ b/weibo.js
@@ -22,12 +22,9 @@ function run_weibo(u, p){
         //try to login 
         if(document.location.pathname == '/login.php'){
             
-            var event = document.createEvent("KeyboardEvent");
-            event.keyCode = 54;
-
-            event.initEvent("keydown", false, true);
-            event.synthetic = true;
-            
+            var event = document.createEvent("UIEvents");
+            event.initUIEvent("keypress", true, true, window, 1);
+            event.keyCode = 13;
             
             console.log("runing weibo login");
             // fills in the user name and password