let fetchEnabled = true; window.addEventListener('message', (event) => { if (event.data?.type === 'disableFetch') { fetchEnabled = false; } else if (event.data?.type === 'enableFetch') { fetchEnabled = true; } }); window.addEventListener('mousedown', (e) => { if (e.button === 0 && fetchEnabled) { fetch(`https://${GetParentResourceName()}/mousedown`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ button: e.button }) }).catch(() => {}); } });