MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / runCheck

Function runCheck

src/background.js:3344–3384  ·  view source on GitHub ↗
(initial)

Source from the content-addressed store, hash-verified

3342 if (!force && Config.values.scriptUpdateCheckPeriod == 0) return;
3343
3344 var runCheck = function(initial) {
3345 if (showResult) {
3346 var t = I18N.getMessage('Script_Update');
3347 var msg = I18N.getMessage('Check_for_userscripts_updates') + '...';
3348 notify.show(t, msg, chrome.extension.getURL("images/icon128.png"), 5000);
3349 }
3350
3351 console.log("bg: check for script updates " + (id ? ' for ' + id : ''));
3352 var cb = function(updatable, obj) {
3353 if (updatable) {
3354 try {
3355 var install = function(clicked) {
3356 if (clicked) {
3357 var gotId = function(id, close) {
3358 var ss = { tabid: id,
3359 url: obj.url,
3360 src: obj.code,
3361 ask: true,
3362 cb : close,
3363 hash: obj.newhash !== undefined ? obj.newhash : null };
3364 addNewUserScript(ss);
3365 };
3366 getValidTabId(null, gotId);
3367 }
3368 };
3369
3370 var msg = I18N.getMessage('There_is_an_update_for_0name0_avaiable_', obj.name) + '\n' + I18N.getMessage('Click_here_to_install_it_');
3371 var t = I18N.getMessage('Just_another_service_provided_by_your_friendly_script_updater_');
3372 if (Config.values.notification_silentScriptUpdate) {
3373 install(true);
3374 } else {
3375 notify.show(t, msg, chrome.extension.getURL("images/icon128.png"), Config.values.scriptUpdateHideNotificationAfter, install);
3376 }
3377 } catch (e) {
3378 console.log("bg: notification error " + e.message);
3379 }
3380 }
3381 if (callback) callback(updatable);
3382 };
3383 ScriptUpdater.updateUserscripts(0, showResult, id, cb);
3384 };
3385
3386 var prepare = function() {
3387 var last = getUpdateCheckCfg();

Callers 1

execFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…