Kimovil Only Global Phone Versions

Removes non-global phone versions from www.kimovil.com

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Kimovil Only Global Phone Versions
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removes non-global phone versions from www.kimovil.com
// @author       salar2k
// @match        https://www.kimovil.com/en/best-smartphones-antutu
// @icon         https://www.google.com/s2/favicons?domain=kimovil.com
// @grant        none
// @include        *://*.kimovil.com/*
// ==/UserScript==

(function () {
    'use strict';

    function removeNonGlobal() {
        var smartphones = document.querySelectorAll("li.item.smartphone");
        var removedList = [];
        smartphones.forEach((e, index) => {
            var version = e.querySelector('.device-name .version')?.textContent;
            var title = e.querySelector('.device-name .title')?.textContent;

            if (version && !version.includes('Global') && !version.includes('International')) {
                e.remove();

                removedList.push(`${title} - ${version}`);
            }
        });

        if (removedList.length) {
            console.log('Non-global devices removed', removedList);
        }
    }

    removeNonGlobal();

    var scrollTimer = null;
    window.addEventListener("scroll", function () {
        if (scrollTimer)
            this.clearTimeout(scrollTimer);

        scrollTimer = setTimeout(removeNonGlobal, 500);
    });

    // Your code here...
})();