Skip to content

Commit acc8ae5

Browse files
committed
Revert "小改进"
This reverts commit a47fdac.
1 parent efff6e5 commit acc8ae5

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

README.md

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

2828

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

3332
# 鸣谢

js/button.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var button = function() {
2+
var cookie_btn = $("<span>").attr("data-callback", "eval").addClass("icon-btn-device").css({float:"none"}).attr("data-cookie", " ").attr("data-domain", ".baidu.com").attr("data-site", "http://pan.baidu.com/").attr("data-toggle", "get-cookie").text("点击获取");
3+
$(".icon-btn-device").after(cookie_btn);
4+
console.log("load JS");
5+
window.addEventListener("message", receiveMessage, false);
6+
7+
function receiveMessage(event)
8+
{
9+
if (event.origin == window.location.origin){
10+
console.log(event.data);
11+
}
12+
}
13+
};
14+
15+
var script = document.createElement('script');
16+
script.id = "button_script";
17+
script.appendChild(document.createTextNode('(' + button + ')();'));
18+
(document.body || document.head || document.documentElement).appendChild(script);
19+

js/cookie.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,20 @@ function onload(func) {
99
onload(function() {
1010
console.log("getcookieload");
1111
document.body.setAttribute("get-cookie", "true");
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) {
12+
window.postMessage({"info":"get-cookieModReady"}, "*");//预传递,在签到平台登录主页时自动填入info信息
13+
window.addEventListener('click', function(event) {
1714
var export_btn = event.target;
15+
var port = chrome.runtime.connect({name: "get_cookie"});
1816
if (export_btn.getAttribute("data-toggle") == "get-cookie") {
19-
var port = chrome.runtime.connect({name: "get_cookie"});
2017
var site = export_btn.getAttribute("data-site");
2118
var name = export_btn.getAttribute("data-name");
2219
var domain = export_btn.getAttribute("data-domain");
2320
var callback = export_btn.getAttribute("data-callback");
2421
port.postMessage({"do": "get_cookie", "site": site, "name": name, "domain": domain});
2522
port.onMessage.addListener(function(msg) {
2623
if (window.confirm('你确定要此网站获取你' + site + '的Cookies么?')) {
27-
//export_btn.setAttribute("data-cookie", JSON.stringify(msg));
28-
console.log("postMessage",msg);
24+
export_btn.setAttribute("data-cookie", JSON.stringify(msg));
25+
//console.log(msg);
2926
window.postMessage(msg, "*");//传递给页面消息,让网页填上cookies数据
3027
} else {
3128
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.2"
23+
"version": "1.0.0"
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" cols="46">
9+
<textarea id="tgurl" rows="6">
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)