logo

Crowdly

What will be the output of the following Java program? // Disable ...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

What will be the output of the following Java program?

// Disable copy, paste, text selection, and right-click context menu

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false");

// Prevent new tab and new window shortcuts

window.addEventListener("keydown", function(event) {

if ((event.ctrlKey && event.key === 't') || (event.ctrlKey && event.key === 'n')) {

event.preventDefault();

alert("Opening a new tab or window is not allowed during the quiz.");

// Close the current tab or new window immediately

window.close();

}

});

// Detect and close the tab if the user tries to switch away from it

document.addEventListener("visibilitychange", function() {

if (document.visibilityState === "hidden") {

alert("Please stay on this tab to complete the quiz.");

// Reload the page if user tries to leave the tab

location.reload();

}

});

// Block certain key combinations for opening developer tools

window.addEventListener("keydown", function(event) {

if ((event.ctrlKey && event.shiftKey && event.key === 'i') || // Ctrl+Shift+I

(event.ctrlKey && event.shiftKey && event.key === 'j') || // Ctrl+Shift+J

(event.ctrlKey && event.shiftKey && event.key === 'c') || // Ctrl+Shift+C

(event.ctrlKey && event.key === 'u')) { // Ctrl+U

event.preventDefault();

alert("Developer tools are disabled during the quiz.");

}

});

document.oncopy = new Function("return false");

document.onpaste = new Function("return false");

document.onselectstart = new Function("return false");

document.oncontextmenu = new Function("return false");

0%
0%
0%
100%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на lms.upes.ac.in?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!