lusakasa/saka-key

Clipboard paste should use default search engine instead of hardcoded Google search

ropery opened this issue · 1 comments

When I use the key-binding for "Activate Clipboard *" to paste a non-URL foo, saka-keys translates it a Google search query URL, disregarding the default search engine.

The expected behavior should be equivalent to typing foo in the Firefox URL bar & hitting Enter, i.e., querying the default search engine for foo.

The relevant source lines:

export async function clipboardCurrentTab () {
await browser.tabs.update({ url: searchURL(paste()) })
}

saka-key/src/lib/url.js

Lines 34 to 41 in cd2aa75

export function searchURL (
query,
queryURLTemplate = 'https://www.google.com/search?q='
) {
return isLikeURL(query)
? (!/^[a-zA-Z-]+:/.test(query) ? 'https://' : '') + query
: searchEngineQueryURL(query, queryURLTemplate)
}

(This is a separate issue from #64.)

ido50 commented

I second this. The amount of times I accidentally ran Google searches with sensitive information from my clipboard is insane.