MCPcopy
hub / github.com/Tampermonkey/tampermonkey / metaCheck

Function metaCheck

src/background.js:3507–3535  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

3505 };
3506
3507 var metaCheck = function(r) {
3508 running++;
3509
3510 var getmeta = function(o) {
3511 var meta_found = !!o.meta;
3512 var hash_different = meta_found && !!o.meta[cUSOHASH] && o.meta[cUSOHASH] != r.script.hash;
3513 var version_found = meta_found && !!o.meta.version;
3514 var version_newer = version_found && (!r.script.version || versionCmp(o.meta.version, r.script.version) == eNEWER);
3515
3516 // check script source in case:
3517 if (!meta_found || // no meta data was found
3518 hash_different || // hash has changed
3519 !version_found || // meta data does not contain version info
3520 version_newer) { // we noticed a newer version
3521
3522 if (V || UV) console.log("bg: hash of script " + r.script.name + " has changed or does not exist! running version check!");
3523 r.meta = o.meta;
3524 r.metasrc = o.metasrc;
3525 r.hash_different = hash_different;
3526 realCheck(r);
3527 } else {
3528 if (V || UV) console.log("bg: hash of script " + r.script.name + " has NOT changed (" + o.meta[cUSOHASH] + ").");
3529 }
3530 running--;
3531 checkNoUpdateNotification();
3532 };
3533
3534 getMetaData(r.script, getmeta);
3535 };
3536
3537 var one = false;
3538

Callers 1

background.jsFile · 0.85

Calls 1

getMetaDataFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…