Skip to content

Commit c95668d

Browse files
committed
v1.0.2 小改进
同时增加对旧版平台bug的兼容
1 parent acc8ae5 commit c95668d

File tree

5 files changed

+13
-26
lines changed

5 files changed

+13
-26
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Docker:https://hub.docker.com/r/a76yyyy/qiandao
2727

2828

2929
# 更新
30+
v1.0.2 小改进。同时增加对旧版平台bug的兼容(编辑测试界面无法获取cookie)(新版签到平台已修正
31+
3032
v1.0.0 修改匹配及注入方式,添加设定选项方便自行添加需要启用的网站
3133

3234
# 鸣谢

js/button.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

js/cookie.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ function onload(func) {
99
onload(function() {
1010
console.log("getcookieload");
1111
document.body.setAttribute("get-cookie", "true");
12-
window.postMessage({"info":"get-cookieModReady"}, "*");//预传递,在签到平台登录主页时自动填入info信息
13-
window.addEventListener('click', function(event) {
12+
window.postMessage({"info":"get-cookieModReady"}, "*");//预传递,测试自动填入功能
13+
//添加旧版平台bug修复性兼容//将来弃置
14+
if(location.pathname.indexOf('/edit')>0 ){$("a.ng-scope[data-toggle=get-cookie]").each(function(){this.removeAttribute("disabled")})}
15+
16+
window.addEventListener('click', function(event) {
1417
var export_btn = event.target;
15-
var port = chrome.runtime.connect({name: "get_cookie"});
1618
if (export_btn.getAttribute("data-toggle") == "get-cookie") {
19+
var port = chrome.runtime.connect({name: "get_cookie"});
20+
1721
var site = export_btn.getAttribute("data-site");
1822
var name = export_btn.getAttribute("data-name");
1923
var domain = export_btn.getAttribute("data-domain");
2024
var callback = export_btn.getAttribute("data-callback");
2125
port.postMessage({"do": "get_cookie", "site": site, "name": name, "domain": domain});
2226
port.onMessage.addListener(function(msg) {
2327
if (window.confirm('你确定要此网站获取你' + site + '的Cookies么?')) {
24-
export_btn.setAttribute("data-cookie", JSON.stringify(msg));
25-
//console.log(msg);
28+
//export_btn.setAttribute("data-cookie", JSON.stringify(msg));
29+
console.log("postMessage",msg);
2630
window.postMessage(msg, "*");//传递给页面消息,让网页填上cookies数据
2731
} else {
2832
return false;

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyqfMOCKmBFCyUDyIA2BKpJJhZnwYd4xBvu3B9ppdOQ98LYtK8pEcSGLpyhuzyiwtmlm9faAimQbCjelk1NGs/rkOTQFeC+X4TI4soujKA3v4vW1+QACchIiLCVel3nIJzU2Xq1vdbgP74wMWZ766xUqP4y6nNnGOaFvAWK+CuXPXOlNxbQ5ipNGUDR3MLz+PuLh1HtaMjtXWeJ5ailm8Rhuax9wAo1FcE/DwiRTbv11et/2MTda7Xo/3Z8S7Sc1gDbwHGFYRT931A3a+FUTTwiEDPP4LZmjBxgyknaBnj1Zh46kNYdaN1LFq3/0HloHq/E6B8rHXozqVHucaob+oMwIDAQAB",
2121
"permissions": [ "cookies", "storage", "tabs", "\u003Call_urls>"],
2222
"name": "__MSG_appName__",
23-
"version": "1.0.0"
23+
"version": "1.0.2"
2424
}

options/options.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<p>填入需要加载插件的域名或ip地址: 一行一个</p>
77
<p>例如:只用ip访问的自己家内网的nas输入 192.168.0.111<br />
88
或者用域名访问的签到平台 qiandao.today</p>
9-
<textarea id="tgurl" rows="6">
9+
<textarea id="tgurl" rows="6" cols="46">
1010
</textarea>
1111
<div><button id="save">Save</button><span id="status"></span></div>
1212
<button id="reset" style="display: none;">Reset</button>

0 commit comments

Comments
 (0)