Skip to content

Commit

Permalink
修复bug,优化功能
Browse files Browse the repository at this point in the history
  • Loading branch information
scoful committed Jan 7, 2020
1 parent 3532f00 commit a14c791
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
6. 点击插件图标,列出当前所有打开的tab的标题,并可以直接点击标题切换、关闭
7. 集成json工具页,目前只有格式化json功能
8. 匹配广州图书馆wifi登录页,登录后会自动2小时倒计时弹窗提醒(广图的wifi有效期2小时)
9. 匹配百度网盘外链转存页,支持不需勾选一键转存,打破超过3000文件数限制
9. 匹配百度网盘外链转存页,支持不需勾选一键转存,打破超过3000文件数限制(只支持最新的外链分享,即那种生成分享链接和提取码的方式)
10. 中英国际化切换,渣渣英语,渣渣翻译,包涵包涵


Expand Down Expand Up @@ -128,7 +128,7 @@

格式化json结构

14. 匹配百度网盘
14. 匹配百度网盘(只支持最新的外链分享,即那种生成分享链接和提取码的方式)

在打开链接为https://pan.baidu.com/s/ 才会触发,页面上多一个按钮,不用勾选要转存的文件,直接点击按钮,默认一次性转存这个外链分享的所有文件,用于突破百度网盘的文件外链转存个数限制(目前是一个文件夹调用一次转存api,效率有点低,还需多多测试)

Expand Down
4 changes: 2 additions & 2 deletions css/popup.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.menu-entry {
text-align: center;
font-size: 13px;
font-size: 100%;
background: #fefefe;
padding: 10px;
}
Expand Down Expand Up @@ -28,7 +28,7 @@

.row{
border-top: 1px solid #eee;
font-size: 13px;
font-size: 100%;
}

.delete-link {
Expand Down
6 changes: 4 additions & 2 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ function translateFunc(txt) {
url: url,
success: function (data, status) {
if (status == "success") {
console.log(data.translation[0]);
sendMessageToContentScript("translateResult", data.translation[0]);
if (data.translation) {
console.log(data.translation[0]);
sendMessageToContentScript("translateResult", data.translation[0]);
}
} else {
sendMessageToContentScript("translateResult", "--FAILED--!");
}
Expand Down
18 changes: 16 additions & 2 deletions js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@

tabs.view = function () {
return tabs.vm.list.map(function (tab, i) {
var favIconUrl = tab.favIconUrl
if (favIconUrl && typeof (favIconUrl) != undefined && favIconUrl.indexOf("chrome") != -1) {
favIconUrl = "./images/48.png"
}
if (!favIconUrl) {
favIconUrl = "./images/48.png"
}
if (typeof (favIconUrl) == undefined) {
favIconUrl = "./images/48.png"
}
return m('div.row', {
onclick: function () {
chrome.tabs.highlight({ tabs: i }, function callback() {
Expand All @@ -222,8 +232,12 @@
tabs.vm.rmTab(i);
event.stopPropagation();
}
}), m('img', { src: tab.favIconUrl, height: '10', width: '10' }),
' ', m("span", {}, tab.title)])
}),
m('img', {
src: favIconUrl, height: '15', width: '15'
}),
' ',
m("span", {}, tab.title)])
]);
});
};
Expand Down

0 comments on commit a14c791

Please sign in to comment.