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.4
3+ // @version 1.1.5
44// @author X.I.U
55// @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼)
66// @match *://v2ex.com/*
218218
219219 // 后台签到
220220 function qianDao_ ( qiandao , timeNow ) {
221- let url = ( location . origin + "/mission/daily/redeem?" + RegExp ( "once\\=(\\d+)" ) . exec ( document . querySelector ( 'div#Top .tools' ) . innerHTML ) [ 0 ] ) ;
221+ let url = ( location . origin + "/mission/daily/redeem?" + RegExp ( "once\\=(\\d+)" ) . exec ( document . querySelector ( 'div#Top .tools, #menu-body ' ) . innerHTML ) [ 0 ] ) ;
222222 GM_xmlhttpRequest ( {
223223 url : url ,
224224 method : 'GET' ,
225225 timeout : 5000 ,
226226 onload : function ( response ) {
227227 let html = ShowPager . createDocumentByString ( response . responseText ) ;
228+ console . log ( html )
228229 if ( html . querySelector ( 'li.fa.fa-ok-sign' ) ) {
229230 html = html . getElementById ( 'Main' ) . textContent . match ( / 已 连 续 登 录 ( \d + ?) 天 / ) [ 0 ] ;
230231 GM_setValue ( 'menu_clockInTime' , timeNow ) ; // 写入签到时间以供后续比较
321322 }
322323 } )
323324 document . querySelectorAll ( 'form' ) . forEach ( function ( _this ) {
324- if ( ! _this . target ) {
325- _this . target = '_self'
326- }
325+ if ( ! _this . target ) { _this . target = '_self' }
327326 } ) ;
328327
329328 const callback = ( mutationsList , observer ) => {
You can’t perform that action at this time.
0 commit comments