/* * akp 共通 */ // Function to run when the DOM is fully loaded document.addEventListener("DOMContentLoaded", function () { // Disable right click document.oncontextmenu = function() { return false; }; // Disable drag document.ondragstart = function() { return false; }; // Disable image popup var images = document.getElementsByTagName('img'); for (var i = 0; i < images.length; i++) { images[i].setAttribute('title', ''); } // onclick control for location.href document.addEventListener('click', function (e) { var btn = e.target.closest('button[onclick]'); if (!btn) return; var onclick = btn.getAttribute('onclick'); if (!onclick.includes('location.href')) return; e.preventDefault(); if (btn.dataset.clicked === '1') return; btn.dataset.clicked = '1'; btn.disabled = true; var match = onclick.match(/location\.href\s*=\s*['"](.+?)['"]/); if (match) { location.href = match[1]; } }); });