no mixed content for sites like quitter.se

This commit is contained in:
Hannes Mannerheim 2015-06-10 01:47:50 +02:00
parent f0aff8cb97
commit c95be84e60

View File

@ -149,7 +149,15 @@ function getFromAPI(stream, actionOnSuccess) {
// profile card from user array, also cache it
if(request.getResponseHeader('Qvitter-User-Array') !== null) {
var userArray = iterateRecursiveReplaceHtmlSpecialChars($.parseJSON(request.getResponseHeader('Qvitter-User-Array')));
var qvitterUserArrayHeader = request.getResponseHeader('Qvitter-User-Array');
// quitter.se fix
if(window.thisSiteThinksItIsHttpButIsActuallyHttps) {
console.log(qvitterUserArrayHeader);
qvitterUserArrayHeader = qvitterUserArrayHeader.replace(new RegExp('http:\\\\/\\\\/' + window.siteRootDomain, 'g'), 'https:\/\/' + window.siteRootDomain);
}
var userArray = iterateRecursiveReplaceHtmlSpecialChars($.parseJSON(qvitterUserArrayHeader));
userArrayCacheStore(userArray);
addProfileCardToDOM(buildProfileCard(userArray));
}