Revert "Reload iframes after window is loaded to fix iframes not loading (#981)" (#1006)

This reverts commit 936be59d4314bd27417e2ad856b828dae0b609e2.
This commit is contained in:
Calvin Wu 2020-11-10 21:29:16 -05:00 committed by GitHub
parent c0efe01ce2
commit 0cbe35992f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -275,23 +275,6 @@ if (matchDomain('elmercurio.com')) {
}
}
}).observe(document, { subtree: true, childList: true });
// Reload iframes after window is loaded to fix iframes not loading
document.addEventListener('readystatechange', event => {
if (event.target.readyState === 'complete') {
const iframes = document.querySelectorAll('iframe');
iframes.forEach(iframe =>
window.fetch(iframe.src).then(function (response) {
// The API call was successful!
return response.text();
}).then(function (html) {
// This is the HTML from our response as a text string
iframe.outerHTML = html;
}).catch(function (err) {
// There was an error
console.warn('Something went wrong.', err);
}));
}
});
} else if (matchDomain('technologyreview.com')) {
window.setTimeout(function () {
const bodyObscured = document.querySelector('body[class*="body__obscureContent"]');