diff --git a/README.md b/README.md index da44d39..6251c2e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ -# Where-is-my-tab - -[![GitHub license](https://img.shields.io/github/license/LEODPEN/Where-is-my-tab)](https://github.com/LEODPEN/Where-is-my-tab/blob/main/LICENSE) -[![Version](https://img.shields.io/badge/version-1.2-orange)](https://github.com/LEODPEN/Where-is-my-tab/) - ----

@@ -11,16 +5,24 @@

+

Where is my tab ?

+ +
Search for tabs in the opened window, may can also search for bookmarks and history in future versions. -### About + + + +
+ +## About 学习及工作中常常遇到浏览器里面打开的tab页过多,窗口也多,总感觉或确定之前打开过某个tab页,但是不知道它在哪里了,于是有时不得不重新开一个tab页,“雪球越滚越大”。 本插件提供关键词查找功能,点击结果即可跳转到相应tab页;此外,还提供tab回退,助力大家使用浏览器的速度起飞; -### Getting Plug-in +## Getting Plug-in 1. [谷歌应用商店](https://chrome.google.com/webstore/detail/where-is-my-tab/abccjdbmfpgocjjmebdjogoophngecfe?hl=zh-CN&authuser=0)添加即可(添加后记得固定下,方便点击); @@ -32,7 +34,7 @@ Search for tabs in the opened window, may can also search for bookmarks and hist 3. Edge商店搜索同名插件(阉割版,因为其`manifest_version`只支持到2 ~~懒,不想兼容~~); -#### Features +## Features + 分窗口tab名展示与关键词查找; @@ -40,7 +42,7 @@ Search for tabs in the opened window, may can also search for bookmarks and hist + 分窗口tab页回退(一个窗口最多支持10次回退); -#### Usage +## Usage + 搜索与跳转 + 搜索 @@ -57,7 +59,7 @@ Search for tabs in the opened window, may can also search for bookmarks and hist > 注意:一个窗口只支持10个回退,多于10次则会丢弃更早的记录; -### Others +## Others + Windows下将(Command键替换为Ctrl即可); diff --git a/assets/popup.js b/assets/popup.js index 8c21de6..eae7a2c 100644 --- a/assets/popup.js +++ b/assets/popup.js @@ -25,24 +25,22 @@ function initDisplay() { } function judgeGo(){ - var word = $("#keyword").val().trim(); - if(word == "" && $("#keyword").hasClass("wait")){ + var word = $("#keyword").val().trim(); + if(word == "" && $("#keyword").hasClass("wait")){ alert("Please enter keywords first."); return; } initDisplay(); + if(word == "") { + return; + } goSearching(word.toUpperCase()); } +// no btn needed function goSearching(word) { - let changeColor = document.getElementById("seach-tabs"); - - // 一旦变绿直接变绿 8D /xs - changeColor.style.backgroundColor = "lightgreen"; - queryTabs(word); } - document.getElementById("seach-tabs").addEventListener("click", judgeGo); document.onkeydown=keyListener; @@ -64,14 +62,20 @@ function goSearching(word) { function queryTabs(keywords) { let tabs = []; traverseTabsOfCurWindow(function (tab) { - if (tab.title.toUpperCase().indexOf(keywords) != -1) { + if ((tab.title && tab.title.toUpperCase().indexOf(keywords) != -1) + || (tab.url && tab.url.toUpperCase().indexOf(keywords) != -1) + || (tab.pendingUrl && tab.pendingUrl.toUpperCase().indexOf(keywords) != -1)) { tabs.push(tab); } }, function () { - $(".container").append('
Results in tabs:
'); + $(".container").append('
\n
'); for (let j in tabs) { let tab = tabs[j]; - $('.tab-result').append('

' + tab.title + '

'); + $('.tab-result').append('
'); + $("#" + tab.id).append('
' + tab.title + '
'); + $("#" + tab.id).append('
' + tab.url + '
'); + // $('.tab-result').append('
' + tab.title + '
'); + jump2Tab(tab.id); } }); diff --git a/assets/srch-res.css b/assets/srch-res.css index 521327e..68d10df 100644 --- a/assets/srch-res.css +++ b/assets/srch-res.css @@ -1,8 +1,61 @@ -button { - height: 30px; - width: 30px; - outline: none; - margin: 10px; - border: ridge; - border-radius: 4px; - } \ No newline at end of file +body{ + background-color:#D3D3D3; + background-image:url('../where.png'); + background-repeat:no-repeat; + background-size: 1024px 1024 +} +.head { + font-size: 26px; + font-weight: 777; + font-family: "Times New Roman"; +} + +input{ + outline-style: none; + border: 1px solid #ccc; + border-radius: 3px; + padding: 13px 14px; + width: 200px; + font-size: 16px; + font-weight: 666; + font-family: "Microsoft soft"; +} + +input:focus{ + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6) +} + +.res-card { + position: center; + overflow: hidden; + margin-top: 7px; + margin-bottom: 7px; + width: auto; + max-width: 288px; + height: auto; + max-height: 80px; + background-color: #FFA07A; + content-visibility: auto; +} + +.t { + width: 202px; + word-break:break-all; + word-wrap:break-word; + font-size: 12px; + font-weight: 555; + font-family: "Microsoft soft"; + margin-bottom: 5px; +} + +.url { + width: 202px; + word-break:break-all; + word-wrap:break-word; + font-size: 4px; + font-weight: 22; + font-family: "Times New Roman"; +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index baf9f52..aaacab6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Where is my tab ?", - "description": "Search for tabs in the opened window, may can also search for bookmarks and history in future versions.", - "version": "1.2", + "description": "Search for tabs in the opened window, can also increase your speed of switching tabs.", + "version": "1.3", "manifest_version": 3, "permissions": [ "tabs","commands","windows" diff --git a/srch-res.html b/srch-res.html index 56ad5be..46260e1 100644 --- a/srch-res.html +++ b/srch-res.html @@ -6,11 +6,12 @@ -

Where is my tab ?

-
- +
Where is my tab ?
+
+ +
-
+