Spaces:
Runtime error
Runtime error
Placebo Deploy commited on
Commit ·
dcd7a3d
1
Parent(s): 0c37fd4
Add DRM protections: Disable copying, selection, right-click, and screenshots
Browse files13 unmodified lines1415161718192021222324252627281124 unmodified lines11531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118813 unmodified lines <link rel="shortcut icon" href="/static/favicon.ico"> <link rel="manifest" href="/static/site.webmanifest"> <style> /* Anti-Copy and Anti-Select Protection */ body { user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } #loader-container { position: fixed; top: 0;1124 unmodified lines sendBtn.addEventListener('click', handleSend); chatInput.addEventListener('keypress', (e) => { if (e.key === 'Enter') handleSend(); }); </script> <!-- Anti-Copy, Anti-Paste, and Anti-Screenshot Protections --> <script> // Disable Right-Click Context Menu document.addEventListener('contextmenu', event => event.preventDefault());
// Disable Copy, Cut, and Paste document.addEventListener('copy', event => { event.preventDefault(); alert('Copying content is disabled for security reasons.'); }); document.addEventListener('cut', event => event.preventDefault()); document.addEventListener('paste', event => event.preventDefault());
// Disable Dragging of Elements (like images) document.addEventListener('dragstart', event => event.preventDefault());
// Disable Keyboard Shortcuts (Ctrl+C, Ctrl+P, Ctrl+S, PrintScreen) document.addEventListener('keydown', event => { if (event.ctrlKey && (event.key === 'c' || event.key === 'C' || event.key === 'p' || event.key === 'P' || event.key === 's' || event.key === 'S')) { event.preventDefault(); } if (event.key === 'PrintScreen') { // Attempt to obscure screen during PrintScreen (works on some OS) document.body.style.opacity = '0'; setTimeout(() => { document.body.style.opacity = '1'; }, 1000); navigator.clipboard.writeText(''); // Attempt to clear clipboard } }); </script></body>
</html>src/static/index.html+39