Skip to content

Commit 00460dd

Browse files
committed
update
1 parent cae3b60 commit 00460dd

2 files changed

Lines changed: 45 additions & 11 deletions

File tree

52pojie-Enhanced.user.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 吾爱破解论坛增强 - 自动签到、翻页
3-
// @version 1.1.1
3+
// @version 1.1.2
44
// @author X.I.U
55
// @description 自动签到、自动无缝翻页
66
// @match *://www.52pojie.cn/*
@@ -107,7 +107,7 @@
107107

108108

109109
qianDaoBack(); // 先看看是不是签到跳转页面,如果是则返回
110-
qianDao(); // 看看有没有签到
110+
//qianDao(); // 看看有没有签到
111111
pageLoading(); // 自动翻页
112112

113113

@@ -148,11 +148,10 @@
148148

149149
// 签到后立即返回
150150
function qianDaoBack() {
151-
var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a');
152-
if (qiandaoback){
153-
if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2")
154-
{
155-
setTimeout(`qiandaoback.click()`, 300);
151+
if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){
152+
var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a');
153+
if (qiandaoback){
154+
setTimeout(function(){qiandaoback.click()}, 500);
156155
}
157156
}
158157
}
@@ -174,6 +173,29 @@
174173
}
175174

176175

176+
// 监听 XMLHttpRequest 事件
177+
function EventXMLHttpRequest() {
178+
var _send = window.XMLHttpRequest.prototype.send
179+
function sendReplacement(data) {
180+
if(this.onreadystatechange) {
181+
this._onreadystatechange = this.onreadystatechange;
182+
}
183+
this.onreadystatechange = onReadyStateChangeReplacement;
184+
return _send.apply(this, arguments);
185+
}
186+
function onReadyStateChangeReplacement() {
187+
if(this._onreadystatechange) {
188+
if (this.readyState==4 && this.status==200)
189+
{
190+
console.log('111111111111111111111111111111111111111')
191+
}
192+
}
193+
return this._onreadystatechange.apply(this, arguments);
194+
}
195+
window.XMLHttpRequest.prototype.send = sendReplacement;
196+
}
197+
198+
177199
var ShowPager = { // 修改自 https://greasyfork.org/scripts/14178
178200
getFullHref: function (e) {
179201
if(e == null) return '';

Zhihu-Enhanced.user.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 知乎增强
3-
// @version 1.1.3
3+
// @version 1.1.4
44
// @author X.I.U
55
// @description 一键收起回答、置顶显示时间、区分问题文章
66
// @match *://www.zhihu.com/*
@@ -272,6 +272,7 @@ function addTypeTips() {
272272
patt_tip = /zhihu_e_tips/
273273
var postList = document.querySelectorAll('h2.ContentItem-title a');
274274
postNum = document.querySelectorAll('small.zhihu_e_tips');
275+
console.log(`${postList.length} ${postNum.length}`)
275276
if (postList.length > postNum.length){
276277
for(var num = postNum.length;num<postList.length;num++){
277278
if (!patt_tip.test(postList[num].innerHTML)){ // 判断是否已添加
@@ -289,6 +290,17 @@ function addTypeTips() {
289290
}
290291
}
291292

293+
// 监听 XMLHttpRequest 事件
294+
function EventXMLHttpRequest() {
295+
var _send = window.XMLHttpRequest.prototype.send
296+
function sendReplacement(data) {
297+
addTypeTips();
298+
return _send.apply(this, arguments);
299+
}
300+
window.XMLHttpRequest.prototype.send = sendReplacement;
301+
}
302+
303+
292304
(function() {
293305
//折叠谢邀
294306
let timer=setInterval(function(){
@@ -328,12 +340,12 @@ function addTypeTips() {
328340
}else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 //
329341
collapsedAnswer(); // 一键收起回答
330342
setInterval(topTime_search, 300); // 置顶显示时间
331-
setInterval(addTypeTips, 1000); // 区分问题文章
343+
EventXMLHttpRequest(); // 区分问题文章
332344
}else if(window.location.href.indexOf("topic") > -1){ // 话题页 //
333345
if(window.location.href.indexOf("unanswered") == -1){
334346
collapsedAnswer(); // 一键收起回答
335347
setInterval(topTime_search, 300); // 置顶显示时间
336-
setInterval(addTypeTips, 1000); // 区分问题文章
348+
EventXMLHttpRequest(); // 区分问题文章
337349
}
338350
}else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 //
339351
setInterval(topTime_zhuanlan, 300); // 置顶显示时间
@@ -346,6 +358,6 @@ function addTypeTips() {
346358
}else{ // 首页 //
347359
collapsedAnswer(); // 一键收起回答
348360
setInterval(topTime_index, 300); // 置顶显示时间
349-
setInterval(addTypeTips, 1000); // 区分问题文章
361+
EventXMLHttpRequest(); // 区分问题文章
350362
}
351363
})();

0 commit comments

Comments
 (0)