Compare commits

..

No commits in common. "7a67c00bee642d3d42765d2380cc807c7a0cb179" and "46fc343e76f70a01435b77c8c44180c2b755174f" have entirely different histories.

3 changed files with 37 additions and 70 deletions

View File

@ -1,34 +1,19 @@
/*
* @Author: lingling 1077478963@qq.com
* @Date: 2024-08-19 09:47:04
* @LastEditors: lingling 1077478963@qq.com
* @LastEditTime: 2024-09-27 15:57:31
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\background.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
//记录谷歌账户 //记录谷歌账户
let Ggoogle_mail = ""; let google_mail='';
//记录是否有运行权限 //记录是否有运行权限
let executionAuthority = false; let executionAuthority=false;
//是否查询过 //是否查询过
let haveYouChecked = false; let haveYouChecked=false;
/** /**
* 查看是否有权限运行 * 查看是否有权限运行
* @param {*} google_mail 谷歌id * @param {*} google_mail 谷歌id
*/ */
//TODO 授权没写完 async function viewPermission(google_mail){
async function viewPermission(google_mail) { let data =await axios.get('https://api.giaogiao.uk/api.php?type=list');
let tmp = await axios.post( console.log(data)
"http://149.129.107.38:8787/index/queryauthorization", if(google_mail=='qq2392025971@gmail.com'){
{ google_account: google_mail }
);
if (tmp.data.code == 200) {
executionAuthority = true;
Ggoogle_mail = google_mail;
return true; return true;
} }
haveYouChecked = true;
return false; return false;
} }
/** /**
@ -37,21 +22,15 @@ async function viewPermission(google_mail) {
* @param {*} sendResponse 返回消息 * @param {*} sendResponse 返回消息
*/ */
chrome.runtime.onMessage.addListener(async (req, sender, sendResponse) => { chrome.runtime.onMessage.addListener(async (req, sender, sendResponse) => {
if (haveYouChecked) { const res = req.info
sendResponse(executionAuthority); let data=await viewPermission(res);
return true; sendResponse(data);
} console.log(res)
if (req.ty == "viewPermission") { })
const res = req.info;
if (res&&!haveYouChecked) {
let data = await viewPermission(res); setTimeout(function(){
console.log(data); chrome.tabs.create({ url: "popup.html" }, function () {
sendResponse(data); })
} },3500);
}
return true;
});
setTimeout(function () {
chrome.tabs.create({ url: "popup.html" }, function () {});
}, 3500);

View File

@ -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-09-27 16:04:40 * @LastEditTime: 2024-08-26 14:50:09
* @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
*/ */
@ -51,22 +51,21 @@ $(function () {
sender, sender,
sendResponse sendResponse
) { ) {
console.log(request)
// 判断是产生一个新页面是 // 判断是产生一个新页面是
if (request.ty == "get") { if (request.ty == "get") {
sendResponse({ name, id }); sendResponse({ name, id });
} }
if (request.ty == "remove") { if (request.ty == "remove") {
chrome.tabs.remove(id); chrome.tabs.remove(request.id);
} }
return true; return true;
}); });
async function google() { // async function text() {
let a = await createTab("https://www.google.com", "naver"); // let a = await createTab("https://www.youtube.com/", "youtube");
return a; // return a;
} // }
async function youtube_shorts() { async function youtube_shorts() {
let a = await createTab( let a = await createTab(
"https://www.youtube.com/shorts/", "https://www.youtube.com/shorts/",
@ -104,14 +103,13 @@ $(function () {
} }
//函数队列 //函数队列
let queue = []; let queue = [];
queue.push(google);
// 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(youtube); // queue.push(youtube);
// queue.push(play_google); queue.push(play_google);
// queue.push(youtube_shorts); queue.push(youtube_shorts);
queue.push(news_google); queue.push(news_google);
//乱序执行 此处有问题 //乱序执行 此处有问题
@ -158,7 +156,7 @@ $(function () {
} }
chrome.tabs.onCreated.addListener((e) => { chrome.tabs.onCreated.addListener((e) => {
// sed_cont(id); sed_cont(id);
console.log(e); console.log(e);
console.log("创建了一个新的浏览器窗口"); console.log("创建了一个新的浏览器窗口");
}); });

View File

@ -30,24 +30,15 @@ function RandomIntscrollBy(y = 0) {
console.log("随机滑动" + rand); console.log("随机滑动" + rand);
} }
/**
* 判断打开的浏览器页面是PC端还是移动端
* @returns mobile_web:手机PCPC
*/
function is_mobile_web(){
return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false
}
//naver使用函数 //naver使用函数
const naver = async (r, id) => { const naver = async (r, id) => {
let googelid_str = (elements = $(".gb_A.gb_Za.gb_0").attr("aria-label")); let googelid_str = (elements = $(".gb_A.gb_Za.gb_0").attr("aria-label"));
const emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/; const emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/;
const match = googelid_str.match(emailRegex); const match = googelid_str.match(emailRegex);
const email = match ? match[0] : null; const email = match ? match[0] : null;
console.log(`email:${email} r:${r} id${id}`) console.log(email)
// let res = await to_background(email); let res = await to_background(email);
// console.log(`res:${res} emall:${email}`); console.log(`res:${res} emall:${email}`);
// await delay(10)
// send_close(id); // send_close(id);
}; };
/** /**
@ -389,7 +380,6 @@ async function to_background(params) {
chrome.runtime.sendMessage( chrome.runtime.sendMessage(
{ {
info: params, info: params,
ty: "viewPermission",
}, },
(res) => { (res) => {
console.log(res); console.log(res);
@ -448,7 +438,7 @@ chrome.runtime.sendMessage(
} }
); );
// chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// console.log(request); console.log(request);
// sendResponse("我收到了你的情书popup~"); sendResponse("我收到了你的情书popup~");
// }); });