Redirector
Redirector copied to clipboard
URL Decode "+"
I was trying to work around a bug where a website doesn't decode "+" as a word delimiter in searches:
Example: https://jisho.org/search/black+tea
Include: ^(?:https?://)jisho.org/search/(.*)
Redirect to: https://jisho.org/search/$1
Process matches: URL Decode
Expected: https://jisho.org/search/black%20tea
Example result: https://jisho.org/search/black+tea
I think it's just a matter of appending .replace("+"." ")
in redirect.js:278,280
if (this.processMatches == 'urlDecode') {
repl = unescape(repl.replace("+"." "));
} else if (this.processMatches == 'doubleUrlDecode') {
repl = unescape(unescape(repl.replace("+"." ")).replace("+"." "));
Thanks for everything!
Makes sense, I'll try to get that into the next release.
@ariel-co Do you know if Einar ever had a chance to publish that change? I found this thread because I'm trying to solve the same problem, and I'm not sure if I'm doing it wrong in Redirector or if I just need to take some other approach to solve it
Doesn't seem like: https://github.com/einaregilsson/Redirector/blame/master/js/redirect.js#L277
For my case I found by chance a URL where the keywords are proper query string parameters, e.g. https://jisho.org/search?keyword=black+tea. Maybe snoop around the site you're dealing with a bit, try to guess or ask the developers.
Or, look into one of the forks?