Snippet: Search in specific browser

By email:

I have a suggestion for a feature that I believe would greatly enhance the user experience: the ability to choose a specific browser for the search feature. Currently, the search functionality is tied to the default browser.

Here’s a snippet that does this:

// #popclip
// name: Search in Safari
// icon: bundle:search
// language: javascript
const url = new URL("https://google.com/search")
url.searchParams.set("q", popclip.input.text);
popclip.openUrl(url, { app: "com.apple.Safari" });

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

To customise this for your own purposes, you can change the search engine URL and query parameter, and also the browser by changing the bundle identifier within the app parameter passed to open URL.

1 Like