Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

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

Open
ropery opened this issue Dec 4, 2020 · 1 comment

Comments

@ropery
Copy link

ropery commented Dec 4, 2020

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
Copy link

ido50 commented May 17, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants