MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Does configuring a SPOF in WebPagetest consider Javascript async feature?

WebPagetest Forums

Full Version: Does configuring a SPOF in WebPagetest consider Javascript async feature?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

I just stumbled upon a problem with our Facebook integration on our mobile marketplace And as Facebook seemed to have problems yesterday (December 2cd, 2015) in the United States, we seemed to have problems too. Although we integrated their Javascript using the async annotation (

Anyway, I tried to reproduce the problem using WebPagetest and the SPOF feature with Chrome browser on Dulles, emulate mobile feature enabled and a SPOF configured to And I was able to reproduce the issue (see

I still ask myself, whether this is really a problem, or whether the used Chrome browser or WebPagetest maybe just ignores the async annotation. Can you clarify that please?

Thanks for your help.

Hmm. I can't figure out why but all of the browsers seem to be blocking and as best as I can tell the async script is about as async as it gets (both by dynamically attaching the script element and by having the async=true bit set).

WebPageTest just runs the browsers as they would normally run and Chrome should be honoring the async attribute (and anyway treat it as async since it attached).

FWIW, it also reproduces in Firefox:

I tried using dev tools timelines to see in case maybe there was another script was using document.write or something ugly but it didn't look like that was the case.

As far as I can tell, it's a real issue and something related to how it is embedded in the page. Just can't tell why yet.

thanks for the quick reply! I just wanted to make sure that my observation is correct. I will look into this tomorrow with one of our frontend devs. If we find out what we did wrong, I will post it here.


we found the solution on the Facebook blog.

Instead of integration the Facebook script via an async script

(function () {
    var e = document.createElement('script');
    e.async = true;
    e.src = '//';
} ());

we need to integrate it via an iframe to really have it run asynchronously and non render blocking.

(function() {
    var url = '//';
    var iframe = document.createElement('iframe');
    (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0";
    iframe.src = "javascript:false";
    var doc = iframe.contentWindow.document;'<body onload="'+
               'window.inDapIF = true;' +
               'var js = document.createElement(\'script\');'+
               'js.src = \''+ url +'\';'+

The iframe technique should bake it not block the page onload event but the async script shouldn't block page render/loading the way it was. Still very bizarre.
Reference URL's