(() => { return (_, resources) => { class ImageViewer { constructor(url) { this.url = url; if ($(".image-viewer").length === 0) { this.createDom(); } this.viewer = $(".image-viewer-container"); this.downloadImage(); } createDom() { $("body").append(resources.data.imageViewerDom.text); resources.applyStyle("imageViewerStyle", "image-viewer-style"); $(".image-viewer-container .close").on("click", () => this.hide()); } downloadImage() { const xhr = new XMLHttpRequest(); xhr.open("GET", this.url.replace("http:", "https:"), true); xhr.responseType = "blob"; xhr.onload = () => { const title = document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili", ""); const data = URL.createObjectURL(xhr.response); this.imageData = data; this.viewer.find(".download") .attr("href", data) .attr("download", title); this.viewer.find(".image") .prop("src", data); }; xhr.send(); } show() { this.viewer.addClass("opened"); $("html,body").addClass("image-viewer-opened"); } hide() { this.viewer.removeClass("opened"); $("html,body").removeClass("image-viewer-opened"); } } SpinQuery.any(() => $("span.settings-category"), settingsCategories => { SpinQuery.any(() => $("meta[itemprop='image']"), metaData => { if (metaData.length > 0) { $(settingsCategories .filter((_, e) => e.innerHTML === "视频与直播")) .parent() .after(`