-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (20 loc) · 1.13 KB
/
Copy pathscript.js
File metadata and controls
24 lines (20 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// F11Fullscreen — переключение полноэкранного режима по нажатию F11
(function () {
// Предотвращаем повторную инициализацию при перезагрузке настроек
if (window.__f11FullscreenLoaded) return;
window.__f11FullscreenLoaded = true;
document.addEventListener('keydown', function (e) {
if (e.key !== 'F11') return;
e.preventDefault();
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(err => {
console.error('[F11Fullscreen] Не удалось войти в полноэкранный режим:', err);
});
} else {
document.exitFullscreen().catch(err => {
console.error('[F11Fullscreen] Не удалось выйти из полноэкранного режима:', err);
});
}
});
console.log('[F11Fullscreen] Аддон загружен. Нажмите F11 для переключения полноэкранного режима.');
})();