From 473383c60d6cfcb3fd1eb4340b9a5d3c72974f50 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:57:24 +0800 Subject: [PATCH] v1.0 --- main.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main.js diff --git a/main.js b/main.js new file mode 100644 index 0000000..e56e8eb --- /dev/null +++ b/main.js @@ -0,0 +1,30 @@ +// ==UserScript== +// @name No Misskey Side Timeline +// @namespace https://github.com/omg-xtao +// @version 1.0 +// @description 移除预览 Misskey 实例时的站点时间线 +// @author omg-xtao +// @match http*://*/* +// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + function remove_dom(n) { + var dom = document.querySelector("#misskey_app > div.mk-app > div.side > div.dashboard > div > div.x69lt.x2yRw"); + if (dom !== null) { + dom.remove(); + console.info(`%c No Misskey Side Timeline %c 已移除此页面包含的时间线`, "color:white;background:green;font-weight:bold","color:red"); + } else { + if (n < 60) { + setTimeout(() => { + remove_dom(n + 1); + }, 1000); + } + } + } + + remove_dom(1); +})();