OmniSupervisor page help

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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)
})();