This commit is contained in:
Fateh AK 2022-10-17 00:00:40 +05:30 committed by GitHub
commit bf7329ea41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -475,9 +475,11 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
} }
break; break;
case "search": case "search":
chrome.search.query( if (message.openInNewTab) {
{text:message.query} chrome.search.query({ text: message.query, disposition: 'NEW_TAB' });
) } else {
chrome.search.query({ text: message.query });
}
break; break;
case "restore-new-tab": case "restore-new-tab":
restoreNewTab(); restoreNewTab();

View file

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