0

whenever I visit my angularjs based website that loads images (http images on a https server) I get warnings in the console saying that mixed content has been blocked. And those images do not show up

It is not my browser because it happens on other browsers too and on other systems, it is not the server, because another website that does not use angularjs works fine. So I think it is related to angularjs.

I already did this:

$sceDelegateProvider.resourceUrlWhitelist([
    'self',
    'http://images.RESOURCE.net/*'
]); 

but it does not do anything. Moreover I tried loading them over a protocol-less url so //images.RESOURCE.net

This causes them to be loaded over https but then the server identify of the image server could not be validated and it also does not work.

Is there anyone who can determine the actual problem, is it angularjs and can angularjs fix it? It is almost impossible to remove angularjs from the project at the current state.

Thanks

-xCoder

5
  • has nothing to do with angular ... it's a browser security feature. Easy topic to research Commented Oct 21, 2015 at 17:00
  • so how is it possible, that a non-angularjs system works just fine? on the same browser Commented Oct 21, 2015 at 17:03
  • @xCoder That non-angularjs system likely has CORS enabled. Commented Oct 21, 2015 at 17:05
  • @buzzsaw I've read about CORS but it is the same server, can I programmatically enable CORS? Commented Oct 21, 2015 at 17:05
  • easy enough to check without using angular at all ... open one of the images on https protocol right in browser Commented Oct 21, 2015 at 17:10

1 Answer 1

1

This is not a limitation of Angular. Modern browsers block the loading of mixed (http) content over a secure (https) connection. This can be addressed by adjusting settings in your browser of choice.

Enabling Mixed Content by Browser:

IE: http://wiki.sln.suny.edu/display/SLNKB/Enabling+mixed+content+in+Internet+Explorer

Firefox: http://wiki.sln.suny.edu/display/SLNKB/Enabling+mixed+content+in+Mozilla+Firefox

Chrome: http://wiki.sln.suny.edu/display/SLNKB/Enabling+mixed+content+in+Google+Chrome

Sign up to request clarification or add additional context in comments.

2 Comments

this won't have any impact on images, browser handles those directly. Mixed content and CORS are different issues
@charlietfl You are absolutely correct. I forgot that images were not part of the explicitly blocked content and are not subject to the same restrictions. While it is still a browser restriction, it is something the end user can address. Updating my answer now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.