mobizen web app

try to take over the world!

目前为 2020-02-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         mobizen web app
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *www.mobizen.com/*
// @icon         https://www.google.com/s2/favicons?domain=www.mobizen.com
// @grant        none
// ==/UserScript==

if (window.location.href.search("/home") == -1) {

    function main() {
        var a = $("div.display-email");
        if (a.length == 0) {
            return;
        }
        clearInterval(loop);
        setTimeout(function() {
            a = a.text();
            if (a == "") {
                loop = setInterval(login, 100);
            } else {
                loop = setInterval(select_host, 100);
            }
        }, 1000);
    }

    function login() {
        var e = $("#signin-button");
        if (e.length == 1) {
            clearInterval(loop);
            setTimeout(function() {
                e.click();
                loop = setInterval(select_host, 100);
            }, 200);
        }
    }

    function select_host() {
        //$("#mobizen-main > div.block-connect > div > label").click();
        var e = $("#mobizen-main > div.device-list > div.devicelist-button.hostlist");
        if (e.length == 1) {
            clearInterval(loop);
            setTimeout(function() {
                e.click();
                //loop = setInterval(select_host, 100);
            }, 200);
        }
    }

    var css = `
#select-device {
z-index: 100;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: 0;
margin-left: -60px;
}
`.replace(/;/g, " !important;");
    var style = document.createElement('style');
    style.innerHTML = css;
    document.getElementsByTagName('body')[0].appendChild(style);

    var loop = setInterval(main, 100);

} else {

    var css = `
#contents {
top: 0;
}
#contents .remote {
margin: unset;
}
#device {
transform: unset;
}
#dialog {
left: 200px;
}
#apps,#widget,#header,#footer {
display: none;
}
#rswp {
width: 360px;
height: 720px;
margin-left: 0;
margin-top: 0;
transform: unset;
}
#rswp > canvas {
width: 360px;
height: 720px;
}
`.replace(/;/g, " !important;");
    var style = document.createElement('style');
    style.innerHTML = css;
    document.getElementsByTagName('body')[0].appendChild(style);

}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址