-
Notifications
You must be signed in to change notification settings - Fork 0
/
mega over storage limit file
71 lines (64 loc) · 2.07 KB
/
mega over storage limit file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// ==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;
}