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

Function iLog

example/tests/gm_value_test.js:200–217  ·  view source on GitHub ↗
(msg, type = '')

Source from the content-addressed store, hash-verified

198 }
199
200 function iLog(msg, type = '') {
201 reportLog({ msg, type, t: nowTime() });
202
203 if (!iframeShadow) return;
204
205 const logBox = iframeShadow.getElementById('iframe-log');
206 if (!logBox) return;
207
208 const line = document.createElement('div');
209 line.className = 'log-line';
210 line.innerHTML = `
211 <span class="log-time">${escHtml(nowTime())}</span>
212 <span class="log-msg ${escHtml(type)}">${msg}</span>
213 `;
214
215 logBox.appendChild(line);
216 logBox.scrollTop = logBox.scrollHeight;
217 }
218
219 function buildIframeBody() {
220 const accent = ACCENT[frameId] || '#334155';

Callers 4

doSetFunction · 0.85
doDelFunction · 0.85
registerAllListenersFunction · 0.85
removeAllListenersFunction · 0.85

Calls 3

reportLogFunction · 0.85
nowTimeFunction · 0.85
escHtmlFunction · 0.85

Tested by

no test coverage detected