-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbump-web.user.js
70 lines (59 loc) · 2.26 KB
/
bump-web.user.js
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
// ==UserScript==
// @name BUMP web
// @version 1.1
// @author mudachyo
// @match *://mmbump.pro/*
// @run-at document-start
// @icon https://sun9-16.userapi.com/impg/g93WJxPJtCopVIAqWbzvaGWbkn-LaY-pEyCh1Q/Jvut2jMz7Rc.jpg?size=640x640&quality=95&sign=2f4460fee947b101894f4c274a599bff&c_uniq_tag=hQ43e9wzpBH6S4E0mWytfXtp5gde33mgCvmnGLVj-rI&type=album
// @grant none
// @downloadURL https://github.com/mudachyo/BUMP/raw/main/bump-web.user.js
// @updateURL https://github.com/mudachyo/BUMP/raw/main/bump-web.user.js
// @homepage https://github.com/mudachyo/BUMP
// ==/UserScript==
(function() {
'use strict';
var newUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
Object.defineProperty(navigator, 'userAgent', {
get: function() { return newUserAgent; }
});
Object.defineProperty(navigator, 'platform', {
get: function() { return 'iPhone'; }
});
Object.defineProperty(navigator, 'vendor', {
get: function() { return 'Apple Computer, Inc.'; }
});
function emitTouchEvent(event, touchType) {
var touchObj = new Touch({
identifier: Date.now(),
target: event.target,
clientX: event.clientX,
clientY: event.clientY,
screenX: event.screenX,
screenY: event.screenY,
pageX: event.pageX,
pageY: event.pageY,
radiusX: 2.5,
radiusY: 2.5,
rotationAngle: 10,
force: 0.5,
});
var touchEvent = new TouchEvent(touchType, {
cancelable: true,
bubbles: true,
shiftKey: true,
touches: [touchObj],
targetTouches: [touchObj],
changedTouches: [touchObj],
});
event.target.dispatchEvent(touchEvent);
}
document.addEventListener('mousedown', function(event) {
emitTouchEvent(event, 'touchstart');
});
document.addEventListener('mousemove', function(event) {
emitTouchEvent(event, 'touchmove');
});
document.addEventListener('mouseup', function(event) {
emitTouchEvent(event, 'touchend');
});
})();