Skip to content

Instantly share code, notes, and snippets.

@rEtSaMfF
Last active April 9, 2021 13:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rEtSaMfF/e258bdcf37ba7f42804b35e06714ac95 to your computer and use it in GitHub Desktop.
Save rEtSaMfF/e258bdcf37ba7f42804b35e06714ac95 to your computer and use it in GitHub Desktop.
Fix MEGA.nz stuff
// ==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