-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
93 lines (77 loc) · 2.8 KB
/
Copy pathscript.js
File metadata and controls
93 lines (77 loc) · 2.8 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
function convertImage() {
let inputUrl = document.getElementById("inputUrl").value.trim();
let convertBtn = document.getElementById("convertBtn");
if (!inputUrl.includes("blogger.googleusercontent.com")) {
return;
}
// Extract base URL before "/s" and get file name
let parts = inputUrl.split("/s");
let baseUrl = parts[0]; // Image base URL
let fileName = parts[1].split("/").pop(); // Extract file name
// Construct direct download link
let directLink = `${baseUrl}/s16000-d/${fileName}`;
// Change button to "Copy Link"
convertBtn.innerText = "Copy Link";
convertBtn.classList.add("fade-in");
// Update button click function to copy the link
convertBtn.onclick = function() {
navigator.clipboard.writeText(directLink);
};
}
// --- Right-click / Copy-Protection Code ---
document.addEventListener('contextmenu', e => {
// Input aur Textarea me allow
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return true;
e.preventDefault();
}, { capture: true });
document.addEventListener('selectstart', e => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return true;
e.preventDefault();
}, { capture: true });
document.addEventListener('dragstart', e => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return true;
e.preventDefault();
}, { capture: true });
document.addEventListener('keydown', e => {
if (
e.key === 'F12' ||
(e.ctrlKey && e.shiftKey && ['I','J','C'].includes(e.key)) ||
(e.ctrlKey && ['u','s','p','c','x'].includes(e.key.toLowerCase()))
) {
e.preventDefault();
}
}, { capture: true });
document.addEventListener('copy', e => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return true;
e.preventDefault();
}, { capture: true });
document.addEventListener('cut', e => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return true;
e.preventDefault();
}, { capture: true });
// --- Decoration & Cursor CSS ---
(() => {
const css = `
* {
text-decoration: none !important;
cursor: none !important;
}
a, a:link, a:visited, a:hover, a:active {
text-decoration: none !important;
}
[style*="text-decoration"] {
text-decoration: none !important;
}
/* 👇 Har input aur textarea me cursor/paste enable */
input, textarea {
cursor: text !important;
user-select: text !important;
-webkit-user-select: text !important; /* Mobile support */
caret-color: auto !important; /* blinking text cursor */
}
`;
const style = document.createElement('style');
style.id = 'no-decor-no-cursor';
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
})();