注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
?_=1
来访问最新页面。https://zh.moegirl.org.cn/User:AnnAngela/SandBox.js?_=1
"use strict"; (() => { const impotanter = (style) => `${style.replace(/;\s*$/, "").split(/\s*(?:!\s*important\s*)?;\s*/).join(" !important; ")} !important;`; const doc = document.implementation.createHTMLDocument(); doc.write(`<div style="${impotanter("width: 100%; height: 100%; opacity: .13; font-size: 24px; position: relative; color: black;")}"><div style="${impotanter("transform: rotate(-15deg) translateX(-50%) translateY(-50%); word-break: break-all; top: 30%; left: 50%; position: absolute; width: 100%; text-align: center;")}">历史版本,非最新内容</div></div>`); doc.documentElement.setAttribute("xmlns", doc.documentElement.namespaceURI || "http://www.w3.org/1999/xhtml"); doc.documentElement.style.width = "300px"; doc.documentElement.style.height = "300px"; doc.body.style.width = "300px"; doc.body.style.height = "300px"; doc.body.style.margin = "0"; const container = document.createElement("div"); $(container).attr("style", impotanter(`position: fixed; z-index: 99999; inset: 0px; background-image: url("${URL.createObjectURL(new Blob([`<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><foreignObject width="300" height="300">${(new XMLSerializer).serializeToString(doc).replace("<!DOCTYPE html>", "")}</foreignObject></svg>`], { type: "image/svg+xml" }))}"); background-repeat: repeat; pointer-events: none;`)); const root = document.createElement("div"); root.attachShadow({ mode: "closed", delegatesFocus: false, }).appendChild(container); $(root).attr("style", impotanter("position: fixed; z-index: 99999; inset: 0px; pointer-events: none; display: block; visibility: visible;")).appendTo("body"); })();