2 function run_weibo(u, p){
3 console.log("runing weibo");
4 if(document.location.host=='weibo.com') {
6 document.location='http://www.google.com';
9 // clear login dialog from weibo.
10 //check and hidden the login dialog and overlay .....
11 var els = document.querySelectorAll('div[node-type]');
13 for (i = 0; i < els.length; i++) {
14 if (els[i].hasAttribute('node-type')) {
15 if(els[i].getAttribute('node-type') == 'outer'){
20 for (i = 0; i < bbc.length; i++) {// hide all the outer.....
21 bbc[i].style.display = 'none';
25 if(document.location.pathname == '/login.php'){
26 console.log("runing weibo login");
27 // fills in the user name and password
28 var els = document.querySelectorAll('input[node-type]');
30 for (i = 0; i < els.length; i++) {
31 if (els[i].hasAttribute('node-type')) {
32 if(els[i].getAttribute('node-type') == 'username'){
35 if(els[i].getAttribute('node-type') == 'password'){
42 // simulating click event to login ....
43 var elss = document.querySelectorAll('a[node-type]');
45 for (i = 0; i < elss.length; i++) {
46 if (elss[i].hasAttribute('node-type')) {
47 if(elss[i].getAttribute('node-type') == 'submitBtn'){
49 console.log("press submit");