Last active
April 9, 2021 13:19
-
-
Save rEtSaMfF/e258bdcf37ba7f42804b35e06714ac95 to your computer and use it in GitHub Desktop.
Fix MEGA.nz stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name fixMEGA | |
// @namespace fixMEGA | |
// @version 2017-03-08 | |
// @description Fix MEGA.nz stuff | |
// @include https://mega.nz/* | |
// @run-at document-idle | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.slim.min.js | |
// ==/UserScript== | |
function fixMEGA() { | |
$('.nw-fm-tree-header.folder-link').find('input') | |
.val($('.nw-tree-panel-header span').text().trim()) | |
.attr('readonly', false) | |
.css('color', 'black') | |
.css('background-color', 'white') | |
.css('font-size', '8px') | |
.css('text-align', 'center'); | |
} | |
function checkReady() { | |
if ($('.nw-fm-tree-header.folder-link').length && | |
$('.nw-tree-panel-header span').length) { | |
if ($('.nw-tree-panel-header span').text().trim() == "My folders") { | |
return setTimeout(checkReady, 1000); | |
} | |
return fixMEGA(); | |
} else { | |
return setTimeout(checkReady, 2000); | |
} | |
} | |
setTimeout(checkReady, 3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment