Skip to content

Conversation

@Hayao0819
Copy link

Add "Search in Google" ContextThe official client Discord has a context menu for searching with Google.

I use this so often that I added it to WebCord as well.

@SpacingBat3
Copy link
Owner

SpacingBat3 commented May 14, 2025

Nice idea TBH! One thing I would work on, would be to use default search engine on browsers, if that's possible cross-platform. Why limit to just Google 😄?
I might even go as far as to create a library for that sole purpose, of it required some platform-specific handling of things, although I have high hopes for shell in Electron to be more than enough to handle it.

@Hayao0819
Copy link
Author

Since Discord is limited to Google, I thought that would be fine.
I am not familiar with Eelctron, so it may be difficult to add a settings screen, etc.

By the way, it seems that even Microsoft and Apple are having difficulty implementing “use your favorite browser and engine”

@SpacingBat3
Copy link
Owner

SpacingBat3 commented May 14, 2025

Yeah, I looked into it, so far I got only the brief concept how to implement it properly.
So far I've found a special kind of argument you might pass to some browsers in order to trigger a search with some keyword. The main concern is tho it requires gathering info on the full path of the browser. There's open package made by very famous library maker and Node FOSS developer, Sindre Sorhus that is available and has ability to get info on default browser, although I'm not quite sure on the details of it and how well it would behave in Electron ecosystem (mostly the concern is whenever it uses some kind of script or executable that might be needed to be extracted to work with my app packages as app.asar archive).

I can always work myself on such software, no sweat, I'm already building my own collection of libraries to use by myself since I'm little untrustworthy even with the popular and well-known projects, the colors.js case showed me well the consequences of impact of the untrustworthy developer messing with the systems via a package.

@SpacingBat3
Copy link
Owner

SpacingBat3 commented May 14, 2025

As of other alternatives, I guess… at worst I might finally get myself into implementing the input box handling in the settings for the custom string in the config. That would be usefull to further parse and use for defining your own search engine URL.
But personally I'd still preffer to do it properly, so far I can only think of being able to pass GET params only (with the alternative approach than to start your browser as a detached process directly), privacy-oriented way tho (SearXNG folks do that mostly, myself included) is using POST request when passing a search query.

@SpacingBat3
Copy link
Owner

Since Discord is limited to Google, I thought that would be fine.

Ah, should say WebCord's not affiliated with Discord in any way. So far I'm more within the kind of community that hates it for every change that feels to ruin what I enjoyed Discord the most for.

Or at least I remember times when Discord UI was unique, wasn't material-designed stuff they thought switching to should be a standard for whatever weird reason, and they even designed it like to add a title bar to their web browser version… and the Nitro stuff /ads, weird promotions and non-chat related stuff… I kinda miss old Discord, those were simpler times XD.

Being slightly salty enough, I'm more into going into another direction than Discord. Especially I'm not in favour that they don't neccesarily care for folks who want to be more decisive what they don't need from their client to do.

@Hayao0819
Copy link
Author

Hayao0819 commented May 15, 2025

I agree with you on Discord's recent bizarre and offensive changes.

Regarding search, how about using a simple string substitution (%q -> search string) to generate the URL and launch the browser?

@SpacingBat3
Copy link
Owner

how about using a simple string substitution

Exactly what I've fought for the alternative approach. Mainly I would like to launch browsers in a manner like:

[your best browser] "? [your search query]"

At least something like that, obviously it won't rely on shell's quote matching, we pass argv as an array element.
Maybe I would go with Node's format() and %s instead %q.

@SpacingBat3
Copy link
Owner

And of course the ? method relies on support of the browsers for that kind of the syntax. Not sure how much that's widespread, but at least it would use your search engine, configured in your way.
I think there also might be a "webdriver" stuff for launching browsers in more complex manner. Might use that as well if it is suitable and more standard approach.

@SpacingBat3 SpacingBat3 added the type:feat New feature or request label May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants