fix: close tab action

This commit is contained in:
dubisdev 2022-01-15 14:32:24 +01:00
parent a6e0cf4dec
commit 54a8bf2af4
2 changed files with 6 additions and 3 deletions

View file

@ -319,6 +319,9 @@ const closeWindow = (id) => {
const closeTab = (tab) => {
chrome.tabs.remove(tab.id);
}
const closeCurrentTab = () => {
getCurrentTab().then(closeTab)
}
const removeBookmark = (bookmark) => {
chrome.bookmarks.remove(bookmark.id);
}
@ -395,6 +398,9 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
case "close-window":
closeWindow(sender.tab.windowId);
break;
case "close-tab":
closeCurrentTab();
break;
case "search-history":
chrome.history.search({text:message.query, maxResults:1000, startTime:31536000000*5}).then((data) => {
for (let action in actions) {

View file

@ -210,9 +210,6 @@ $(document).ready(function(){
case "scroll-top":
window.scrollTo(0,0);
break;
case "close-tab":
window.close();
break;
case "navigation":
if (e.ctrlKey) {
window.open(action.url);