Compare commits
No commits in common. "7a67c00bee642d3d42765d2380cc807c7a0cb179" and "46fc343e76f70a01435b77c8c44180c2b755174f" have entirely different histories.
7a67c00bee
...
46fc343e76
|
@ -1,13 +1,5 @@
|
|||
/*
|
||||
* @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;
|
||||
//是否查询过
|
||||
|
@ -16,19 +8,12 @@ let haveYouChecked = false;
|
|||
* 查看是否有权限运行
|
||||
* @param {*} google_mail 谷歌id
|
||||
*/
|
||||
//TODO 授权没写完
|
||||
async function viewPermission(google_mail){
|
||||
let tmp = await axios.post(
|
||||
"http://149.129.107.38:8787/index/queryauthorization",
|
||||
{ google_account: google_mail }
|
||||
);
|
||||
if (tmp.data.code == 200) {
|
||||
executionAuthority = true;
|
||||
Ggoogle_mail = google_mail;
|
||||
let data =await axios.get('https://api.giaogiao.uk/api.php?type=list');
|
||||
console.log(data)
|
||||
if(google_mail=='qq2392025971@gmail.com'){
|
||||
return true;
|
||||
}
|
||||
haveYouChecked = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
|
@ -37,21 +22,15 @@ async function viewPermission(google_mail) {
|
|||
* @param {*} sendResponse 返回消息
|
||||
*/
|
||||
chrome.runtime.onMessage.addListener(async (req, sender, sendResponse) => {
|
||||
if (haveYouChecked) {
|
||||
sendResponse(executionAuthority);
|
||||
return true;
|
||||
}
|
||||
if (req.ty == "viewPermission") {
|
||||
const res = req.info;
|
||||
if (res&&!haveYouChecked) {
|
||||
const res = req.info
|
||||
let data=await viewPermission(res);
|
||||
console.log(data);
|
||||
sendResponse(data);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
chrome.tabs.create({ url: "popup.html" }, function () {});
|
||||
chrome.tabs.create({ url: "popup.html" }, function () {
|
||||
})
|
||||
},3500);
|
||||
|
||||
|
|
26
js/popup.js
26
js/popup.js
|
@ -2,7 +2,7 @@
|
|||
* @Author: lingling 1077478963@qq.com
|
||||
* @Date: 2024-08-19 09:47:04
|
||||
* @LastEditors: lingling 1077478963@qq.com
|
||||
* @LastEditTime: 2024-09-27 16:04:40
|
||||
* @LastEditTime: 2024-08-26 14:50:09
|
||||
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
|
@ -51,22 +51,21 @@ $(function () {
|
|||
sender,
|
||||
sendResponse
|
||||
) {
|
||||
console.log(request)
|
||||
// 判断是产生一个新页面是
|
||||
if (request.ty == "get") {
|
||||
sendResponse({ name, id });
|
||||
}
|
||||
if (request.ty == "remove") {
|
||||
|
||||
chrome.tabs.remove(id);
|
||||
chrome.tabs.remove(request.id);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
async function google() {
|
||||
let a = await createTab("https://www.google.com", "naver");
|
||||
return a;
|
||||
}
|
||||
// async function text() {
|
||||
// let a = await createTab("https://www.youtube.com/", "youtube");
|
||||
// return a;
|
||||
// }
|
||||
async function youtube_shorts() {
|
||||
let a = await createTab(
|
||||
"https://www.youtube.com/shorts/",
|
||||
|
@ -104,14 +103,13 @@ $(function () {
|
|||
}
|
||||
//函数队列
|
||||
let queue = [];
|
||||
queue.push(google);
|
||||
// queue.push(play_finance);//好像js注入不进去
|
||||
// queue.push(shopping);
|
||||
// queue.push(calendar);
|
||||
// queue.push(mail);
|
||||
queue.push(shopping);
|
||||
queue.push(calendar);
|
||||
queue.push(mail);
|
||||
// queue.push(youtube);
|
||||
// queue.push(play_google);
|
||||
// queue.push(youtube_shorts);
|
||||
queue.push(play_google);
|
||||
queue.push(youtube_shorts);
|
||||
queue.push(news_google);
|
||||
|
||||
//乱序执行 此处有问题
|
||||
|
@ -158,7 +156,7 @@ $(function () {
|
|||
}
|
||||
|
||||
chrome.tabs.onCreated.addListener((e) => {
|
||||
// sed_cont(id);
|
||||
sed_cont(id);
|
||||
console.log(e);
|
||||
console.log("创建了一个新的浏览器窗口");
|
||||
});
|
||||
|
|
|
@ -30,24 +30,15 @@ function RandomIntscrollBy(y = 0) {
|
|||
console.log("随机滑动" + rand);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断打开的浏览器页面是PC端还是移动端
|
||||
* @returns mobile_web:手机,PC:PC
|
||||
*/
|
||||
function is_mobile_web(){
|
||||
return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false
|
||||
}
|
||||
|
||||
//naver使用函数
|
||||
const naver = async (r, id) => {
|
||||
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 match = googelid_str.match(emailRegex);
|
||||
const email = match ? match[0] : null;
|
||||
console.log(`email:${email} r:${r} id${id}`)
|
||||
// let res = await to_background(email);
|
||||
// console.log(`res:${res} emall:${email}`);
|
||||
// await delay(10)
|
||||
console.log(email)
|
||||
let res = await to_background(email);
|
||||
console.log(`res:${res} emall:${email}`);
|
||||
// send_close(id);
|
||||
};
|
||||
/**
|
||||
|
@ -389,7 +380,6 @@ async function to_background(params) {
|
|||
chrome.runtime.sendMessage(
|
||||
{
|
||||
info: params,
|
||||
ty: "viewPermission",
|
||||
},
|
||||
(res) => {
|
||||
console.log(res);
|
||||
|
@ -448,7 +438,7 @@ chrome.runtime.sendMessage(
|
|||
}
|
||||
);
|
||||
|
||||
// chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
// console.log(request);
|
||||
// sendResponse("我收到了你的情书,popup~");
|
||||
// });
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
console.log(request);
|
||||
sendResponse("我收到了你的情书,popup~");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue