🚫Disable F12

Javascript

Add CDN to head, and script to footer (close tag body)

//Disable f12
<script disable-devtool-auto src='https://cdn.jsdelivr.net/npm/disable-devtool@latest' url='https://evps.vn/warning'></script>
<script>
DisableDevtool({
    ondevtoolopen(type, next){
        alert('Devtool opened with type:' + type);
        next();
    }
});
</script>

WordPress

Add snippet to function.php

//Disable f12
function evps_block_devtool(){
ob_start(); ?>
<script disable-devtool-auto src='https://cdn.jsdelivr.net/npm/disable-devtool@latest' url='https://evps.vn/warning'></script>
<script>
DisableDevtool({
    ondevtoolopen(type, next){
        alert('Devtool opened with type:' + type);
        next();
    }
});
</script>
<?php }
echo ob_get_clean();
add_action('wp_head', 'evps_block_devtool');

Last updated