I have an iFrame (https://example.com/iframe) that runs within http and https protocols (ie. http://example.com and https://example.com/login).
This iFrame has a conditional that sometimes forces a page refresh
window.top.location.reload();
When on https://example.com/login the reload works fine. When on http://example.com the reload doesn't work (as expected due to same origin). This is OK. The iFrame is doing other background activities that are good for the user experience in both instances.
This is the error that Chrome gives, I am sure others do the same:
Unsafe JavaScript attempt to access frame with URL http://example.com from frame with URL https://example.com/iframe. The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http'. Protocols must match.
MY QUESTION: Is it Ok to have this error? It doesn't bother me, but will it impact the user experience, stop certain browser activities, etc?
This doesn't effect the functionality of page. You are seeing this error because your main page is from https://
and iframe you are loading in that page is from http://
, That is the only reason. Try using relative protocol e.g.; <iframe src="//example.com"/>
and try to correct this warning. It is ok to have this error but this error should be solved because this may impact user experience in few circumstances depending your page code approach.