MEGA.nz Ultimately Import /

快速廣告鏈接旁路腳本

< 腳本MEGA.nz Ultimately Import /的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2024-03-31

After the script kept showing errors, I reviewed it and found a minor error. Please verify the correction and resend.
// ==/UserScript==

(function() {
'use strict';

// Reference [Angular loaded detect]: https://stackoverflow.com/a/31970556/9182265
var initWatcher = setInterval(function () {
if (window.MegaUtils) {
clearInterval(initWatcher);
hookImport();
hookFull();
console.info('Functions 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; // Corrected assignment
}

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;
};

§
發表於:2024-03-31

The script appears to be mostly functional, but there is an error in the comment section:
/*
if (opSize === -1) {
opSize = data.mstrg;
}
...

The commented-out code suggests that opSize should be set to data.mstrg if it is equal to -1. However, the actual assignment is missing.
To fix this, you can uncomment the code and add the assignment: opSize = data.mstrg;

發表回覆

登入以回復

QingJ © 2025

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