File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// ==UserScript==
22// @name V2EX 增强
3- // @version 1.1.8
3+ // @version 1.2.0
44// @author X.I.U
55// @description 自动签到、链接转图片、自动无缝翻页、使用 SOV2EX 搜索、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼)
66// @match *://v2ex.com/*
277277 }
278278
279279
280- // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~)
280+ // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~
281281 function soV2ex ( ) {
282282 document . body . appendChild ( document . createElement ( 'script' ) ) . textContent = `
283283 var $search = $('#search')
327327 }
328328
329329
330- // 链接转图片,修改自:https://greasyfork.org/scripts/14182
330+ // 链接转图片
331331 function linksToImgs ( ) {
332332 let links = document . links ;
333333 Array . from ( links ) . forEach ( function ( _this ) {
334334 if ( / ^ h t t p s .* \. (?: j p g | j p e g | j p e | b m p | p n g | g i f ) / i. test ( _this . href ) && ! ( / < i m g \s / i. test ( _this . innerHTML ) ) ) {
335335 _this . innerHTML = `<img src="${ _this . href } " style="max-width: 100%!important;" />` ;
336+ } else if ( / ^ h t t p s : \/ \/ i m g u r \. c o m \/ [ a - z ] + $ / i. test ( _this . href ) ) { // 针对没有文件后缀的 imgur 图床链接
337+ _this . innerHTML = `<img src="${ _this . href } .png" style="max-width: 100%!important;" />` ;
336338 }
337339 } ) ;
338340 }
You can’t perform that action at this time.
0 commit comments