Repository navigation
Expand file tree
/
Copy pathScrollBookmarkletGreasemonkey.user.js
More file actions
executable file
·51 lines (45 loc) · 1.83 KB
/
Copy pathScrollBookmarkletGreasemonkey.user.js
File metadata and controls
executable file
·51 lines (45 loc) · 1.83 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
// ==UserScript==
// @name Hotkeyed Scroller
// @version 1.0.4
// @downloadURL https://raw.githubusercontent.com/Alien714/ScrollScript/refs/heads/main/ScrollBookmarkletGreasemonkey.user.js
// @updateURL https://raw.githubusercontent.com/Alien714/ScrollScript/refs/heads/main/ScrollBookmarkletGreasemonkey.user.js
// @grant none
// ==/UserScript==
// # identifier for IDs
// . identifier for Classes
// no identifier for Element type
(function() {
'use strict';
document.addEventListener('keydown', function(e) {
// Check for Ctrl + Y
if (e.ctrlKey && e.code === 'KeyY') {
switch (true) {
case window.location.host === "www.xvideos.com":
(document.querySelector("#content")).scrollIntoView();
scrollBy(0, -1);
break;
case window.location.host === "members.ftvgirls.com":
(document.querySelector("#player")).scrollIntoView();
scrollBy(0, -1);
break;
case window.location.host === "www.pornhub.com":
(document.querySelector(".video-wrapper")).scrollIntoView();
break;
case window.location.host === "www.eporner.com":
(document.querySelector("#EPvideo")).scrollIntoView();
delay();
scrollBy(0, -1);
break;
default:
(document.querySelector("video")).scrollIntoView();
scrollBy(0, -1);
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function delay(ms) {
await sleep(ms);
}
}, false);
})();