From ad11cc94012b254c92cbc4f14d526e7776d65824 Mon Sep 17 00:00:00 2001 From: g_it Date: Sun, 15 Mar 2026 14:27:24 +0100 Subject: [PATCH] . --- content/assets/js/protect.js | 29 +++++++++++++++++++++++++++++ content/overrides/main.html | 29 +---------------------------- 2 files changed, 30 insertions(+), 28 deletions(-) create mode 100755 content/assets/js/protect.js diff --git a/content/assets/js/protect.js b/content/assets/js/protect.js new file mode 100755 index 0000000..162517e --- /dev/null +++ b/content/assets/js/protect.js @@ -0,0 +1,29 @@ +// PROTECT.js +// Protect the site's content + +// Prevent right-click context menu +document.addEventListener('contextmenu', function (e) { + e.preventDefault(); +}); + +// Prevent text selection +document.addEventListener('selectstart', function (e) { + e.preventDefault(); +}); + +// Block Ctrl+C and other keyboard shortcuts for copying +document.addEventListener('keydown', function (e) { + if (e.ctrlKey && e.key === 'c') { // Blocks Ctrl+C + e.preventDefault(); + } + if (e.ctrlKey && e.shiftKey && e.key === 'v') { // Blocks Ctrl+Shift+V + e.preventDefault(); + } +}); + +// Additional measures for image protection +document.addEventListener('contextmenu', function (e) { + if (e.target.tagName.toLowerCase() === 'img') { + e.preventDefault(); + } +}); diff --git a/content/overrides/main.html b/content/overrides/main.html index 5612f44..bb2a468 100755 --- a/content/overrides/main.html +++ b/content/overrides/main.html @@ -49,33 +49,6 @@ {{ super() }} - + {% endblock %}