Skip to content

Commit

Permalink
v3.0.4
Browse files Browse the repository at this point in the history
解决每日答题弹出滑动验证框问题
  • Loading branch information
Huozzzy committed Dec 19, 2022
1 parent 435ff6f commit 78eb6a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 58 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
## 自用!

## 更新说明
v3.0.3(2022-07-05):
v3.0.4(2022-12-19):

1.更新chrome插件manifest v3 请使用支持v3扩展的浏览器版本
2.专项答题现在只做当年题目,往年题目不再答题
3.只支持v2扩展的浏览器请使用release中的v201.crx
1.解决每日答题弹出滑动验证框问题

## 下载
* [最新发布](https://github.com/Huozzzy/Learning-Learner/releases/)
Expand Down
52 changes: 1 addition & 51 deletions js/exampaper.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
chrome.runtime.sendMessage({ type: "checkRunning" }, {}, function (response) {
if (response && response.hasOwnProperty("runtime")) {
if (response.runtime) {
// 滑块验证
const swiperValid = document.getElementById("swiper_valid")
if (swiperValid) {
let obs = new MutationObserver(mutationRecords => {
slideVerify()
});
obs.observe(swiperValid, {
childList: true,
subtree: true,
characterDataOldValue: true
});
}


function getNeedAnswer() {
var isNextPage = true;
document.querySelectorAll('.item .right > button').forEach(function (e, b, c) {
Expand Down Expand Up @@ -80,44 +68,6 @@ chrome.runtime.sendMessage({ type: "checkRunning" }, {}, function (response) {
// }
// }

function slideVerify() {
const nc_mask = document.getElementById("nc_mask")
if (nc_mask !== null && getComputedStyle(nc_mask).display !== 'none') {
var btn_slide = document.getElementById("nc_1_n1z")
var mousedown = document.createEvent("MouseEvents");
if (btn_slide !== null) {
var btn_slide_rect = btn_slide.getBoundingClientRect();
var x = btn_slide_rect.left + btn_slide_rect.width * (parseInt(Math.random() * 5) / 10 + 0.2);
var y = btn_slide_rect.top + btn_slide_rect.height / 2;
}
var nc_scale = document.getElementById("nc_1_n1t");
if (nc_scale !== null) { var w = nc_scale.getBoundingClientRect().width; }

//点击滑块
mousedown.initMouseEvent("mousedown", true, true, window, 0, x, y, x, y, false, false, false, false, 0, null);
if (btn_slide != null) { btn_slide.dispatchEvent(mousedown); }

var aa = 0;
var bb = 0;
//滑动滑块
var intervaltimer = setInterval(function () {
var mousemove = document.createEvent("MouseEvents");
var _x = x + aa;
var _y = y + bb;
mousemove.initMouseEvent("mousemove", true, true, window, 0, _x, _y, _x, _y, false, false, false, false, 0, null);
if (btn_slide != null) { btn_slide.dispatchEvent(mousemove); }
if (_x - x >= w) {
// 滑到最右边
clearInterval(intervaltimer);
var mouseup = document.createEvent("MouseEvents");
mouseup.initMouseEvent("mouseup", true, true, window, 0, _x, _y, _x, _y, false, false, false, false, 0, null);
if (btn_slide != null) { btn_slide.dispatchEvent(mouseup); }
} else {
aa += parseInt(Math.random() * (209 - 199) + 199) / 33;
}
}, 10);
}
}

chrome.storage.local.get(['studyConfig'], function (result) {
// let config = result.studySubjectConfig;
Expand Down
4 changes: 2 additions & 2 deletions js/exampractice.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ chrome.runtime.sendMessage({ type: 'checkRunning' }, {}, function (response) {
if (btn_slide !== null) {
var btn_slide_rect = btn_slide.getBoundingClientRect()
var x = btn_slide_rect.left + btn_slide_rect.width * (parseInt(Math.random() * 5) / 10 + 0.2)
x = x.toFixed(2)
// x = x.toFixed(2)
// console.log('x=' + x)
var y = btn_slide_rect.top + btn_slide_rect.height / 2

Expand Down Expand Up @@ -291,7 +291,7 @@ chrome.runtime.sendMessage({ type: 'checkRunning' }, {}, function (response) {
btn_slide.dispatchEvent(eventup)
}
} else {
offsetX += (parseInt((Math.random() * (209 - 199) + 199) / 33)).toFixed(2)
offsetX += parseInt((Math.random() * (209 - 199) + 199) / 33)
// console.log('offsetX=' + offsetX)
}
}, 30)
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_extName__",
"version": "3.0.3",
"version": "3.0.4",
"default_locale": "zh_CN",
"description": "__MSG_extDescription__",
"icons": {
Expand Down

0 comments on commit 78eb6a1

Please sign in to comment.