Skip to content

Commit 61c870c

Browse files
committed
start
1 parent cb692b9 commit 61c870c

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.DS_Store

0 Bytes
Binary file not shown.

dist/secure-web.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,18 @@ function noScreenshot(options, overlayId) {
173173
// Disable pointer events on body while the overlay is active
174174

175175
document.body.style.pointerEvents = 'none';
176-
177176
document.addEventListener('keydown', escListener);
178177

178+
179+
// mobile screenshot prevention
180+
window.addEventListener('touchstart', handleTouchStart);
181+
179182
function escListener(event) {
180183
if (event.key === 'Escape') {
181184
HideOverlayScreen(overlayId);
182185
// document.body.removeChild(overlay);
183186
// document.body.style.pointerEvents = 'auto'; // Re-enable pointer events on body
184-
// document.removeEventListener('keydown', escListener);
187+
//document.removeEventListener('keydown', escListener);
185188
}
186189
}
187190

@@ -260,6 +263,19 @@ function HideOverlayScreen(overlayId) {
260263
//document.removeEventListener('keydown', escListener);
261264
}
262265

266+
function handleTouchStart(event) {
267+
const now = new Date().getTime();
268+
const timeSinceLastTouch = now - lastTouchTime;
269+
lastTouchTime = now;
270+
271+
// Check if it's a three-finger touch and the time interval between touches is short
272+
if (event.touches.length === 3 && timeSinceLastTouch < 250) {
273+
event.preventDefault();
274+
275+
alert('Three-finger screenshot prevented');
276+
}
277+
}
278+
263279
if (isNode) {
264280
module.exports = noScreenshot;
265281
}else{

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "secure-web",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Secure-Web is an npm package that prevents users from taking screenshots of your web page by securing it against various methods of screenshot capture. With customizable options to tailor the security measures according to your needs, Secure-Web ensures that your sensitive information remains protected and inaccessible to unauthorized individuals. Embrace the power of Secure-Web and take control of your online security today.",
55
"main": "dist/secure-web.js",
66
"scripts": {

0 commit comments

Comments
 (0)