mirror of
https://github.com/alyssaxuu/omni.git
synced 2026-03-11 08:54:35 +00:00
fix: close tab action
This commit is contained in:
parent
a6e0cf4dec
commit
54a8bf2af4
2 changed files with 6 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue