Merge pull request #36 from dubisdev/master

fix: close tab action
This commit is contained in:
Alyssa X 2022-01-15 15:36:27 +01:00 committed by GitHub
commit f02d8b7177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);