lbtest

test

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

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

  1. (function() {
  2. 'use strict';
  3.  
  4. // 初始化 listPageDocument 变量,用于存储列表页的 document
  5. let listPageDocument = document;
  6.  
  7. // 监听 URL 改变(popstate 事件)
  8. window.addEventListener('popstate', function(event) {
  9. // 当 URL 改变时,确保控制列表页的 document
  10. if (event.state && event.state.page === 'listPage') {
  11. listPageDocument = document; // 保持列表页的 document 不变
  12. console.log("Returned to list page document:", listPageDocument);
  13. }
  14. });
  15.  
  16. // 在列表页初始化时,确保通过 pushState 保存 URL 状态
  17. function initializeListPage() {
  18. if (window.location.pathname !== '/listPage') { // 你需要根据实际 URL 判断
  19. window.history.pushState({ page: 'listPage' }, '', '/listPage');
  20. }
  21. listPageDocument = document; // 初始化列表页的 document
  22. console.log("List page initialized with document:", listPageDocument);
  23. }
  24.  
  25. initializeListPage(); // 初始化列表页控制
  26.  
  27. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址