| 260 | |
| 261 | // 后台获取签到状态(并判断是否需要签到) |
| 262 | function qianDaoStatus_(timeNow) { |
| 263 | GM_xmlhttpRequest({ |
| 264 | url: location.origin + '/mission/daily', |
| 265 | method: 'GET', |
| 266 | timeout: 5000, |
| 267 | onload: function (response) { |
| 268 | let html = ShowPager.createDocumentByString(response.responseText); |
| 269 | if (html.querySelector('input[value^="领取"]')) { // 还没有签到... |
| 270 | qianDao_(null, timeNow); // 后台签到 |
| 271 | } else { // 已经签到了... |
| 272 | console.info('[V2EX 增强] 已经签过到了。') |
| 273 | GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 |
| 274 | } |
| 275 | } |
| 276 | }); |
| 277 | } |
| 278 | |
| 279 | |
| 280 | // 替换为 sov2ex 搜索,代码来自 v2ex-plus 扩展:https://github.com/sciooga/v2ex-plus (懒得重复造轮子了~ |