Sindbad~EG File Manager

Current Path : /home/beeson/public_html/WebMathXpert/Demos/ProblemLibraryDemo/
Upload File :
Current File : //home/beeson/public_html/WebMathXpert/Demos/ProblemLibraryDemo/DisableBackButton.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Warn on Back Navigation</title>
    <script>
        function warnOnBackNavigation(event) {
            event.preventDefault();
            event.returnValue = '';
            return '';
        }

        window.addEventListener('beforeunload', warnOnBackNavigation);

        function preventBackNavigation() {
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function(event) {
                history.pushState(null, null, location.href);
                alert("Navigation is disabled on this page.");
            });
        }

        window.onload = preventBackNavigation;
    </script>
</head>
<body>
    <h1>Page with Navigation Warning</h1>
    <p>Try using the browser's back button. It should prompt a warning before navigating away from this page.</p>
</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists