mega dl button fix

removes the megasync dl button and replaces it with the inline browser one

目前为 2016-02-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         mega dl button fix
// @version      0.1
// @match        https://mega.nz/*
// @description  removes the megasync dl button and replaces it with the inline browser one
// @grant        none
// @namespace https://greasyfork.org/users/29657
// ==/UserScript==

waitForButton();

function doEverything() {
    msbut = document.getElementsByClassName("with-megasync")[0];
    msbut.style.display = "none";
    inbut = document.getElementsByClassName("throught-browser")[0];
    inbut.className += " red";
}

function waitForButton() {
    buttons = document.getElementsByClassName("throught-browser").length;
    
    if(buttons > 0) {
        doEverything();
    } else {
        setTimeout(waitForButton, 500);
    }
}