删除洛谷用户主页维护消息,并在用户页面上显示隐藏的介绍
当前为
// ==UserScript==
// @name Luogu看主页
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 删除洛谷用户主页维护消息,并在用户页面上显示隐藏的介绍
// @author dreaum
// @license GPL-3.0-or-later
// @match https://www.luogu.com.cn/user/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Define a function to remove maintenance message
function removeMaintenanceMessage() {
var maintenanceMessage = document.querySelector('div[data-v-429fbdfe][data-v-f9624136][style="background-color: rgb(255, 235, 236); border-radius: 5px; border: 1px solid rgb(225, 50, 56); padding: 1em; font-style: italic;"]');
if (maintenanceMessage) {
maintenanceMessage.remove();
}
}
// Define a function to show hidden introduction
function showHiddenIntroduction() {
var hiddenIntroduction = document.querySelector('div[data-v-e5ad98f0][data-v-429fbdfe][class="introduction marked"][style="display: none;"][data-v-f9624136=""]');
if (hiddenIntroduction) {
hiddenIntroduction.style.removeProperty('display');
}
}
// Remove maintenance message when DOM changes
var observer = new MutationObserver(function(mutationsList, observer) {
for(var mutation of mutationsList) {
if (mutation.type === 'childList') {
removeMaintenanceMessage();
showHiddenIntroduction();
}
}
});
// Start observing changes in the DOM
observer.observe(document.body, { childList: true, subtree: true });
// Remove maintenance message and show hidden introduction immediately
removeMaintenanceMessage();
showHiddenIntroduction();
})();