The accepted answer works for me only the first time that page is loaded, but after the browser is resized or I change from landscape to portrait in mobile devices the Facebook Plugin (version 3.2) doesn't adapt to my container. The solution for me was just check the Adapt to plugin container width, and add a listener to know when the page is resized then I remove the facebook iframe and load it again.
window.addEventListener('resize', this.resize);
resize = () => {
document.querySelector('.fb-page').classList.remove('fb_iframe_widget');
document.querySelector('.fb-page').classList.remove('fb_iframe_widget_fluid');
FB.XFBML.parse();
};
By the way, I added a timeout to avoid multiple refreshing while the user is resizing the page, but it's optional
var FB_UPDATE_TIMEOUT = null;
window.addEventListener('resize', this.resize);
resize = () => {
if(FB_UPDATE_TIMEOUT === null) {
FB_UPDATE_TIMEOUT = window.setTimeout(function() {
FB_UPDATE_TIMEOUT = null;
document.querySelector('.fb-page').classList.remove('fb_iframe_widget');
document.querySelector('.fb-page').classList.remove('fb_iframe_widget_fluid');
FB.XFBML.parse();
}, 100);
}
};