MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / mRefreshKV

Function mRefreshKV

example/tests/gm_value_test.js:931–954  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

929 }
930
931 async function mRefreshKV() {
932 const { kvTable, myKey: mk, accent } = refs();
933
934 kvTable.innerHTML = '';
935
936 for (const k of ALL_KEYS) {
937 const v = await GM_getValue(k, undefined); // main frame
938 const own = k === mk;
939
940 const card = document.createElement('div');
941 card.className = 'kv-card';
942
943 if (own) card.style.borderColor = accent + '88';
944
945 card.innerHTML = `
946 <div class="kv-key">${escHtml(k)}${own ? ' <i>(mine)</i>' : ''}</div>
947 <div class="kv-val" style="${own ? `color:${accent};font-weight:700` : ''}">
948 ${fmtVal(v)}
949 </div>
950 `;
951
952 kvTable.appendChild(card);
953 }
954 }
955
956 function registerMainListeners(isReregister = false) {
957 for (const key of ALL_KEYS) {

Callers 2

registerMainListenersFunction · 0.85
gm_value_test.jsFile · 0.85

Calls 3

refsFunction · 0.85
escHtmlFunction · 0.85
fmtValFunction · 0.85

Tested by

no test coverage detected