mirror of
https://github.com/alyssaxuu/omni.git
synced 2026-03-11 08:54:35 +00:00
Merge 01e4c46ba1 into 8bd26168ec
This commit is contained in:
commit
bf7329ea41
2 changed files with 10 additions and 8 deletions
|
|
@ -183,7 +183,7 @@ chrome.commands.onCommand.addListener((command) => {
|
|||
chrome.tabs.sendMessage(response.id, {request: "open-omni"});
|
||||
} else {
|
||||
chrome.tabs.create({
|
||||
url: "./newtab.html"
|
||||
url: "./newtab.html"
|
||||
}).then(() => {
|
||||
newtaburl = response.url;
|
||||
chrome.tabs.remove(response.id);
|
||||
|
|
@ -243,7 +243,7 @@ const getTabs = () => {
|
|||
// Get bookmarks to populate in the actions
|
||||
const getBookmarks = () => {
|
||||
const process_bookmark = (bookmarks) => {
|
||||
for (const bookmark of bookmarks) {
|
||||
for (const bookmark of bookmarks) {
|
||||
if (bookmark.url) {
|
||||
actions.push({title:bookmark.title, desc:"Bookmark", id:bookmark.id, url:bookmark.url, type:"bookmark", action:"bookmark", emoji:true, emojiChar:"⭐️", keycheck:false})
|
||||
}
|
||||
|
|
@ -475,9 +475,11 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
}
|
||||
break;
|
||||
case "search":
|
||||
chrome.search.query(
|
||||
{text:message.query}
|
||||
)
|
||||
if (message.openInNewTab) {
|
||||
chrome.search.query({ text: message.query, disposition: 'NEW_TAB' });
|
||||
} else {
|
||||
chrome.search.query({ text: message.query });
|
||||
}
|
||||
break;
|
||||
case "restore-new-tab":
|
||||
restoreNewTab();
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ $(document).ready(() => {
|
|||
});
|
||||
keys += "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Check if the action has an emoji or a favicon
|
||||
if (!action.emoji) {
|
||||
var onload = 'if ("naturalHeight" in this) {if (this.naturalHeight + this.naturalWidth === 0) {this.onerror();return;}} else if (this.width + this.height == 0) {this.onerror();return;}';
|
||||
|
|
@ -279,7 +279,7 @@ $(document).ready(() => {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(".omni-extension #omni-results").html($("#omni-extension #omni-list .omni-item:visible").length+" results");
|
||||
$(".omni-item-active").removeClass("omni-item-active");
|
||||
$(".omni-extension #omni-list .omni-item:visible").first().addClass("omni-item-active");
|
||||
|
|
@ -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, tab: action, query: $(".omni-extension input").val(), openInNewTab: e.ctrlKey || e.metaKey });
|
||||
switch (action.action) {
|
||||
case "bookmark":
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue