Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- var re = /^\/\/ @require\s+[\w:\.\/]*\/(\d+)\.user\.js/gim,
- text = GM_info.scriptMetaStr,
- warn = [],
- includes = {};
- try {
- includes = JSON.parse(GM_getResourceText("includes"));
- } catch (e) {
- GM_log("Resource INCLUDES does not exist or is malformed.");
- }
- while (re.exec(text)) {
- var a = RegExp.$1;
- if (a in includes) {
- var i = includes[a].test;
- (function recursive (parent, index) {
- if (index < i.length) {
- if (parent[i[index]]) {
- recursive(i[index], ++index);
- } else {
- warn.push([i.slice(0, 1 + index).join("."), index, a]);
- }
- }
- }(this, 0));
- } else {
- GM_log("#" + a + " is not being managed.");
- }
- }
- if (warn.length) {
- alert("[" + GM_info.script.name + "]\nThe installation was succeeded but the required files are missing:\n" + warn.map(function (a) {
- return "#" + a[2] + "\t\t" + a[0];
- }).join("\n") + "\n\nPlease try installing again later.");
- }
- }());
Advertisement
Add Comment
Please, Sign In to add comment