Sort Mega.nz files by size

It will sort Mega.nz files by size by auto clicking required buttons after interval of few seconds

目前為 2021-12-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Sort Mega.nz files by size
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  It will sort Mega.nz files by size by auto clicking required buttons after interval of few seconds
// @author       JethaLal_420
// @match        https://mega.nz/folder/*
// @icon         https://www.google.com/s2/favicons?domain=mega.nz
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var listViewBtn, blockViewBtn

    function checkDataLoaded() {
        listViewBtn = document.getElementsByClassName('listing-view')[0]
        blockViewBtn = document.getElementsByClassName('block-view')[0]
    }
    function clickBtn() {
        clearInterval(intervalId)
        setTimeout(() => {
            listViewBtn.click()
            console.log('List View btn Clicked')
            var sizeBtn = document.getElementsByClassName('size')[0]
            setTimeout(()=>{
                sizeBtn.click()
                console.log('Sort By Size btn Clicked')
            },1200)
            setTimeout(()=>{
                blockViewBtn.click()
                console.log('Block View btn Clicked')
            },2100)

        }, 4500)
    }
    let intervalId = setInterval(() => {
        checkDataLoaded()

        if (listViewBtn && blockViewBtn){
            clickBtn()
        }
    }, 1000)
    })();

QingJ © 2025

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