修复乱序执行错误 增加谷歌新闻阅读
This commit is contained in:
parent
95e3a23feb
commit
499c1bd27c
|
@ -1,3 +1,4 @@
|
||||||
|
95e3a23 删除用不上的代码 增加注释 增加乱序执行
|
||||||
aa4f2a6 修复邮箱回复 会回复谷歌官方邮件
|
aa4f2a6 修复邮箱回复 会回复谷歌官方邮件
|
||||||
720df83 增加标准注释
|
720df83 增加标准注释
|
||||||
006d6bb 重命名打包文件根据时间生成 删除不需要的代码
|
006d6bb 重命名打包文件根据时间生成 删除不需要的代码
|
||||||
|
|
23
js/popup.js
23
js/popup.js
|
@ -2,7 +2,7 @@
|
||||||
* @Author: lingling 1077478963@qq.com
|
* @Author: lingling 1077478963@qq.com
|
||||||
* @Date: 2024-08-19 09:47:04
|
* @Date: 2024-08-19 09:47:04
|
||||||
* @LastEditors: lingling 1077478963@qq.com
|
* @LastEditors: lingling 1077478963@qq.com
|
||||||
* @LastEditTime: 2024-08-26 09:19:35
|
* @LastEditTime: 2024-08-26 10:59:53
|
||||||
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js
|
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
*/
|
*/
|
||||||
|
@ -57,12 +57,7 @@ $(function () {
|
||||||
sendResponse({ name, id });
|
sendResponse({ name, id });
|
||||||
}
|
}
|
||||||
if (request.ty == "remove") {
|
if (request.ty == "remove") {
|
||||||
// chrome.tabs.query({}, function(tabs) {
|
|
||||||
// // 遍历每个标签页并关闭它们
|
|
||||||
// for (var i = 0; i < tabs.length; i++) {
|
|
||||||
// chrome.tabs.remove(tabs[i].id);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
chrome.tabs.remove(request.id);
|
chrome.tabs.remove(request.id);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -106,14 +101,14 @@ $(function () {
|
||||||
//函数队列
|
//函数队列
|
||||||
let queue = [];
|
let queue = [];
|
||||||
// queue.push(play_finance);//好像js注入不进去
|
// queue.push(play_finance);//好像js注入不进去
|
||||||
queue.push(shopping);
|
// queue.push(shopping);
|
||||||
queue.push(calendar);
|
// queue.push(calendar);
|
||||||
queue.push(mail);
|
queue.push(mail);
|
||||||
queue.push(play_google);
|
// queue.push(play_google);
|
||||||
queue.push(news_google);
|
// queue.push(news_google);
|
||||||
queue.push(youtube_shorts);
|
// queue.push(youtube_shorts);
|
||||||
//乱序执行
|
//乱序执行 此处有问题
|
||||||
queue=shuffleArray(queue)
|
// queue=shuffleArray(queue)
|
||||||
//当前执行的队列索引
|
//当前执行的队列索引
|
||||||
let closed_index = 0;
|
let closed_index = 0;
|
||||||
|
|
||||||
|
|
|
@ -94,29 +94,33 @@ async function calendar(r, id) {
|
||||||
* @param {*} id
|
* @param {*} id
|
||||||
*/
|
*/
|
||||||
async function news_google(r, id) {
|
async function news_google(r, id) {
|
||||||
console.log("加在完成开始等待8秒");
|
|
||||||
//等待五秒怕加载速度过慢
|
//等待五秒怕加载速度过慢
|
||||||
await delay(10);
|
await delay(3);
|
||||||
console.log("等待8秒完成");
|
//点击完整报道
|
||||||
//焦点新闻 数量
|
try {
|
||||||
let new_length = $(".KDoq1").length;
|
$('.jKHa4e')[0].click()
|
||||||
//点击会创建新标签暂时没办法控制
|
for (let index = 0; index < getRandomInt(3,5); index++) {
|
||||||
// let rand_new_index=getRandomInt(0,new_length)
|
RandomIntscrollBy()
|
||||||
//点击焦点新闻
|
await delay(3)
|
||||||
$("#i10").click();
|
}
|
||||||
$(".KDoq1")[0].click();
|
let new_array=$('.VDXfz')
|
||||||
// console.log( $("#i10"))
|
let new_array_href=[]
|
||||||
// await delay(10);
|
for (let index = 0; index < new_array.length; index++) {
|
||||||
// let the_number_of_swipes = getRandomInt(3, 6);
|
const element = new_array[index];
|
||||||
// for (let index = 0; index < the_number_of_swipes; index++) {
|
console.log(element.getAttribute("href"))
|
||||||
// RandomIntscrollBy();
|
let url = element.getAttribute("href").replace(/\./g, '');
|
||||||
// await delay(getRandomInt(10, 30));
|
new_array_href.push(`https://news.google.com${url}`)
|
||||||
// }
|
}
|
||||||
let x = $(".WwrzSb").length,
|
for (let index = 0; index < new_array_href.length; index++) {
|
||||||
y = 1,
|
const element = new_array_href[index];
|
||||||
shu = parseInt(Math.random() * (x - y + 1) + y);
|
let a= open(element)
|
||||||
$(".WwrzSb").eq(shu)[0].click();
|
await delay(3)
|
||||||
scrollBy(0, 153);
|
a.close()
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
send_close(id);
|
send_close(id);
|
||||||
}
|
}
|
||||||
//谷歌商店浏览
|
//谷歌商店浏览
|
||||||
|
@ -208,7 +212,7 @@ async function mail(r, id) {
|
||||||
mails[index].click();
|
mails[index].click();
|
||||||
RandomIntscrollBy();
|
RandomIntscrollBy();
|
||||||
await delay(getRandomInt(1, 5));
|
await delay(getRandomInt(1, 5));
|
||||||
// console.log(mails_is_google[index].children[4].children[1].children[0].children[0].getAttribute("email"))
|
console.log(mails_is_google[index].children[4].children[1].children[0].children[0].getAttribute("email"))
|
||||||
//获取邮件发送人
|
//获取邮件发送人
|
||||||
let mail_for = mails_is_google[index].children[4].children[1].children[0].children[0].getAttribute("email")
|
let mail_for = mails_is_google[index].children[4].children[1].children[0].children[0].getAttribute("email")
|
||||||
//是否回复
|
//是否回复
|
||||||
|
|
Loading…
Reference in New Issue