Fix some javascript errors

That were being generated because it seems now the content of iframes
gets set to about:blank during loading.
Add workaround for Fennec bug 887113

https://bugzilla.mozilla.org/show_bug.cgi?id=887113