A lightweight solution for preventing a user from opening the browser DevTools on a given website.
Try live demo here.
Simply include the script in the <head> of your HTML doument like so:
<script src='https://dooovid.github.io/detect-devtools/antidbg.min.js'></script>