Greasy Fork

MOS-cow

fix timeout dialog in support.oracle.com

目前为 2025-03-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         MOS-cow
// @namespace
// @version      0.5
// @description  fix timeout dialog in support.oracle.com
// @author       [email protected]
// @match        https://support.oracle.com/*
// @match        https://mosemp.us.oracle.com/*
// @grant        none
// @namespace 
// ==/UserScript==
setInterval(function() {
    if (typeof AdfPage != 'undefined') {
        var p = AdfPage.PAGE;
        var h = p._userInactivityTimeoutHelper;
        if (h != null) {
            h.initializeTimeout(12000000000);
        }
        p.__cancelSessionTimeoutTimer();
    }
    if (typeof PRESENCE != 'undefined') {
        PRESENCE.DEFAULT_ACTIVE_POLL_INTERVAL=60000;
        PRESENCE.MAX_POLLING_TIME=86400000;
        PRESENCE.MAX_POLL_ERRORS_ALLOWED=100;
        PRESENCE.stopPolling();
        PRESENCE.startPolling();
    }
  }, 10*60*1000);

(function simulateUserActivity() {
    'use strict';

    function triggerMouseMove() {
        let event = new MouseEvent("mousemove", {
            bubbles: true,
            cancelable: true,
            view: window,
            clientX: Math.random() * window.innerWidth,
            clientY: Math.random() * window.innerHeight
        });
        document.dispatchEvent(event);
    }
    setInterval(triggerMouseMove, 1 * 60 * 1000);
})();