sblask-webextensions / webextension-skip-redirect

Some web pages use intermediary pages before redirecting to a final page. This add-on tries to extract the final url from the intermediary url and goes there straight away if successful.
https://addons.mozilla.org/firefox/addon/skip-redirect/
MIT License
481 stars 45 forks source link

No-skip-parameter-list is getting bypassed if URL contains multiple "?" #344

Closed ScriptedBot closed 1 year ago

ScriptedBot commented 1 year ago

New Issue Checklist (tick off like this: [x])

What is your browser?

What is your operating system?

Description (please include examples/screenshots where applicable)

If the target URL contains multiple "?" then the no-skip-parameter-list seem to ignore the parameter even if it appears after the first "?" but is absent from the parameter list succeeding the subsequent "?"

For example: For all posted google drive redirect links from the site render-state.to the extension is unable to intercept the target google drive link even when 1) "redirect" is explicitly specified in no-skip-parameters-list of the extension and 2) the website is explicitly using "redirect" as the parameter for the target google drive link.

Example link: https://render-state.to/exit.php?redirect=https://drive.google.com/file/d/1jlDBBK8h0W_zPrONxlZ1GSkqp-YF_awk/view?usp=share_link

The only plausible explanation for the issue is that the extension may be parsing the url for parameters after the last occurrence of "?" and therefore does not trigger in this case.

Possible fix: The extension should start parsing the parameters immediately after the first "?"

sblask commented 1 year ago

https://render-state.to/exit.php?redirect=https://drive.google.com/file/d/1jlDBBK8h0W_zPrONxlZ1GSkqp-YF_awk/view?usp=share_link skips to https://drive.google.com/file/d/1jlDBBK8h0W_zPrONxlZ1GSkqp-YF_awk/view?usp=share_link by default when I add redirect to No-skip-parameters-list it doesn't. Just as expected...