Skip to content

Commit

Permalink
Merge pull request #2 from LEODPEN/feature/popup-and-hover
Browse files Browse the repository at this point in the history
feature:hover & popup
  • Loading branch information
LEODPEN authored May 20, 2021
2 parents aabcdf0 + 58fb311 commit 77aa178
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 14 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<div align = "center">

Search for tabs in the opened window, may can also search for bookmarks and history in future versions.
Search for tabs in the opened window, can also increase your speed of switching tabs.

<a href = "https://github.com/LEODPEN/Where-is-my-tab/"> <img src="https://img.shields.io/badge/version-1.2-orange"> </a>
<a href = "https://github.com/LEODPEN/Where-is-my-tab/"> <img src="https://img.shields.io/badge/version-1.4-orange"> </a>
<a href = "https://chrome.google.com/webstore/detail/where-is-my-tab/abccjdbmfpgocjjmebdjogoophngecfe?hl=zh-CN&authuser=0" > <img src="https://img.shields.io/badge/platform-chrome-red"> </a>
<a href = "https://github.com/LEODPEN/Where-is-my-tab/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/LEODPEN/Where-is-my-tab"> </a>
</div>
Expand All @@ -22,6 +22,8 @@ Search for tabs in the opened window, may can also search for bookmarks and hist

本插件提供关键词查找功能,点击结果即可跳转到相应tab页;此外,还提供tab回退,助力大家使用浏览器的速度起飞;

逐渐靠近的目标是解放鼠标!

## Getting Plug-in

1. [谷歌应用商店](https://chrome.google.com/webstore/detail/where-is-my-tab/abccjdbmfpgocjjmebdjogoophngecfe?hl=zh-CN&authuser=0)添加即可(添加后记得固定下,方便点击);
Expand All @@ -47,9 +49,10 @@ Search for tabs in the opened window, may can also search for bookmarks and hist
+ 搜索与跳转
+ 搜索
1. 可选择点击浏览器右上角插件图标,按照关键词搜索tab页;
2. 可选择键盘操作(`Command+Shift+9`),新开tab页搜索(tab键可键入,回车可直接搜索);
2. 可选择键盘操作(`Command+Shift+9`),打开扩展工具(tab键可键入,回车可直接搜索);
3. 可选择键盘操作(`Command+Shift+0`),新开tab页操作;
+ 跳转
点击对应标题文字,即可跳转到已打开、需去往的tab页(如果采取2方式搜索,你可以选择`Command+9`来到新建搜索页,然后`Command+W`来关闭,毕竟目的是搜索不是开更多tab页)
点击对应标题文字,即可跳转到已打开、需去往的tab页(如果采取3方式搜索,你可以选择`Command+9`来到新建搜索页,然后`Command+W`来关闭,毕竟目的是搜索不是开更多tab页**强烈建议使用2操作**

> 注意:不同窗口下搜索与跳转只会在当前窗口进行;
Expand Down
13 changes: 13 additions & 0 deletions assets/srch-res.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ input:focus{
content-visibility: auto;
}

.res-card:hover {
position: center;
overflow: hidden;
margin-top: 7px;
margin-bottom: 7px;
width: auto;
max-width: 288px;
height: auto;
max-height: 80px;
background-color: #ff7a7a;
content-visibility: auto;
}

.t {
width: 202px;
word-break:break-all;
Expand Down
10 changes: 6 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ try{
let url = chrome.runtime.getURL("srch-res.html");
var stackMap = new Map();
chrome.commands.onCommand.addListener(function (command) {
if (command === 'do-search') {
chrome.tabs.create({ url });
}
if (command === 'backward') {
if (command === 'do-search-in-new-tab') {
chrome.tabs.create({ url });
}
if (command === 'backward') {
chrome.windows.getCurrent(function(cw) {
var stack;
var curWin = cw.id;
Expand All @@ -79,6 +79,8 @@ try{
}
doBackWard(stack, curWin);
});
if (command === 'forward') {
}
}
});
chrome.tabs.onActivated.addListener(function(activeInfo) {
Expand Down
27 changes: 21 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
{
"name": "Where is my tab ?",
"description": "Search for tabs in the opened window, can also increase your speed of switching tabs.",
"version": "1.3",
"version": "1.4",
"manifest_version": 3,
"update_url": "http://clients2.google.com/service/update2/crx",
"permissions": [
"tabs","commands","windows"
],
"background": {
"service_worker": "background.js"
"service_worker": "background.js"
},
"action": {
"default_icon": "where.png",
"default_popup": "srch-res.html"
},
"commands": {
"do-search": {
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+9",
"windows": "Ctrl+Shift+9",
"mac": "Command+Shift+9"
},
"description": "doSearch"
}
},
"backward": {
"suggested_key": {
"default": "Ctrl+Shift+7",
"mac": "Command+Shift+7"
},
"description": "backward"
},
"forward": {
"suggested_key": {
"default": "Ctrl+Shift+8",
"mac": "Command+Shift+8"
},
"description": "forward"
},
"do-search-in-new-tab": {
"suggested_key": {
"default": "Ctrl+Shift+0",
"mac": "Command+Shift+0"
},
"description": "doSearchInNewTab"
}
}
}

0 comments on commit 77aa178

Please sign in to comment.