我的滑鼠手勢

一個簡單的滑鼠手勢腳本

< 腳本我的滑鼠手勢的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2024-03-14

Has a very serious issue: it stores closed pages for reloading, but never prunes the list, ever! So after few years your list will grow to 10s of 1000s of records, and closing pages will become very slow. I can't believe the author didn't think about his humongous flaw in the current code logic.
To fix it, change:

let closedTabs = GM_getValue("closedTabs", []);

To:

let closedTabs = []; // keeps last tab only, in which case you could simplify code further as you don't need a list at all

Or if you want to keep say the last 10 tans (otherwise surely you'll use the Firefox history, not unclose 10+ tabs via gestures):

let closedTabs = GM_getValue("closedTabs", []).slice(-9); // keep last 9 in list and will append the closing tab = 10

Alternatively, if you don't want to change the code, periodically go in edit mode, click "values" tab and click the bin icon next to "closedTabs".

§
發表於:2024-03-22

To keep only 1 tab and not keep/manage a list, make those 2 changes:

Gesture:

'RL': () => {
GM_openInTab(GM_getValue("closedTabs", ""), false);
}

beforeunload event listener:

window.addEventListener("beforeunload", () => {
GM_setValue("closedTabs", window.location.href);
}

I also noticed the link stored is not always working (e.g. an eBay auction saved link is not working), so you could remove this functionality altogether and use the "Undo closed tab" button from the toolbar instead, which does always work.

Peer Zeng作者
§
發表於:2024-07-12

Thank you very much for your feedback, this issue does exist.
In order to be as compatible with past habits as possible, I will adopt a plan to keep the last 10 browsing history.

發表回覆

登入以回復

QingJ © 2025

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