Skip to content

Commit

Permalink
release 0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
acgotaku committed Dec 12, 2015
1 parent 343cddf commit 8c89703
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
4 changes: 1 addition & 3 deletions chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,14 @@ function showNotification(id,opt){
chrome.notifications.clear(id,function(){});
},5000);
}


//软件版本更新提示
var manifest = chrome.runtime.getManifest();
var previousVersion=localStorage.getItem("version");
if(previousVersion == "" || previousVersion != manifest.version){
var opt={
type: "basic",
title: "更新",
message: "百度网盘助手更新到" +manifest.version + "版本啦~\n此次更新解决新版百度网盘无法下载的问题~",
message: "百度网盘助手更新到" +manifest.version + "版本啦~\n此次更新支持用户配置同步功能~",
iconUrl: "images/icon.jpg"
}
var id= new Date().getTime().toString();
Expand Down
12 changes: 10 additions & 2 deletions chrome/js/baidu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ onload(function() {
if(album){
addJS("album");
}else{
addJS("share");
addJS("convert");
addJS("share").addJS("convert");
}
}
chrome.storage.sync.get(null, function(items) {
for(var key in items){
localStorage.setItem(key,items[key]);
}
});
});

function saveSyncData(data ,value){
var obj= new Object();
obj[data] =value;
Expand All @@ -43,4 +48,7 @@ window.addEventListener("message", function(event) {
saveSyncData(key,event.data.data[key]);
}
}
if (event.data.type && (event.data.type == "clear_data")){
chrome.storage.sync.clear();
}
}, false);
4 changes: 2 additions & 2 deletions chrome/js/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var port=null;
method:method,
data: data
});
console.log(data);
// console.log(data);
this.listenBackground(port);

},
Expand All @@ -42,7 +42,7 @@ var port=null;
},
listenBackground:function(port){
port.onMessage.addListener(function(response) {
console.log(response);
// console.log(response);
switch(response.method){
case "rpc_result":
if(response.status){
Expand Down
5 changes: 3 additions & 2 deletions chrome/js/core.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var CORE=(function(){
const defaultUA ="netdisk;5.3.4.5;PC;PC-Windows;5.1.2600;WindowsBaiduYunGuanJia";
const defaultreferer="http://pan.baidu.com/disk/home";
const version = "0.5.6";
const update_date = "2015/12/10";
const version = "0.5.7";
const update_date = "2015/12/12";
var cookies=null;
return {
init:function(){
Expand Down Expand Up @@ -224,6 +224,7 @@ var CORE=(function(){
break;
case "reset":
localStorage.clear();
window.postMessage({ type: "clear_data"}, "*");
$("#setting_divtopmsg").html("设置已重置.");
self.update();
break;
Expand Down
4 changes: 2 additions & 2 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"background": {
"scripts": ["background.js"],
"persistent": true
"persistent": false
},
"content_scripts": [ {
"js": [ "js/baidu.js" ],
Expand Down Expand Up @@ -30,5 +30,5 @@
"manifest_version": 2,
"permissions": [ "cookies", "tabs", "notifications", "*://*.baidu.com/*", "activeTab", "contextMenus", "storage"],
"name": "__MSG_appName__",
"version": "0.5.6"
"version": "0.5.7"
}

0 comments on commit 8c89703

Please sign in to comment.