ВК ФИЛЬТР ПОИСКА ПО ВЕРЕФИКАЦИИ

Скрыть все сообщения, кроме верефецированых

目前為 2024-06-09 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         ВК ФИЛЬТР ПОИСКА ПО ВЕРЕФИКАЦИИ
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Скрыть все сообщения, кроме верефецированых
// @author       Your Name
// @match        https://vk.com/search/*
// @grant        none
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @license MIT
// ==/UserScript==

(function($) {
    'use strict';

    // Function to hide unverified posts
    function hideUnverifiedPosts() {
        $('div._post.post.page_block.post--withPostBottomAction.post--with-likes.closed_comments.deep_active.Post--redesign').each(function() {
            const post = $(this);
            const isVerified = post.find('a[href="/verify"]').length > 0;
            if (!isVerified) {
                console.log(`Hiding post with ID: ${post.data('post-id')}`);
                post.hide();
            }
        });
    }

    // Initial run to hide unverified posts
    hideUnverifiedPosts();

    // Observer to hide unverified posts on new content load
    const observer = new MutationObserver(hideUnverifiedPosts);
    observer.observe(document.body, { childList: true, subtree: true });

    // Log to indicate the script is running
    console.log('Hide Unverified Posts userscript is running.');
})(jQuery);