Skip to content

Commit 02490f4

Browse files
committed
新增 [自动签到] 对手机版网页的支持
1 parent 7852d03 commit 02490f4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

V2ex-Enhanced.user.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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/*
@@ -218,13 +218,14 @@
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); // 写入签到时间以供后续比较
@@ -321,9 +322,7 @@
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) => {

0 commit comments

Comments
 (0)