lbtest

test

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/522876/1515300/lbtest.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

(function() {
    var listPageDocument = document; // 缓存列表页的 `document`
    
    // 保存该 `document` 为一个全局变量
    window.listPageDocument = listPageDocument;
    // 初始化一个局部函数来操作列表页的 DOM
    function operateOnListPage(data) {
        console.log('dqdocument',window.listPageDocument)
        const listItems = document.querySelectorAll('.list-item');
        listItems.forEach(item => {
            if (item.textContent.includes(data.itemName)) {
                item.style.display = 'none';  // 根据数据隐藏对应项
            }
        });
    }

    // 监听来自其他页面的数据传递
    window.addEventListener('message', function(event) {
        if (event.data && event.data.type === 'dataFromDetailPage') {
            console.log('Received data from detail page:', event.data);
            operateOnListPage(event.data);  // 处理列表页的 DOM
        }
    });

    // 监听页面获取焦点时,确保操作的是列表页的 document
    window.addEventListener('focus', function() {
        console.log('List page is focused. Now operating on list page document.');
    });
})();