Learn > Browser plugins (plugin.js) > A complete skeleton A COMPLETE SKELETON CrossPoint.registerPlugin(async (container, api) => { const $ = (sel) => container.querySelector(sel); const b64 = (t) => { let s = ''; for (const c of new TextEncoder().encode(t)) s += String.fromCharCode(c); return btoa(s); }; async function loadConfig() { const r = await fetch(api.pluginFile('config.json')); return r.ok ? r.json() : {}; } async function saveConfig(cfg) { await api.writeFile(api.dir + '/config.json', b64(JSON.stringify(cfg))); } container.innerHTML = `

My Plugin

Server URL

`; const cfg = await loadConfig(); $('[data-k=server]').value = cfg.server || ''; $('[data-act=save]').onclick = async () => { try { cfg.server = $('[data-k=server]').value.trim().replace(/\/+$/, ''); await saveConfig(cfg); $('[data-out]').textContent = 'Saved.'; } catch (e) { $('[data-out]').textContent = 'Error: ' + e.message; } }; api.registerAction('ping', async () => ({ server: cfg.server || null })); }); Next: On-device catalogs. End of this folder.