111
This commit is contained in:
@@ -33,6 +33,19 @@
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<style>
|
||||
/* 防截图/录屏保护 */
|
||||
body {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body { display: none !important; }
|
||||
}
|
||||
|
||||
/* 启动页样式 */
|
||||
.splash-container {
|
||||
position: fixed;
|
||||
@@ -207,5 +220,37 @@
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 防截图/录屏保护 -->
|
||||
<script>
|
||||
if (!isDev) {
|
||||
// 禁止右键菜单
|
||||
document.addEventListener('contextmenu', function(e) { e.preventDefault(); });
|
||||
|
||||
// 禁止常见快捷键(Ctrl+P打印, Ctrl+S保存, Ctrl+Shift+I开发者工具, F12)
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if ((e.ctrlKey && e.key === 'p') ||
|
||||
(e.ctrlKey && e.key === 's') ||
|
||||
(e.ctrlKey && e.shiftKey && e.key === 'I') ||
|
||||
e.key === 'F12' ||
|
||||
e.key === 'PrintScreen') {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// 窗口失焦时模糊内容,防止后台截图
|
||||
var blurOverlay = document.createElement('div');
|
||||
blurOverlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:#000;z-index:99999;display:none;';
|
||||
document.body.appendChild(blurOverlay);
|
||||
|
||||
window.addEventListener('blur', function() {
|
||||
blurOverlay.style.display = 'block';
|
||||
});
|
||||
window.addEventListener('focus', function() {
|
||||
blurOverlay.style.display = 'none';
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user