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

Function buildIframeBody

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

Source from the content-addressed store, hash-verified

217 }
218
219 function buildIframeBody() {
220 const accent = ACCENT[frameId] || '#334155';
221
222 document.documentElement.style.cssText = `
223 margin:0;
224 padding:0;
225 width:100%;
226 height:100%;
227 background:#f8fafc;
228 `;
229
230 document.body.style.cssText = `
231 margin:0;
232 padding:0;
233 width:100%;
234 height:100%;
235 background:#f8fafc;
236 overflow:hidden;
237 `;
238
239 document.body.textContent = '';
240
241 const host = document.createElement('div');
242 host.style.cssText = `
243 all:initial;
244 display:block;
245 width:100%;
246 height:100%;
247 `;
248 document.body.appendChild(host);
249
250 iframeShadow = host.attachShadow({ mode: 'open' });
251
252 const sty = new CSSStyleSheet();
253 sty.replaceSync(`
254
255 *, *::before, *::after {
256 all:unset;
257 box-sizing:border-box;
258 }
259
260 #iframe-shell {
261 display:flex;
262 flex-direction:column;
263 gap:6px;
264 width:100%;
265 height:100%;
266 padding:8px;
267 overflow:hidden;
268 background:#f8fafc;
269 color:#0f172a;
270 font-family:'JetBrains Mono','Courier New',monospace;
271 font-size:12px;
272 }
273
274 .iframe-title {
275 display:block;
276 color:${accent};

Callers 1

gm_value_test.jsFile · 0.85

Calls 2

escHtmlFunction · 0.85
replaceSyncMethod · 0.80

Tested by

no test coverage detected