0% found this document useful (0 votes)
62 views

Tempermonkeymega

This userscript bypasses the import limit and removes warnings about space usage on MEGA.nz. It does this by modifying MEGA's JavaScript code: 1. It hooks the checkGoingOverStorageQuota function to always resolve the promise instead of rejecting for large imports. 2. It sets the showOverStorageQuota function to null to prevent warnings from being displayed about exceeding storage quotas. 3. Together these changes allow unlimited imports and remove warnings about space usage on the MEGA website.

Uploaded by

Aye
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Tempermonkeymega

This userscript bypasses the import limit and removes warnings about space usage on MEGA.nz. It does this by modifying MEGA's JavaScript code: 1. It hooks the checkGoingOverStorageQuota function to always resolve the promise instead of rejecting for large imports. 2. It sets the showOverStorageQuota function to null to prevent warnings from being displayed about exceeding storage quotas. 3. Together these changes allow unlimited imports and remove warnings about space usage on the MEGA website.

Uploaded by

Aye
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// ==UserScript==

// @name MEGA.nz Ultimately Import


// @name:zh-TW MEGA.nz Ultimately Import /
// @name:zh-CN MEGA.nz Ultimately Import
// @namespace methusela
// @version 0.1
// @description Bypass import limit on Mega Web client & remove warning about the
space usage
// @author d0gkiller87
// @match chrome-extension://bigefpfhnfcobdlfbedofhhaibnlghod/*
// @match http://mega.co.nz/*
// @match http://mega.io/*
// @match http://mega.is/*
// @match http://mega.nz/*
// @match https://mega.co.nz/*
// @match https://mega.io/*
// @match https://mega.is/*
// @match https://mega.nz/*
// @icon https://mega.nz/favicon.ico?v=3
// @run-at document-end
// @grant none
// ==/UserScript==

(function() {
'use strict';
// Reference [Augular loaded detect]:
https://stackoverflow.com/a/31970556/9182265
var initWatcher = setInterval(function () {
if (window.MegaUtils) {
clearInterval(initWatcher);
hookImport();
hookFull();
console.info('FUNtions Hooked!');
}
}, 500);
})();

var hookImport = function () {


MegaUtils.prototype.checkGoingOverStorageQuota = function(opSize) {
var promise = new MegaPromise();
loadingDialog.pshow();

M.getStorageQuota()
.always(function() {
loadingDialog.phide();
})
.fail(promise.reject.bind(promise))
.done(function(data) {

/*
if (opSize === -1) {
opSize = data.mstrg;
}

if (opSize > data.mstrg - data.cstrg) {


var options = {custom: 1, title: l[882], body: l[16927]};

M.showOverStorageQuota(data, options)
.always(function() {
promise.reject();
});
}
else {
*/
promise.resolve();
});
return promise;
};
}

var hookFull = function () {


FileManager.prototype.showOverStorageQuota = null;
}

You might also like