lbtest

test

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyfork.org/scripts/522876/1515300/lbtest.js

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

(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.');
    });
})();