Skip to content

Commit

Permalink
💎style
Browse files Browse the repository at this point in the history
  • Loading branch information
xifangczy committed Apr 25, 2023
1 parent 5bbc23b commit f4583a5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ table {
width: 100%;
text-align: center;
}
input {
input, textarea {
border: solid 1px rgb(20 69 137 / 40%);
padding: 5px 5px;
}
Expand Down
17 changes: 7 additions & 10 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function findMedia(data, isRegex = false, filter = false) {

//监听来自popup 和 options的请求
chrome.runtime.onMessage.addListener(function (Message, sender, sendResponse) {
if (G.featMobileTabId === undefined ||
if (G.featMobileTabId === undefined ||
G.featAutoDownTabId === undefined
) {
sendResponse("error");
Expand All @@ -266,13 +266,10 @@ chrome.runtime.onMessage.addListener(function (Message, sender, sendResponse) {
}
// 图标设置
if (Message.Message == "ClearIcon") {
if (Message.tabId == undefined || Message.tabId == "-1") {
SetIcon({ tips: false });
}
if (Message.tabId == undefined) {
if (Message.type) {
SetIcon({ tabId: G.tabId });
} else if (Message.tabId != "-1") {
SetIcon({ tabId: Message.tabId });
} else {
SetIcon({ tips: false });
}
sendResponse("ok");
return true;
Expand Down Expand Up @@ -328,9 +325,9 @@ chrome.runtime.onMessage.addListener(function (Message, sender, sendResponse) {
return true;
}
scriptTabid.add(Message.tabId);
if(script.refresh){
if (script.refresh) {
chrome.tabs.reload(Message.tabId, { bypassCache: true });
}else{
} else {
chrome.scripting.executeScript({
target: { tabId: Message.tabId, allFrames: script.allFrames },
files: ["catch-script/" + Message.script],
Expand Down Expand Up @@ -479,7 +476,7 @@ chrome.tabs.onRemoved.addListener(function (tabId) {
tabIdListRemove("featAutoDownTabId", tabId);
// 清理 捕获
if (G.version >= 102) {
G.scriptList.forEach(function(item){
G.scriptList.forEach(function (item) {
if (item.tabId.has(tabId)) {
item.tabId.delete(tabId);
}
Expand Down
15 changes: 11 additions & 4 deletions js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,15 @@ $('#Catch').click(function () {
$('#Clear').click(function () {
const type = $('.Active').attr("id") != "allTab";
chrome.runtime.sendMessage({ Message: "clearData", tabId: G.tabId, type: type });
type && chrome.runtime.sendMessage({ Message: "ClearIcon" });
location.reload();
chrome.runtime.sendMessage({ Message: "ClearIcon", type: type });
if (type) {
currentCount = 0;
$current.empty();
} else {
allCount = 0;
$all.empty();
}
UItoggle();
});
// 模拟手机端
$("#MobileUserAgent").click(function () {
Expand Down Expand Up @@ -594,8 +601,8 @@ function Tips(text, delay = 200) {
function UItoggle() {
let length = $('.TabShow .panel').length;
length > 0 ? $tips.hide() : $tips.show().html("还没闻到味儿~");
currentCount && $currentCount.text("[" + currentCount + "]");
allCount && $allCount.text("[" + allCount + "]");
$currentCount.text(currentCount ? `[${currentCount}]` : "");
$allCount.text(allCount ? `[${allCount}]` : "");
if ($('.TabShow').attr("id") == "otherOptions") {
$tips.hide();
$down.hide();
Expand Down

0 comments on commit f4583a5

Please sign in to comment.