// ==UserScript== // @name 保存列表设置 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 保存会办会签列表的宽度设置! // @author You // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @match http://*.zhbg.kjt.gx.gov/* // @run-at context-menu // ==/UserScript== (function() { 'use strict'; // Your code here... //设置列表宽度 for (let i = 1; i <= 9; i++) { saveColSize(i); } function saveColSize(index){ let node = document.querySelector("#pane-hbhq_1 > div > div > div.el-table__header-wrapper > table > colgroup > col:nth-child(" + index + ")"); //保存到本地 localStorage.setItem("table_column_" + index, node.width); } })();