Closed Kiki79250CoC closed 8 months ago
Yeah I should do that, but I'm not really sure how.
use general.useragent.override fix lol (only for user)
OK, I read the code, and there's two options available:
general.useragent.compatMode.firefox
nativelyOR (if you want to make it permanently enabled whatever the state of general.useragent.compatMode.firefox
)
791 | bool isFirefox = mAppName.EqualsLiteral("Firefox");
792 | if (isFirefox || mCompatFirefoxEnabled) {
793 | // "Firefox/x.y" (compatibility) app token
794 | mUserAgent += ' ';
795 | mUserAgent += mCompatFirefox;
796 | }
Remove lines 791, 792 and 796.
That bool is checking if the app is named "Firefox" or if general.useragent.compatMode.firefox
is set on TRUE
https://support.mozilla.org/en-US/kb/how-reset-default-user-agent-firefox general.useragent.extra.r3dfox lol
OK, I read the code, and there's two options available:
1. Enable `general.useragent.compatMode.firefox` natively
OR (if you want to make it permanently enabled whatever the state of
general.useragent.compatMode.firefox
)2. in [/netwerk/protocol/http/nsHttpHandler](https://github.com/Eclipse-Community/r3dfox/blob/d791f7d7341091b78ba57480f1f81611f0dea8d5/netwerk/protocol/http/nsHttpHandler.cpp) at Lines 791-796, you have this:
791 | bool isFirefox = mAppName.EqualsLiteral("Firefox"); 792 | if (isFirefox || mCompatFirefoxEnabled) { 793 | // "Firefox/x.y" (compatibility) app token 794 | mUserAgent += ' '; 795 | mUserAgent += mCompatFirefox; 796 | }
Remove lines 791, 792 and 796.
That bool is checking if the app is named "Firefox" or if
general.useragent.compatMode.firefox
is set on TRUE
I also had to remove 797-803 for it to work. What's the way to have the MyPal setup of both?
Mypal just enables general.useragent.compatMode.firefox
by default.
Also what lines 797-803 does is just adding r3dfox/122.0.1
at the end of the UA, something which can describe what fork you have. not very needed in fact but you can left it as it, just if you do this, revert the removal of line 791 (or remove the if condition and left the code that was in it).
Cool, that works, making a build and will publish a release soon (~1 hour for optimzied build)
I noticed that Google was displayed using their "legacy" code, so I checked and noticed that r3dfox is recognized as Netscape 5 because website UA parser does not recognize r3dfox's UA and uses the "Mozilla/5.0" part to "recognize" the browser.
So I searched how other browser behaves to avoid this issue and noticed thay Mypal includes "Firefox/78.0" in it's UA.
So the fix to this problem is somewhat simple: You must include "Firefox/122.0" in r3dfox's UA as well to resolve those compatibility issues. This would be something like this:
Before: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:122.0) Gecko/20100101 r3dfox/122.0.1 After: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0 r3dfox/122.0.1
With this addition, the website parser would detect the "Firefox/122.0" part and behave like a regular Firefox 122 browser.