mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2258 - Part 1: Support XCTO:nosniff when navigating.
This commit is contained in:
parent
723180132d
commit
e56e5d6cb1
10 changed files with 103 additions and 5 deletions
|
|
@ -166,6 +166,7 @@ nsHtml5StreamParser::nsHtml5StreamParser(nsHtml5TreeOpExecutor* aExecutor,
|
|||
, mLoadFlusher(new nsHtml5LoadFlusher(aExecutor))
|
||||
, mFlushTimer(do_CreateInstance("@mozilla.org/timer;1"))
|
||||
, mMode(aMode)
|
||||
, mSkipContentSniffing(false)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
mFlushTimer->SetTarget(mThread);
|
||||
|
|
@ -549,7 +550,7 @@ nsHtml5StreamParser::FinalizeSniffing(const uint8_t* aFromSegment, // can be nul
|
|||
}
|
||||
|
||||
// meta scan failed.
|
||||
if (mCharsetSource >= kCharsetFromHintPrevDoc) {
|
||||
if (!mSkipContentSniffing && mCharsetSource >= kCharsetFromHintPrevDoc) {
|
||||
mFeedChardet = false;
|
||||
return SetupDecodingAndWriteSniffingBufferAndCurrentSegment(aFromSegment, aCount, aWriteCount);
|
||||
}
|
||||
|
|
@ -874,6 +875,13 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
|||
mObserver->OnStartRequest(aRequest, aContext);
|
||||
}
|
||||
mRequest = aRequest;
|
||||
nsCOMPtr<nsIChannel> myChannel(do_QueryInterface(aRequest));
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = myChannel->GetLoadInfo();
|
||||
mSkipContentSniffing = loadInfo->GetSkipContentSniffing();
|
||||
|
||||
if (mSkipContentSniffing) {
|
||||
mFeedChardet = false;
|
||||
}
|
||||
|
||||
mStreamState = STREAM_BEING_READ;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue