feat: search in new tab if user hold meta or alt key

This commit is contained in:
panjiangyi 2024-01-09 11:40:25 +08:00
parent 8bd26168ec
commit bc330ceeb2
2 changed files with 2 additions and 2 deletions

View file

@ -476,7 +476,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
break;
case "search":
chrome.search.query(
{text:message.query}
{text:message.query,disposition:message.disposition}
)
break;
case "restore-new-tab":

View file

@ -304,7 +304,7 @@ $(document).ready(() => {
window.open($(".omni-item-active").attr("data-url"), "_self");
}
} else {
chrome.runtime.sendMessage({request:action.action, tab:action, query:$(".omni-extension input").val()});
chrome.runtime.sendMessage({request:action.action, disposition:(e.altKey||e.metaKey)? "NEW_TAB":"CURRENT_TAB", tab:action, query:$(".omni-extension input").val()});
switch (action.action) {
case "bookmark":
if (e.ctrlKey || e.metaKey) {