Skip to content

Commit

Permalink
fix: [src/content.ts] should still can jump when no query keyword.
Browse files Browse the repository at this point in the history
Fix #12

#12
  • Loading branch information
kuanyui committed Mar 8, 2024
1 parent a253aef commit 5f42652
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ function ecosiaRemoveStupidAnnoyingNotificationBanner() {

function createEngineLinkElem(engine: SearchEngine, query: string): HTMLAnchorElement {
const kls = engine.hostname === location.hostname ? 'active' : ''
const href = engine.queryUrl.replace(/{}/, encodeURIComponent(query))
const href = query ?
engine.queryUrl.replace(/{}/, encodeURIComponent(query)) :
`https://${engine.hostname}`
const aEl = document.createElement('a')
aEl.href = href
aEl.className = kls
Expand Down

0 comments on commit 5f42652

Please sign in to comment.