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

Function write

src/syncinfo.js:333–361  ·  view source on GitHub ↗
(callback, retry)

Source from the content-addressed store, hash-verified

331
332
333 var write = function(callback, retry) {
334 var selfargs = arguments;
335 var again = function() {
336 selfargs.callee.apply(this, selfargs);
337 };
338 if (_lock) {
339 window.setTimeout(again, 500);
340 return;
341 };
342
343 if (retry === undefined) retry = _retries;
344 var cb = function(f) {
345 var e = chrome.runtime ? chrome.runtime.lastError : f;
346 if (e) {
347 console.log("si: error on write " + e.message);
348 if (--retry > 0) window.setTimeout(again, _syncwait);
349 } else {
350 _syncObjects = {};
351 }
352 _lock = false;
353 };
354 _lock = true;
355
356 try {
357 chrome.storage.sync.set(_syncObjects, cb);
358 } catch (e) {
359 cb(e);
360 }
361 };
362
363 var list = function(callback) {
364 if (_timeoffset === null) {

Callers

nothing calls this directly

Calls 1

cbFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…