noblereign / GX-Mods-Extension

A WebExtension for Firefox. Add ambient music, typing sounds, and more to your browsing experience.
MIT License
24 stars 2 forks source link

Detect typing in omnibox #4

Closed noblereign closed 2 months ago

noblereign commented 9 months ago

Probably will be a little roundabout. Allow the user to set GXM as a "search engine" (chrome_settings_overrides, search_provider) so we can detect typing in the omnibox. Pass through searches and suggestions to an engine of the user's choice (grab a list using search api).

noblereign commented 9 months ago

okay looking at this now this seems like it's gonna be way more complex than i thought 😭 firefox's search api doesn't actually return any of the urls i need (query url and autocomplete url)

i'd probably need to ask the user to input a link to the correct OpenSearch xml description. (for reference, here's Google's.) we'd also need to add the search permission but considering that it's an optional setting i'd just ask for it at runtime

then, search urls MUST be an https link. i would rather not host an entire server for this, for longevity and privacy reasons LibRedirect gets around this by giving Firefox a URL that will never lead anywhere, and then intercepting the network request to redirect it to the correct place. yikes. that's not ideal but i guess it could work.

but also, would that even be possible for autocomplete? i'd have to try and find out, but worst case scenario we'd need the user to forfeit autocomplete... also also, guessing i can't change search engine icon at runtime either, so it'd be stuck as either the GXM logo or a generic magnifying glass.

all of these hoops and hurdles to jump through just to get a scuffed search engine passthrough... is it really worth all of this for some typing sounds?

noblereign commented 2 months ago

currently trying to figure this out again, this might be even more impossible than i thought it was??

tl;dr: there are zero ways of detecting even just keypresses in the address bar without forcing people to type a mandatory word at the beginning of every search

i genuinely think that webextensions are too limited to implement this in a seamless way. :( if anyone has any ideas or suggestions feel free to leave them in, i think i have to give up on this for now 💔

noblereign commented 2 months ago

if anyone genuinely wants to be typing in "gx my search term here" to look things up then i guess i'll implement it?? but i don't really think enough people would be okay with that to warrant me spending time on it

noblereign commented 2 months ago

HANG ON. I JUST FOUND SOMETHING. WE MIGHT BE COOKING

noblereign commented 2 months ago

"fixed" by #20