einaregilsson / Redirector

Browser extension (Firefox, Chrome, Opera, Edge) to redirect urls based on regex patterns, like a client side mod_rewrite.
http://einaregilsson.com/redirector/
MIT License
1.55k stars 162 forks source link

[site] Trying to get Duckduckgo Bangs work with Startpage, but it only works the 2nd time I reload the page #398

Open chella1cm opened 1 month ago

chella1cm commented 1 month ago

I have setup Startpage as my default search engine and I am trying to get Duckduckgo bangs to work from the navbar.

I use this redirect setting to only redirect when I use an exclamation mark. Include pattern: ^https?://www.startpage.com/sp/search\?query=!(.+) Redirect to: https://duckduckgo.com/?q=!$1

So when I search it uses Startpage as expected and it should redirect to DDG when I use bangs. but instead it loads the startpage result with the !bangs when I select the Navbar with the url and press enter, it redirects to the DDG bang like I want.. Is there something I should do to make bangs work right from the navbar instead of from startpage result page?

chuangzhu commented 1 month ago

You forgot to escape the ? in search?query, should be ^https?://www.startpage.com/sp/search\?query=!(.+). Also, check whether you selected Regular Expression in Pattern type

chella1cm commented 1 month ago

Thanks for the reply.

Yes I have entered that Regex pattern like you said and made sure Regular Expression is selected in Pattern type. (Image).

This is how it redirects (Gif). When I enter the bang! right in the Navbar, it leads to the Startpage result with the entered bang! still in the URL when I press enter in the Navbar again the 2nd time, it redirects to the said bang!. Is there something I should do to make bangs work right from the navbar without loading startpage result page first?