30 lines
869 B
JavaScript
30 lines
869 B
JavaScript
// Add this to your game.js file or create a new security.js file
|
|
|
|
// Disable context menu (right-click menu)
|
|
document.addEventListener('contextmenu', function(e) {
|
|
e.preventDefault();
|
|
}, false);
|
|
|
|
// Disable image dragging
|
|
document.addEventListener('dragstart', function(e) {
|
|
if (e.target.tagName.toLowerCase() === 'img') {
|
|
e.preventDefault();
|
|
}
|
|
}, false);
|
|
|
|
// Prevent text selection
|
|
document.body.style.userSelect = 'none';
|
|
document.body.style.webkitUserSelect = 'none';
|
|
document.body.style.msUserSelect = 'none';
|
|
document.body.style.mozUserSelect = 'none';
|
|
|
|
// Disable touch callout on mobile devices
|
|
document.body.style.webkitTouchCallout = 'none';
|
|
|
|
// Optional: Disable saving images on mobile
|
|
document.body.style.webkitTapHighlightColor = 'rgba(0,0,0,0)';
|
|
|
|
// Prevent copying text
|
|
document.body.oncopy = function(e) {
|
|
e.preventDefault();
|
|
}; |