MCPcopy Index your code
hub / github.com/ClearURLs/Addon / loadData

Function loadData

core_js/popup.js:257–267  ·  view source on GitHub ↗

* Loads data from storage and saves into local variable. * * @param name data name * @param varName variable name * @returns {Promise } requested data

(name, varName=name)

Source from the content-addressed store, hash-verified

255 * @returns {Promise<data>} requested data
256 */
257async function loadData(name, varName=name) {
258 return new Promise((resolve, reject) => {
259 browser.runtime.sendMessage({
260 function: "getData",
261 params: [name]
262 }).then(data => {
263 this[varName] = data.response;
264 resolve(data);
265 }, handleError);
266 });
267}
268
269/**
270* Translate a string with the i18n API.

Callers 1

popup.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected