From 58fb311f1a14e1d2097ef897ee4fdca6cb5900e7 Mon Sep 17 00:00:00 2001 From: pengfeng05 Date: Fri, 21 May 2021 01:52:16 +0800 Subject: [PATCH] feature:hover & popup --- README.md | 11 +++++++---- assets/srch-res.css | 13 +++++++++++++ background.js | 10 ++++++---- manifest.json | 27 +++++++++++++++++++++------ 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6251c2e..25c3994 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@
-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. - +
@@ -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)添加即可(添加后记得固定下,方便点击); @@ -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操作**) > 注意:不同窗口下搜索与跳转只会在当前窗口进行; diff --git a/assets/srch-res.css b/assets/srch-res.css index 68d10df..a4bfb8f 100644 --- a/assets/srch-res.css +++ b/assets/srch-res.css @@ -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; diff --git a/background.js b/background.js index 76283be..a994549 100644 --- a/background.js +++ b/background.js @@ -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; @@ -79,6 +79,8 @@ try{ } doBackWard(stack, curWin); }); + if (command === 'forward') { + } } }); chrome.tabs.onActivated.addListener(function(activeInfo) { diff --git a/manifest.json b/manifest.json index aaacab6..3c8aeea 100644 --- a/manifest.json +++ b/manifest.json @@ -1,25 +1,26 @@ { "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": { @@ -27,6 +28,20 @@ "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" } } } \ No newline at end of file