sophie-glk / bang

A firefox addon which adds bangs (known from duckduckgo) to various search engines.
MIT License
46 stars 5 forks source link

Support regional bangs #32

Closed StormPooper closed 3 months ago

StormPooper commented 4 months ago

Bangs such as !am will use your search region to determine where to send you, so for me DDG takes me to amazon.co.uk, whereas the extension will always use amazon.com. It'd be great for the extension to support this, as otherwise I have to remember to use the regional variant of the bang, assuming there is one (there is for Amazon, !amuk in my case).

sophie-glk commented 4 months ago

This is actually not that easy to implement as i do not know how ddg achieves this (probably some additional javascript), and it's also difficult to know when the region should be enforced and for what bangs (e.g maybe i want to go explicitly to my region with some bangs and not with others) Luckily there is a workaround for this / its already kinda implemented. Just override !am with a custom bang in the settings: set !am to https://www.amazon.co.uk/s?k=@search@

StormPooper commented 4 months ago

Hhm, yeah, this appears to be done server-side, as when my browser hits DDG with !am the response is a page that just redirects to the URL, no client-side stuff seems to be done.

Would be nice to have an option to let the request be sent to DDG handle the redirect rather than have to maintain a list of custom bangs manually for multiple browsers, since the extension doesn't support syncing (plus the bang URLs may change). I'd still have the extension parse for whether it should be sent to DDG, so not every request is sent to DDG, but then if it's a valid bang and the option has been enabled, redirect to a DDG search instead of the bang URL.

StormPooper commented 2 months ago

Hey @sophie-glk, did this update get pushed to the Add-on store? Trying to work out if my Firefox is at fault for not getting the update.