An error appears in the facebook comment plugin that causes an endless loading cycle when the comment plugin is loaded on devices that support Retina.
One of the fb js scripts has a line that looks like this:
if(window.devicePixelRatio>1)document.location.reload()
therefore, if you are viewing a page on a device with a high-density screen, you are doomed.
I reported a problem here
I came up with a dirty hack to fix this, but think twice before using it, it may stop working at any time.
Please note that this approach only works when you insert the plug-in into UIWebView, if you have a problem when you access the page on safari, there is no other choice but to wait for a fix from facebook.
My idea was to "fix" the js code on the fly when it loads using UIWebView.
To process requests on the fly, I created my own implementation of NSURLProtocol:
<FBCommentsFixingURLProtocol.h>
And then I registered it in the delegateβs doing didFinishLaunchingWithOptions:
[NSURLProtocol registerClass:[FBCommentsFixingURLProtocol class]];
I know this is a dirty hack, but still it works.
source share