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 %}