lbtest

test

当前为 2025-01-05 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/522876/1515250/lbtest.js

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

(function() {
    'use strict';

    // 初始化 listPageDocument 变量,用于存储列表页的 document
    let listPageDocument = document;

    // 监听 URL 改变(popstate 事件)
    window.addEventListener('popstate', function(event) {
        // 当 URL 改变时,确保控制列表页的 document
        if (event.state && event.state.page === 'listPage') {
            listPageDocument = document;  // 保持列表页的 document 不变
            console.log("Returned to list page document:", listPageDocument);
        }
    });

    // 在列表页初始化时,确保通过 pushState 保存 URL 状态
    function initializeListPage() {
        if (window.location.pathname !== '/listPage') {  // 你需要根据实际 URL 判断
            window.history.pushState({ page: 'listPage' }, '', '/listPage');
        }
        listPageDocument = document; // 初始化列表页的 document
        console.log("List page initialized with document:", listPageDocument);
    }

    initializeListPage();  // 初始化列表页控制

})();