增加谷歌购物浏览页面

This commit is contained in:
lingling 2024-08-22 16:25:33 +08:00
parent 295ae02482
commit 7d99c8f6c9
2 changed files with 33 additions and 13 deletions

View File

@ -2,7 +2,7 @@
* @Author: lingling 1077478963@qq.com
* @Date: 2024-08-19 09:47:04
* @LastEditors: lingling 1077478963@qq.com
* @LastEditTime: 2024-08-22 14:29:04
* @LastEditTime: 2024-08-22 16:22:15
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -96,8 +96,13 @@ $(function () {
let a = await createTab("https://calendar.google.com/calendar", "calendar");
return a;
}
async function shopping() {
let a = await createTab("https://shopping.google.com/", "shopping");
return a;
}
//函数队列
let queue = [];
queue.push(shopping);
queue.push(calendar);
queue.push(mail);
// queue.push(play_finance);//好像js注入不进去

View File

@ -156,10 +156,19 @@ async function youtube_shorts(r, id) {
send_close(id);
}
async function shopping(r, id) {
let number = getRandomInt(2, 10);
for (let index = 0; index < number; index++) {
RandomIntscrollBy();
await delay(getRandomInt(3, 7));
}
send_close(id);
}
async function calendar(r, id) {
await delay(3);
let number = getRandomInt(2, 5);
console.log($)
console.log($);
for (let index = 0; index < number; index++) {
//上一页
// $$('.T5GQA >span')[1].querySelectorAll('button')[0].click()
@ -229,16 +238,20 @@ async function play_google(r, id) {
}
async function play_finance(r, id) {
let recommended_attention=$('.sbnBtf >li >a')
for (let index = 0; index < getRandomInt(0,recommended_attention.length-1); index++) {
let recommended_attention = $(".sbnBtf >li >a");
for (
let index = 0;
index < getRandomInt(0, recommended_attention.length - 1);
index++
) {
recommended_attention[index].click();
await delay(getRandomInt(5, 10))
for (let indexx = 0; indexx < getRandomInt(0,5); indexx++) {
RandomIntscrollBy()
await delay(getRandomInt(5, 10))
await delay(getRandomInt(5, 10));
for (let indexx = 0; indexx < getRandomInt(0, 5); indexx++) {
RandomIntscrollBy();
await delay(getRandomInt(5, 10));
}
//返回主页
$('.gb_Bc >a').click()
$(".gb_Bc >a").click();
}
send_close(id);
}
@ -265,7 +278,7 @@ async function mail(r, id) {
"감사합니다",
"미안합니다",
"저 갑니다",
"사랑해요"
"사랑해요",
];
await delay(8);
let mails = document.querySelectorAll(".zA");
@ -281,8 +294,8 @@ async function mail(r, id) {
let text = emailReply[getRandomInt(0, emailReply.length - 1)];
console.log("注入内容为" + text);
// $(".Ar.Au >div >div").html = text;
let tmp_ele=$(".Ar.Au >div")
$(".Ar.Au >div >div").html(tmp_ele.html(text))
let tmp_ele = $(".Ar.Au >div");
$(".Ar.Au >div >div").html(tmp_ele.html(text));
await delay(3);
$(".dC >div").click();
await delay(getRandomInt(1, 5));
@ -421,7 +434,6 @@ chrome.runtime.sendMessage(
ty: "get",
},
function (obj) {
let r = obj.name;
let id = obj.id;
console.log("传递过来的obj" + JSON.stringify(obj));
@ -456,6 +468,9 @@ chrome.runtime.sendMessage(
case "calendar":
calendar(r, id);
break;
case "shopping":
shopping(r, id);
break;
default:
break;
}