<script type="text/javascript">
document.onkeydown = function (event) {
event = (event || window.event);
if (event.keyCode == 123 || event.keyCode == 18)
{
return false;
}
}
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
chatGPT:
<script>
document.oncontextmenu = document.onkeydown = function(e) {
if (e.keyCode === 123 || e.type === 'contextmenu') {
e.preventDefault();
}
};
</script>
沒有留言:
發佈留言