diff --git a/README.md b/README.md index 1a96ca2..7ceee90 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/js/exampaper.js b/js/exampaper.js index 1ff0f24..e2416d8 100644 --- a/js/exampaper.js +++ b/js/exampaper.js @@ -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) { @@ -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; diff --git a/js/exampractice.js b/js/exampractice.js index cc98c98..da44b67 100755 --- a/js/exampractice.js +++ b/js/exampractice.js @@ -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 @@ -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) diff --git a/manifest.json b/manifest.json index 7dc58d6..35df869 100755 --- a/manifest.json +++ b/manifest.json @@ -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": {