Skip to content

Commit

Permalink
v2.0.0 更新Manifest V3标准
Browse files Browse the repository at this point in the history
测试更新
  • Loading branch information
ckx000 committed Jun 3, 2023
1 parent df807e2 commit 24045f7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Docker:https://hub.docker.com/r/a76yyyy/qiandao

# 简介

稍微瞎修改并改进下了。
针对源代码会漏掉某些cookie抓不到的问题进行了补足
针对强制推进的Manifest V3标准进行了代码更新。

目前应该能在新版浏览器上正常运作了。

但是只部分测试了功能上的正常,未广泛进行兼容性测试,有bug欢迎提交issue

# 使用注意
整个代码打包下载回去,使用chrome扩展 加载已解压的扩展程序来使用
Expand All @@ -27,6 +30,8 @@ Docker:https://hub.docker.com/r/a76yyyy/qiandao


# 更新
v2.0.0 未有功能上的改进,只是将代码整体迁移至Manifest V3标准。

v1.0.3 小改进。同时增加对旧版平台bug的兼容(编辑测试界面无法获取cookie)(新版签到平台已修正

v1.0.0 修改匹配及注入方式,添加设定选项方便自行添加需要启用的网站
Expand Down
8 changes: 1 addition & 7 deletions js/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function onload(func) {
} else {
window.addEventListener('load', func);
}
}
};

onload(function() {
console.log("getcookieload");
Expand All @@ -30,11 +30,5 @@ onload(function() {
});
}
},false);
//添加旧版平台bug修复性兼容过渡//将来弃置//
if(location.pathname.indexOf('/edit')>0){
old=function() {
if(document.querySelector('a.ng-scope[disabled]')){document.querySelector('a.ng-scope[disabled]').removeAttribute("disabled")}}
setInterval(old, 1000)
}
});

12 changes: 6 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"background": {
"scripts": ["background.js"],
"persistent": false
"service_worker": "service_worker.js"
},
"default_locale": "zh_CN",
"description": "__MSG_description__",
Expand All @@ -14,11 +13,12 @@
"options_ui":{
"page": "options/options.html",
"open_in_tab": false,
"chrome_style": true
"browser_style": true
},
"manifest_version": 2,
"manifest_version": 3,
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyqfMOCKmBFCyUDyIA2BKpJJhZnwYd4xBvu3B9ppdOQ98LYtK8pEcSGLpyhuzyiwtmlm9faAimQbCjelk1NGs/rkOTQFeC+X4TI4soujKA3v4vW1+QACchIiLCVel3nIJzU2Xq1vdbgP74wMWZ766xUqP4y6nNnGOaFvAWK+CuXPXOlNxbQ5ipNGUDR3MLz+PuLh1HtaMjtXWeJ5ailm8Rhuax9wAo1FcE/DwiRTbv11et/2MTda7Xo/3Z8S7Sc1gDbwHGFYRT931A3a+FUTTwiEDPP4LZmjBxgyknaBnj1Zh46kNYdaN1LFq3/0HloHq/E6B8rHXozqVHucaob+oMwIDAQAB",
"permissions": [ "cookies", "storage", "tabs", "\u003Call_urls>"],
"permissions": ["cookies", "storage", "scripting","activeTab"],
"host_permissions": [ "\u003Call_urls>"],
"name": "__MSG_appName__",
"version": "1.0.3"
"version": "2.0.0"
}
6 changes: 3 additions & 3 deletions background.js → service_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var listurlarr,format=function(a){
console.log("init",listurlarr);
},urlcheck=function(a){
for(var l in listurlarr){
if(a.indexOf(listurlarr[l])>=0){
if(a && a.indexOf(listurlarr[l])>=0){
console.log(true);
return true
}
Expand All @@ -23,8 +23,8 @@ chrome.storage.onChanged.addListener(function(changes, areaName){
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {//tab页面刷新事件
//console.log(tab);
if (changeInfo.status === 'loading' && urlcheck(tab.url)) {
console.log(tab);
chrome.tabs.executeScript({file: "js/cookie.js"});
console.log("tab:",tab);
chrome.scripting.executeScript({target: {tabId: tab.id},files: ["js/cookie.js"]});
if (!chrome.runtime.onConnect.hasListeners()) {
chrome.runtime.onConnect.addListener(function(port) {
console.assert(port.name == "get_cookie");
Expand Down

0 comments on commit 24045f7

Please sign in to comment.