MCPcopy Create free account
hub / github.com/MemeTray/MemeTray / initRandomBackground

Function initRandomBackground

tools/common/backgroundConfig.js:33–41  ·  view source on GitHub ↗
(selector = '.desktop')

Source from the content-addressed store, hash-verified

31 * @param {string} selector - Background element selector (defaults to '.desktop')
32 */
33export function initRandomBackground(selector = '.desktop') {
34 try {
35 const desktop = document.querySelector(selector);
36 if (!desktop) return;
37
38 const randomApi = getRandomWallpaper();
39 desktop.style.backgroundImage = `url("${randomApi}")`;
40 } catch (_) {}
41}

Callers 3

script.jsFile · 0.90
script.jsFile · 0.90
script.jsFile · 0.90

Calls 1

getRandomWallpaperFunction · 0.85

Tested by

no test coverage detected