bug: Redirects don't work on fresh browser launch from other application link
Duplicates
- [x] I have checked on Codeberg and can confirm this issue is not a duplicate.
- [x] I have checked on GitHub and can confirm this issue is not a duplicate.
Can you reproduce the bug?
Yes
Description
If you use a supported Chromium browser for libredirect, and you click on an a link that has a link for a website that redirects to a front-end that supports libredirect on another app without any supported Chromium browser windows open, it won't redirect.
Potential workarounds
Open the supported Chromium browser first and then click on the link.
LibRedirect Version
3.4.0
Other details about your environment (software names and versions)
N/A
More information needed. Wording is ambiguous cannot properly understand issue. Test in new version 3.51.
I think I understand what you mean...
Checked on latest 3.5.1 version in both Firefox and Chromium. When the browser is completely closed and you open a link from another app, it starts and opens plain YouTube. If the browser was already running, it would get redirected.
In Firefox: Firefox holds the request until the extension starts, but options are loaded async in init(), so the listener runs before they're ready and throws at services.js:838 ("options is undefined"). That one should be fixable, by waiting for options before redirecting.
In Chromium the browser sends requests before the extension is loaded. I think it could be patched, but IDK if it's worth it. We can redirect all open tabs on start, but it won't help with privacy, only with convenience...
This is an existing issue - https://github.com/libredirect/browser_extension/issues/1108#issuecomment-5818429164
This will not happen in Mv3, since it will be rules based and those rules are cached in browser engine before the extension loaded, rules won't be discarded as long as extension is installed.
We can only try to patch it up as far as we can in Mv2.