2023年政策修订增补工作正在进行中,欢迎参与!
User:AnnAngela/SandBox.js
跳转到导航
跳转到搜索
注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox/Safari:按住“Shift”的同时单击“刷新”,或按“Ctrl-F5”或“Ctrl-R”(Mac为“⌘-R”)
- Google Chrome:按“Ctrl-Shift-R”(Mac为“⌘-Shift-R”)
- Internet Explorer:按住“Ctrl”的同时单击“刷新”,或按“Ctrl-F5”
- Opera:在“工具→首选项”中清除缓存
- 如果您已登录但该页面出现未登录状态,请尝试在地址栏的地址最后添加代码
?_=1
来访问最新页面。 - 添加代码后的本页地址如下:
-{R|https://moegirl.icu/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");
})();