From d2b8ffa3bc1f39466dc42488f4921388fa6602d7 Mon Sep 17 00:00:00 2001
From: xiu2 <54703944+XIU2@users.noreply.github.com>
Date: Thu, 11 May 2023 13:24:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=93=BE=E6=8E=A5?=
=?UTF-8?q?=E8=BD=AC=E5=9B=BE=E7=89=87]=20=E6=94=AF=E6=8C=81=E6=97=A0?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80=E7=9A=84=20imgur=20?=
=?UTF-8?q?=E5=9B=BE=E5=BA=8A=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
V2ex-Enhanced.user.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js
index a87c67f..7b5c6d0 100644
--- a/V2ex-Enhanced.user.js
+++ b/V2ex-Enhanced.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name V2EX 增强
-// @version 1.1.8
+// @version 1.2.0
// @author X.I.U
// @description 自动签到、链接转图片、自动无缝翻页、使用 SOV2EX 搜索、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼)
// @match *://v2ex.com/*
@@ -277,7 +277,7 @@
}
- // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~)
+ // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~
function soV2ex() {
document.body.appendChild(document.createElement('script')).textContent = `
var $search = $('#search')
@@ -327,12 +327,14 @@
}
- // 链接转图片,修改自:https://greasyfork.org/scripts/14182
+ // 链接转图片
function linksToImgs() {
let links = document.links;
Array.from(links).forEach(function (_this) {
if (/^https.*\.(?:jpg|jpeg|jpe|bmp|png|gif)/i.test(_this.href) && !(/
`;
+ } else if (/^https:\/\/imgur\.com\/[a-z]+$/i.test(_this.href)) { // 针对没有文件后缀的 imgur 图床链接
+ _this.innerHTML = `
`;
}
});
}