add script to avoid automatic logout from Webkincstár
This commit is contained in:
commit
57d4946b03
28
webkincstar_no_logout.js
Normal file
28
webkincstar_no_logout.js
Normal file
@ -0,0 +1,28 @@
|
||||
// ==UserScript==
|
||||
// @name Webkincstár No Logout
|
||||
// @namespace https://esoko.eu/
|
||||
// @version 0.1
|
||||
// @description Avoid automatic logout from Webkincstár
|
||||
// @author Bence Pőcze
|
||||
// @match https://webkincstar.allamkincstar.gov.hu/*
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function calculateTimeout() {
|
||||
const MIN_TIMEOUT = 30000;
|
||||
const MAX_TIMEOUT = 90000;
|
||||
|
||||
return Math.floor(MIN_TIMEOUT + Math.random() * (MAX_TIMEOUT - MIN_TIMEOUT));
|
||||
}
|
||||
|
||||
const fakeMouseEvent = new MouseEvent('mousemove', {view: window, bubbles: true, cancelable: true});
|
||||
|
||||
setTimeout(function moveMouse() {
|
||||
console.debug(new Date() + ': moveMouse by Webkincstár No Logout');
|
||||
document.body.dispatchEvent(fakeMouseEvent);
|
||||
setTimeout(moveMouse, calculateTimeout());
|
||||
}, calculateTimeout());
|
||||
})();
|
Loading…
Reference in New Issue
Block a user