22
Duckduck go button on google (discuss.tchncs.de)

Okay so i have a addon that gives me a google logo i can press to try my search in google if i cant find something on duckduck go but i would like to have the opposite too so a button that would let me click to search on duckduck if googleing isn't successful eg. If someone sends me a google search link

you are viewing a single comment's thread
view the rest of the comments
[-] Zeus@lemm.ee 13 points 2 years ago* (last edited 2 years ago)

this seems like something best solved with a bookmarklet

let me see if i can knock one up quickly


okay, i got a bit distracted, sorry it took so long

javascript:(function() {window.location="https://duckduckgo.com/?"+window.location.toString().match(/q=.*?(\&|$)/g);})()

alternative code block

javascript:(function() {window.location="https://duckduckgo.com/?"+window.location.toString().match(/q=.*?(\&|$)/g);})()

just drag that into your bookmarks bar, then click it when you're on a google search page (please message me with any questions or bugs, i wrote this in five minutes with an online regex tester)

also, thank you for this post - i'd never thought of doing this, but it's a good idea


edit 2: okay, lemmy-ui currently has a bug with ampersands. please replace & in the script with just an "&"

[-] NightAuthor@beehaw.org 2 points 2 years ago

You could put this in a button and inject it into the google page with a user script extension right?

That might get closer to what OP wants

[-] Zeus@lemm.ee 1 points 2 years ago

You could put this in a button and inject it into the google page with a user script extension right?

yes, probably. but i wouldn't know how, i don't really use userscripts; i prefer to trigger things manually

if anyone else wants to do this: i release the above code under cc0, any person may use it for any purpose without let or hindrance, yada yada

That might get closer to what OP wants

i guess..? but i'm not sure of the functional difference between a button in the bookmarks bar, and a button on the page

[-] NightAuthor@beehaw.org 2 points 2 years ago

The difference would really just be where to click, and whether you have to have the bookmarks bar enabled. I usually have mine set to only show on the new-tab page.

[-] Oliper202020@discuss.tchncs.de 1 points 2 years ago

Also i find it harder to find stuff in the bookmark bar then just a button

[-] Zeus@lemm.ee 0 points 2 years ago

oh fair enough, i forgot that some people hide the bookmarks bar because i find it really useful

this post was submitted on 22 Aug 2023
22 points (92.3% liked)

Firefox

20491 readers
6 users here now

/c/firefox

A place to discuss the news and latest developments on the open-source browser Firefox.


Rules

1. Adhere to the instance rules

2. Be kind to one another

3. Communicate in a civil manner


Reporting

If you would like to bring an issue to the moderators attention, please use the "Create Report" feature on the offending comment or post and it will be reviewed as time allows.


founded 5 years ago
MODERATORS