Bug 902156 - Persist 'disable protection' option for Mixed Content Blocker. r=smaug, tanvi

This commit is contained in:
Christoph Kerschbaumer 2013-08-19 10:20:20 -07:00
Родитель d07c2c7839
Коммит 69f8df81a4
1 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -9552,9 +9552,20 @@ nsDocShell::DoURILoad(nsIURI * aURI,
if (mLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT) {
rv = SetMixedContentChannel(channel);
NS_ENSURE_SUCCESS(rv, rv);
} else {
rv = SetMixedContentChannel(nullptr);
NS_ENSURE_SUCCESS(rv, rv);
} else if (mMixedContentChannel) {
/*
* If the user "Disables Protection on This Page", we call
* SetMixedContentChannel for the first time, otherwise
* mMixedContentChannel is still null.
* Later, if the new channel passes a same orign check, we remember the
* users decision by calling SetMixedContentChannel using the new channel.
* This way, the user does not have to click the disable protection button
* over and over for browsing the same site.
*/
rv = nsContentUtils::CheckSameOrigin(mMixedContentChannel, channel);
if (NS_FAILED(rv) || NS_FAILED(SetMixedContentChannel(channel))) {
SetMixedContentChannel(nullptr);
}
}
//hack