Om de ûnderfining foar jo te ferbetterjen is tydlik de funksjonaliteit dan dizze website troch ûnderhâldswurk beheind. Wannear in artikel jo probleem net oplost en jo in fraach stelle wolle, kin ús stipemienskip jo helpe yn @FirefoxSupport op Twitter en /r/firefox op Reddit.

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

Using if-then statements in smart keywords

  • 2 antwurd
  • 1 hat dit probleem
  • 3 werjeftes
  • Lêste antwurd fan Adrian

more options

Hello, I'm not really sure if this is possible, but it'd be nice. I use smart keywords to go to different subreddits, so for example searching for "r askreddit" goes to reddit.com/r/AskReddit. The issue I have is that if I want to go to the front page, I can't just search for "r", as that goes to http://reddit.com/r/ which then redirects to reddit.com/subreddits.

So what I'd want is to have an if-then statement - if there is no other argument following the "r", it should go to reddit.com. This works with Google Maps and YouTube without needing to do anything /Google handles empty search differently than reddit I suppose/.

Is this possible?

Hello, I'm not really sure if this is possible, but it'd be nice. I use smart keywords to go to different subreddits, so for example searching for "r askreddit" goes to reddit.com/r/AskReddit. The issue I have is that if I want to go to the front page, I can't just search for "r", as that goes to http://reddit.com/r/ which then redirects to reddit.com/subreddits. So what I'd want is to have an if-then statement - if there is no other argument following the "r", it should go to reddit.com. This works with Google Maps and YouTube without needing to do anything /Google handles empty search differently than reddit I suppose/. Is this possible?

Keazen oplossing

You would need a JavaScript bookmarklet that checks the '%s' placeholder to achieve this.

javascript:void(location.href=('%s'=='')?'https://reddit.com/':'https://reddit.com/r/%s');
Dit antwurd yn kontekst lêze 👍 1

Alle antwurden (2)

more options

Keazen oplossing

You would need a JavaScript bookmarklet that checks the '%s' placeholder to achieve this.

javascript:void(location.href=('%s'=='')?'https://reddit.com/':'https://reddit.com/r/%s');

Bewurke troch cor-el op

more options

Thank you, I didn't know I can just place JavaScript into the url bar.