Conversation
The current patch was breaking the Dictionnary flow. HTTP must stay different also using different accept encoding, so I'm applying the patch only when it's secure.
|
Hey @julien-duponchelle thanks for opening the PR! If I understand correctly, the core issue is a configuration that the camoufox python library injects. Would it not be better to override the headers within the pip package? Happy to hear your thoughts on this. |
|
When you set the value in the Python library all call get intercepted and the HTTPS value is set. This create two issue, the path where the header is set for HTTP is no longer called and the path where you get isDictionnary == true also is not called. This header is controlled by three settings in Firefox: We could also consider to remove the Accept Encoding override from the CPP code and override it via Firefox preference mechanism somewhere in the Python module. |
|
@icepaq i could take a look if it's possible to strip the override from the CPP code and move to Python. |
|
thx due good luck |
|
To make it easier to read: Before my change: nsresult nsHttpHandler::SetAcceptEncodings(const char* aAcceptEncodings,
bool isSecure, bool isDictionary) {
if (auto value = MaskConfig::GetString("headers.Accept-Encoding")) {
mHttpsAcceptEncodings.Assign(nsCString(value.value().c_str()));
return NS_OK;
}
if (isDictionary) {
mDictionaryAcceptEncodings = aAcceptEncodings;
} else if (isSecure) {
mHttpsAcceptEncodings = aAcceptEncodings;
} else {
// use legacy list if a secure override is not specified
mHttpAcceptEncodings = aAcceptEncodings;
if (mHttpsAcceptEncodings.IsEmpty()) {
mHttpsAcceptEncodings = aAcceptEncodings;
}
}
return NS_OK;
}After the change: nsresult nsHttpHandler::SetAcceptEncodings(const char* aAcceptEncodings,
bool isSecure, bool isDictionary) {
if (isDictionary) {
mDictionaryAcceptEncodings = aAcceptEncodings;
} else if (isSecure) {
if (auto value = MaskConfig::GetString("headers.Accept-Encoding")) {
mHttpsAcceptEncodings.Assign(nsCString(value.value().c_str()));
return NS_OK;
}
mHttpsAcceptEncodings = aAcceptEncodings;
} else {
mHttpAcceptEncodings = aAcceptEncodings;
if (mHttpsAcceptEncodings.IsEmpty()) {
mHttpsAcceptEncodings = aAcceptEncodings;
}
}
return NS_OK;
} |
|
You can check the behavior with a stock Firefox on https://echo.free.beeceptor.com/ |
|
I made another PR with different approach: #478 |


The current patch was breaking the Dictionnary flow.
HTTP must stay different also using different accept encoding, so I'm applying the patch only when it's secure.
It's fix this rendering issue

Fix #473
Fix #464