|  | 
 
 发表于 2025-7-25 12:39:19
|
显示全部楼层 
| 本帖最后由 S8F8ry 于 2025-7-25 12:40 编辑 
 可以使用类似于下面这样的油猴脚本:
 
 复制代码// ==UserScript==
// @name         Record Select
// @version      0.1.0
// @description  description
// @author       dragonish
// @namespace    https://github.com/dragonish
// @license      GNU General Public License v3.0 or later
// @match        *://*/*
// @grant        none
// ==/UserScript==
(function () {
  const selects = document.querySelectorAll('select');
  selects.forEach((select, index) => {
    const savedValue = sessionStorage.getItem('select_' + index);
    if (savedValue) {
      select.value = savedValue;
    }
  });
  selects.forEach((select, index) => {
    select.addEventListener('change', () => {
      sessionStorage.setItem('select_' + index, select.value);
    });
  });
})();
 | 
 |