Skip to content

Commit

Permalink
Updated to use the URLSearchParams API.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed Aug 4, 2023
1 parent f8346c0 commit 4fdfbd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/background/modules/OmniboxSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export async function triggerOmnixboxDisabledSearch(text, disposition) {
* @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/omnibox/onInputEntered}
*/
export async function triggerOmnixboxSearch(text, disposition) {
text = text.trim();
const searchResult = window.emojiMart.emojiIndex.search(text);

const emojiSearch = await AddonSettings.get("emojiSearch");
Expand Down Expand Up @@ -171,7 +172,7 @@ export async function triggerOmnixboxSearch(text, disposition) {
copyToClipboard: true
});
} else if (emojiSearch.action === "emojipedia") {
const resultUrl = `https://emojipedia.org/search/?q=${encodeURIComponent(emojiText)}`;
const resultUrl = `https://emojipedia.org/search/?${new URLSearchParams({ q: emojiText })}`;

// navigate to URL in current or new tab
openTabUrl(resultUrl, disposition);
Expand All @@ -187,7 +188,7 @@ export async function triggerOmnixboxSearch(text, disposition) {
// browser.browserAction.openPopup();

// search for result in emojipedia
const resultUrl = `https://emojipedia.org/search/?q=${encodeURIComponent(text)}`;
const resultUrl = `https://emojipedia.org/search/?${new URLSearchParams({ q: text })}`;
openTabUrl(resultUrl, disposition);
}
}
Expand Down

0 comments on commit 4fdfbd7

Please sign in to comment.