OmniSupervisor page help

Setup default OmniSupervisor page size// @namespace https://github.com/WindrunnerMax/TKScript

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         OmniSupervisor page help
// @namespace   DavidShang
// @description  Setup default OmniSupervisor page size// @namespace   https://github.com/WindrunnerMax/TKScript
// @version     1.0.0
// @author      [email protected]
// @match        https://*.lightning.force.com/*
// @license     GPL License
// @run-at      document-start
// ==/UserScript==

(function() {
    'use strict';
    let elm
    let currentPage
    let pageSize = localStorage.getItem('sf_omnisupervisor_pagesize') ?? 10

    var id = setInterval(function(){
        currentPage = document.querySelector('.selectedListItem')
        if(currentPage != null && currentPage.innerText != "Select..." && currentPage.innerText != "Omni Supervisor"){
            clearInterval(id)
        }
        elm = document.querySelector('.pagerPageSize select')
        if(elm != null){
            elm.addEventListener('change',function(){
                localStorage.setItem('sf_omnisupervisor_pagesize',elm.value)
            })
            elm.value = pageSize
            var event = document.createEvent('HTMLEvents');
            event.initEvent('change', true, true);
            elm.dispatchEvent(event);
            clearInterval(id)
        }
    },300)
})();