How to handle Mixed Content blocker in Firefox via WebDriver
In new version of Firefox, recently I encountered mixed content blocker where page given in specific frame was not loading. I noticed on the top of the screen in latest Firefox there is an icon on the top of the screen
What is Mixed Content?
You can find very detailed explanation on Mozilla support page but just for quick explanation if you don’t want to read there:
“HTTP is not encrypted but HTTPS and if you have a http content into HTTPS page then there are chances that your content can be hacked and its known as Mixed content”
How to Handle manually
To handle that you need to click on dropdown next to Keep Blocking and select option “Disable Protection on This Page”.
After disabling, your content will display but with orange warning triangle as below.
To learn more about this refer:
How to handle using WebDriver
To handle this, you need to change the preference setting before starting the Firefox driver. To access preference type about:config in address bar, accept the agreement and type “mixed_content” in search field, you will see the following.
security.mixed_content.block_active_content : false
security.mixed_content.block_display_content : true
This is causing content not to display. Before launching Firefox driver, you need to change these preferences to allow content to display as below.
Now if you open website with mixed content, it will load without any issue.
Warning: Just make sure with your development team if it’s valid for application to load.